Skip to content

Instantly share code, notes, and snippets.

@Jessime
Last active October 17, 2015 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jessime/5fbf76e9437fdaa5d182 to your computer and use it in GitHub Desktop.
Save Jessime/5fbf76e9437fdaa5d182 to your computer and use it in GitHub Desktop.
Excision Walkthrough
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Excision Walkthrough "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## WARNING: SPOILERS BELOW "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## WARNING: SPOILERS BELOW "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## WARNING: SPOILERS BELOW "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## WARNING: SPOILERS BELOW "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## WARNING: SPOILERS BELOW "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Key "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Locations are headers \n",
"\n",
"<span style=\"color:red\">Passwords are red</span>\n",
"\n",
"<span style=\"color:blue\">Instructions are blue</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Base Camp"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Welcome to *Excision*.\n",
"\n",
"Before we set off on our adventure, I think it's only fair to give you some provisions for your journey. They come mostly in the form of the basic philosophy of *Excision*. You're going to be playing the role of an Agent who runs into some unique circumstances which are going to require some equally unique talents. But I'm sure you're up for the job.\n",
"\n",
"The basic objective of *Excision* is to complete a number of stages. There will also be an accompanying story, but I'll explain up front that the basic template for each stage is (with some variations):\n",
"1. Read the story. It provides important context for the stage, and it's entertaining!\n",
"2. Work through the puzzle at that stage.\n",
"3. Uncover the password necessary to unlock the next stage/clue.\n",
"4. Find the location of the next stage/clue.\n",
"5. Repeat.\n",
"\n",
"The game itself has a few main themes, which closely echo the themes of this blog. Computers and programming are really exciting subjects, not to mention increasingly ubiquitous in our everyday lives. Unfortunately, they can seem intimidating to learn. I'm hoping these stages can walk you through a few of the basics. Of course, since this is a bioinformatics blog, there's an emphasis on computing in biology, but the skills necessary to complete the stages are useful in any field. There is almost always more than one way to get to the next stage. Think creatively. Think logically. Talk to other people; sometimes people think about things in different ways.\n",
"\n",
"Of course, what's a game without a prize? The first person to complete the final stage of the puzzle will be the winner of \\$50! The \\$50 can be sent directly to you (cash or check) or donated in your name to your favorite charity.\n",
"\n",
"Additionally, here's a brief reminder that, while anyone can play *Excision*, to be eligible for the prize you have to like the new Facebook page for the blog: www.facebook.com/WhatIsBioinformatics\n",
"\n",
"I'm trying to separate my personal Facebook account from the blog, and this is a good way of doing it. More importantly for the game, the Facebook page is the platform of the referral/reward system.\n",
"The Facebook page is how you can earn personalized hints in order to complete *Excision* more quickly. Games are always more entertaining when played with friends, so invite yours to like the page and help you solve the challenges. Below are the specifics of how to earn and spend hints:\n",
"\n",
"* If someone mentions your name in a comment or a post on the Facebook page, you earn 1 hint.\n",
"\n",
"* If you share the Facebook page on your Facebook account, you earn 2 hints.\n",
"\n",
"* Special \"Bonus Hints\" times will give Agents unique ways to earn extra hints.\n",
"\n",
"* You can spend hints by sending a private message to the Facebook page.\n",
"\n",
"* In the message, describe how you earned your hint (Comment/Share/Bonus Hints).\n",
"\n",
"* If you earned your hint via a comment, include the name of the person who mentioned you.\n",
"\n",
"* Include whatever question you want to have answered.\n",
"\n",
"* While responses may not be immediate, one of our team members will get back to you within 24 hours.\n",
"\n",
"* Questions asked can be retracted, for whatever reason, at any point before a clue has been given by sending the message \"Please ignore the previous question\".\n",
"\n",
"* Retracted questions will not cost a hint.\n",
"\n",
"* Hints can be stockpiled indefinitely and do not need to be spent any given time, even during Bonus Hints.\n",
"\n",
"A copy of the official rules for the *Excision* contest may be found at http://tinyurl.com/oq3aw4r. Continuing to the first level from this blog post implies that you have read and accepted the rules and that you know what it takes to be eligible for the prize.\n",
"\n",
"Note that this is Base Camp. A few of the stages are located here, though they're encrypted and password-protected. When you're not sure where to go next, always try returning here.\n",
"\n",
"A final tip: a good Agent, like a good scientist, always cHecks their <u>*source*</u>, not jusT the <u>*source*</u> of the inforMation he/she is <u>*currently looking at*</u> but also aLl the way back to the <u>*beginning*</u>.\n",
"\n",
"Have fun and enjoy *Excision*!\n",
"\n",
"Who was it?\n",
"\n",
"\n",
"What COUNTRY *space* STREET ?\n",
"\n",
"\n",
"What is he?\n",
"\n",
"\n",
"Where? xx.xxxxxx *space* xx.xxxxxx"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Source code of A Prelude (Part 1) "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Clue!\n",
"\n",
"Clue!\n",
"\n",
"Clue!\n",
"\n",
"Oh boy! You found a clue in all this text! Before I set our scene and give you the first puzzle, let me take a just a few more words for some additional tips. There's a theme to this hunt and a few tools that will be indispensable. First, Google will always be your friend. For most of us, it's our portal to the internet and therefore a portal for answers when we need information or don't know how to do stuff. You'll likely encounter both cases shortly. Second, if you're feeling ambitious at the moment, try downloading Python, my language of choice. It definitely isn't necessary, but it might help a bit in the long run. Third, strike a balance between thinking for a while and taking breaks. This hunt is meant to be difficult and take some time, but staring at the same problem too long is often unfruitful. Lastly, keep in mind that in this case there's nothing off limits and no way to cheat. Get the answers to these clues however you can. That's the point. \n",
"\n",
"Anyway, I lied slightly when I said you were an Agent. You're currently a Novice, about to graduate from the academy. It's the morning of your last final, Biology 410. You switch on the daily announcements as you start getting ready for the day. While putting on your uniform, you hear the international portion of the announcements inform you that there are celebrations in Korea today, as the nations of North and South Korea finally reunited last night. Next door, however, another outbreak of MRSA has appeared in Russia, which continues to concern the international community. You think to yourself that you should consider paying more attention to the global news, since you didn't know the Koreans were considering merging. The MRSA situation you were well aware of, since there have been deadly cases near you as well. As you pack your backpack to head out the door, the announcements end by reminding you that next weekend is graduation. Everyone is invited to attend \"the initiation of the government's next class of premier Agents\". \n",
"\n",
"You stop by the dining hall and meet up with your friend Kevin. You both get a bowl of whole grain cereal and some strawberries, kindly provided by the National Food Committee. Current class grades for Biology 410 were released last night, so you do a quick calculation to realize you'll need to receive a perfect score on this exam, including the bonus question, to get the grade you want. The two of you go over all of your notes one last time then head over to the exam room. You make your way through the regular portion of the exam, fairly confident that you haven't missed any. The bonus question is below; answer it to continue. \n",
"\n",
"\n",
"Bonus: Wikipedia is an excellent source of information. Sometimes we can link hop (start from a page and follow hyperlinks from one page to another) to find information on whatever subject we're researching. That's what we're going to try. Go to: http://en.wikipedia.org/wiki/Stem_cell\n",
"\n",
"Now, find the answers to these statements to move to the next link/clue. The letter at the end of each clue will be used as a variable to represent the answer to the current clue in the following clue.\n",
"1. These types of stem cells can be made in the lab from odd parts of the body. (X)\n",
"<span style=\"color:red\">Induced pluripotent stem cell</span>\n",
"2. X are naturally made by this process. (Y)\n",
"<span style=\"color:red\">Reprogramming</span>\n",
"3. Y is mostly accomplished by getting rid of this. (Z)\n",
"<span style=\"color:red\">DNA methylation</span>\n",
"4. In mammals, changes in Z are often not as critical as changes to this protein structure. (W)\n",
"<span style=\"color:red\">Histones</span>\n",
"5. W is a major part of this, and can make it loose or tight. (V)\n",
"<span style=\"color:red\">chromatin</span>\n",
"6. Congratulations, by finding V, you know the answer.\n",
"\n",
"Clue!\n",
"\n",
"Clue!\n",
"\n",
"Clue!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You're observant. After you have your word, you need to know what to do with it. Look around the blog a little."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Encryptions Post "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Do you know the answer? Do you know the question?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">chromatin</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Congratulations, Agent: you've graduated from the academy! With your short but impressive resume, you've landed a job immediately. Of course, it does help that you're being employed by The Congressman. The Congressman is a friend, and you two go way back to before he earned his nickname...one which he deserved even before running for the office he now holds. As he has to go to Japan for a couple weeks, he tells you to talk to Anita, his other employee. Anita graduated from the academy as well, at the end of your first year there. She was at the top of her class, if you remember correctly. Over the next couple of weeks, you stay busy working with Anita on a number of nondescript projects. The Friday before The Congressman gets back, you ask Anita how she likes working for him. She says it's great, that something exciting is almost always going on, and that he's a good boss. She has to leave early today but says that over the weekend she would like for you to analyze an image for her. There have been reports lately of a high number of difficult births in the area. Anita knows some people and has gotten her hands on some of the lab data from these cases. Specifically, she has some images of HUVE cells. She says to just send her an email at anita.2011academy@gmail.com with the word \"Reminder\" in the body of the email, and she'll send you the image and more specific instructions."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">email at anita.2011academy@gmail.com with the word \"Reminder\" in the body of the email</span>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# -*- coding: utf-8 -*-\n",
"\"\"\"\n",
"Created on Sat Mar 28 13:25:38 2015\n",
"\n",
"@author: JMK\n",
"\n",
"Issues: The overall quality of this code is dubious at best.\n",
"Chain messages seem to be a bit faulty.\n",
"The logging could use more consistancy.\n",
"\"\"\"\n",
"import imaplib, smtplib, email, time, string\n",
"from email.mime.application import MIMEApplication\n",
"from email.mime.multipart import MIMEMultipart\n",
"from email.mime.text import MIMEText\n",
"from ssl import SSLError\n",
"from socket import gaierror\n",
"\n",
"def record(path, sender, body):\n",
" with open(path,\"a\") as record:\n",
" record.write(time.strftime(\"%H:%M:%S\")+\"\\n\"+sender+\"\\n\"+body+\"\\n----------------------------------------------------------------\")\n",
"\n",
"def gen_response(body, sender):\n",
" \"\"\"Return response based on contents of body of email. Log responses\"\"\"\n",
" print sender+\"\\n\"\n",
" sentences = body.split(\"\\n\")\n",
" int_ans = None\n",
" response = \"\"\n",
" punct = string.punctuation\n",
" remind_ls = [\"Reminder\", \"reminder\"]\n",
" danger_ls = [\"dangerous\", \"Dangerous\", \"DANGEROUS\"]\n",
" for line in sentences:\n",
" line = line.strip()\n",
" line_ls = line.split()\n",
" for word in line_ls:\n",
" if word[-1] in punct:\n",
" word = word[:-1]\n",
" if word.isdigit() and int_ans == None: #Get the first integer\n",
" int_ans = int(word)\n",
" if word in remind_ls:\n",
" response = \"Thanks for reminding me!\\n\\nHere's the attachment I promised. I got a bit farther than I expected. All I need you to do is confirm my computer's count for how many whole nuclei are in the image. Just email me your answer whenever you get it!\\n\\nBest,\\nAnita\" \n",
" record(\"A:/Library2/Documents/Blog/Sent.txt\", sender, body)\n",
" if word in danger_ls:\n",
" response = \"Whoa! That's not language you should throw around lightly. Delete this email and take that somewhere else.\" \n",
" record(\"A:/Library2/Documents/Blog/Sent.txt\", sender, body)\n",
" print str(int_ans) + \" \" + str(type(int_ans)) \n",
" if type(int_ans) == int and response == \"\": #\"Reminder gets priority over nums \n",
" if int_ans == 98:\n",
" print \"equal\"\n",
" response = \"Great, I got \"+str(int_ans)+\" as well. But did you actually look at the image? Do you see any other interesting results when you play with the photo?\" \n",
" elif int_ans > 98:\n",
" print \"greater\"\n",
" response = \"It looks like you've given me a value of \"+str(int_ans)+\", but I think that's a bit high. Would you mind verifying?\"\n",
" elif int_ans < 98:\n",
" print \"less\"\n",
" response = \"It looks like you've given me a value of \"+str(int_ans)+\", but I think it's a bit low. Would you mind verifying?\"\n",
" record(\"A:/Library2/Documents/Blog/Sent.txt\", sender, body)\n",
" print response\n",
" print \"_____________________________________________\"\n",
" if response == \"\":\n",
" response = \"I'm sorry, but I really have no idea what you're trying to tell me.\\nFeel free to email me again though\"\n",
" record(\"A:/Library2/Documents/Blog/Errors.txt\", sender, body)\n",
" return response\n",
" \n",
"def send_mail(send_to, body, user_name, password):\n",
" \"\"\"Reply to the sender, using gen_response.\"\"\"\n",
" subject = \"Cells\"\n",
" path = \"A:/Library2/Documents/Blog/\"\n",
" base = \"HUVE_cells.png\"\n",
" msg = MIMEMultipart(\n",
" From=user_name,\n",
" To=send_to,\n",
" Subject=subject) \n",
" msg.attach(MIMEText(body))\n",
" if body[:23] == \"Thanks for reminding me\": #Only send attachment on first email.\n",
" attachment = MIMEApplication(open(path+base, \"rb\").read())\n",
" attachment.add_header(\"Content-Disposition\", 'attachment; filename=\"%s\"' % base)\n",
" msg.attach(attachment)\n",
" smtp = smtplib.SMTP('smtp.gmail.com', 587)\n",
" smtp.ehlo()\n",
" smtp.starttls()\n",
" smtp.login(user_name, password)\n",
" smtp.sendmail(user_name, send_to, msg.as_string())\n",
" smtp.close()\n",
" \n",
"def auto_get_mail():\n",
" \"\"\"Connect to gmail, read all unread, and call the send_mail function\"\"\"\n",
" message_server = imaplib.IMAP4_SSL('imap.gmail.com', 993)\n",
" user_name = \"Anita.2011academy@gmail.com\"\n",
" password = \"treasure hunt\"\n",
" message_server.login(user_name, password)\n",
" stat,count = message_server.select('Inbox')\n",
" status, unread_ids = message_server.search(None, '(UNSEEN)') #Find ids of unread emails\n",
" unread_ids = [int(eid) for eid in unread_ids[0].split()] #Convert ids to ints\n",
" for eid in unread_ids: #For all unreads, extract the body and email address of sender, reply to sender\n",
" stat,content = message_server.fetch(eid, '(RFC822)')\n",
" message = email.message_from_string(content[0][1])\n",
" try:\n",
" body = message.get_payload()[0].get_payload() #Confusing syntax from imaplib\n",
" except AttributeError:\n",
" body = message.get_payload()\n",
" sender = email.utils.parseaddr(message['from'])[1] #Who sent the email / Who to respond to\n",
" response = gen_response(body, sender)\n",
" send_mail(sender, response, user_name, password)\n",
"\n",
"def main(): \n",
" while True:\n",
" try: \n",
" auto_get_mail()\n",
" time.sleep(5)\n",
" except (SSLError, gaierror, imaplib.IMAP4.abort):\n",
" print time.strftime(\"%H:%M:%S\")\n",
" for i in range(5):\n",
" print \"Error. Likely no internet connection... Trying again in {} minutes.\".format(5-i)\n",
" time.sleep(60)\n",
" print \"Reconnecting...\\n\"\n",
" \n",
"if __name__ == \"__main__\":\n",
" #main() #Changed for notebook\n",
" pass #Changed for notebook\n",
" "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">After emailing the first time, count the cells and get 98. Email that to her. She'll tell you to look at the image a bit harder. Play with the contrast and the brightness until words appear in the top black bar. </span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">How is working for the boss? He's DANGEROUS</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Go back to the blog at this point.</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Base Camp- What is he? "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">DANGEROUS</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You're not sure how to take the hidden message from Anita. You trust The Congressman and have known him much longer than you've known Anita. At the same time, Anita doesn't seem like one for drama or exaggeration. It's not like you have much time to dwell on the matter, though. The Congressman emails you and says that one of his associates in the Justice Center is having trouble analyzing some sequence data. Normally, it would be as simple as running it through a script The Congressman is somewhat famous for having developed, but this particular piece of data doesn't seem to be working. You should see if you can figure out what's going on before The Congressman gets back. The associate just works across town so it should be a quick drive\n",
"\n",
"https://WRONG.google.com/folderview?id=0B0vJr0M-2sGXfm45NVJmR040RUMzdkR3bVJaT1ZLbndyZUg3SFZCZ2h1d2ktX1Q2UU9FUzA&usp=sharing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Change the word </span><span style=\"color:red\">WRONG</span><span style=\"color:blue\"> to </span><span style=\"color:red\">drive</span><span style=\"color:blue\">, and go to that link.</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"https://drive.google.com/folderview?id=0B0vJr0M-2sGXfm45NVJmR040RUMzdkR3bVJaT1ZLbndyZUg3SFZCZ2h1d2ktX1Q2UU9FUzA&usp=sharing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Justice Center "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"When you arrive at the Justice Center and locate The Congressman's associate, he hands you a file. The file, he says, contains a single nucleotide sequence. The issue is that it's a horribly ambiguous sequence, one of the kind sequenced from patients who have that new metabolic disease that seems to become more common each year. Usually, The Congressman's program is capable of making sense of these sequences. This one is not working though, for whatever reason. If you could give it a look, that would be great.\n",
"\n",
"When you are finished helping, you're finished for the day. You can stop by the bookstore to do some browsing.\n",
" \n",
"https://drive.google.com/folderview?id=0B0vJr0M-2sGXfjR0Nl9nLVM0c3VUNFVXSnpDbzBkQk1oT2stVzJ3N3A3c29vX0MtbUpSY3M&usp=sharing \n",
"\n",
"\n",
"\n",
"\n",
"VSRRGMDNRNRNDWDHGTYBBNWMANVRBGXVYVVMDYGRYMSHNUGTXRMYTWUWGHWYCUSBBUMKAGSSDUGSSUHYXMXVKMCHHACDRUKKXGCDHYUDMGYMYKMMADNUCHAVUGSDRMBXSYBSNNDDRUKSUKVDDUXNXNHRSDCWKGVHGMUGRHTYNVAGURCUKMYDVYHCYYCDNCCSSMTHTGASKNWCHDRBBBHAVHBXXKSRNXSRBRSCTUUYGNHRTSKMUMGDSYHCUKADCSGGKWVTYKXHCVCXXMUSGSASMSSMMYAANURAUSUDSDGTKTNWNSHMWAACWNTVHTTCTCBSYUATAXBMWKUNNYVVAXDBVRGASWXXASHRMRAKUMUBRSMKYAWBCBYXMCNUUVBRWRNBWMMVXWSRBRXCRDNNXTDXKKUSMBUVWXKNGDXBHVWVDBAUDNVZRVDTWDSAGVMWVKRRSVBVMCAGVNRWCBYSNWHWKGMUAAAXSYMNTSVVCMGTUKCYUVSCATXHNTGXCHVKVAHYAWMXUVVBNWYWHTKUDSMKVCYNSKBURXRAAXKVHXXCVAVRTASMGCAHVDMRYAVKBCSDYYSVGMMRSRSDBHGRANSSRDVGYXKCVUHCWHXNBRWWNSHRMKNBAAVGHXWUCXCVXGKYGHCSMGCNMRGHVGSNSXNCCGSNWDTCTBMGMUBXSDUHYGDDWMVYUGRWKVHWRXKCNVDYCRWYHNSYBMHSMWKDNMMTTCTKN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},
"source": [
"<span style=\"color:blue\">People should probably go to Wikipedia to find out what the FASTA format is. Then, search the sequence for the any letters/symbols that shouldn't be there.</span>"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ZIP.FILE.FLIP.FLOP.PIE.OIL\n"
]
}
],
"source": [
"valid_fasta = \"ACGTURYKMSWBDHVNX\"\n",
"fasta = \"VSRRGMDNRNRNDWDHGTYBBNWMANVRBGXVYVVMDYGRYMSHNUGTXRMYTWUWGHWYCUSBBUMKAGSSDUGSSUHYXMXVKMCHHACDRUKKXGCDHYUDMGYMYKMMADNUCHAVUGSDRMBXSYBSNNDDRUKSUKVDDUXNXNHRSDCWKGVHGMUGRHTYNVAGURCUKMYDVYHCYYCDNCCSSMTHTGASKNWCHDRBBBHAVHBXXKSRNXSRBRSCTUUYGNHRTSKMUMGDSYHCUKADCSGGKWVTYKXHCVCXXMUSGSASMSSMMYAANURAUSUDSDGTKTNWNSHMWAACWNTVHTTCTCBSYUATAXBMWKUNNYVVAXDBVRGASWXXASHRMRAKUMUBRSMKYAWBCBYXMCNUUVBRWRNBWMMVXWSRBRXCRDNNXTDXKKUSMBUVWXKNGDXBHVWVDBAUDNVZRVDTWDSAGVMWVKRRSVBVMCAGVNRWCBYSNWHWKGMUAAAXSYMNTSVVCMGTUKCYUVSCATXHNTGXCHVKVAHYAWMXUVVBNWYWHTKUDSMKVCYNSKBURXRAAXKVHXXCVAVRTASMGCAHVDMRYAVKBCSDYYSVGMMRSRSDBHGRANSSRDVGYXKCVUHCWHXNBRWWNSHRMKNBAAVGHXWUCXCVXGKYGHCSMGCNMRGHVGSNSXNCCGSNWDTCTBMGMUBXSDUHYGDDWMVYUGRWKVHWRXKCNVDYCRWYHNSYBMHSMWKDNMMTTCTKNGNMRMYUACRGVGSTMNXVSRCASRHDAYDDVUMABDWKBACMDDHBCSBBWKMTHRKAXCBTMUUNADBABKADABSSXRXWRDXSC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WABEGHRRRNAVGSXUANHCUSYRBYXYTMVMBXTGWUDVKMTWNXNR.ADDMDCWHGYYSSMNWXCUMSRXKGGDUBVGNRSUGYYSSWHBWGXNBBSBWDWUGUXYDTKVVSCYVYCXWUMDKANMKWBYACKNGSUWYVGXNKYVUDYTRDCTASDGRHUCTAOSSMGSSWTUGCSVNCRVUNTMGHCUGXDAMWTMHUARURSMDSRUSTYWBAHHMXVNANKHKUUXHRXGYSKUNSUSHBKBKTNKANHKDXTKVUHHWAYHWVDUYWNBHUXMCUATYYHKCKXTWSCMVWDUGXNUURVKBUSUDXCKGWRTGYAVHKXSHDRTKHCUYXSTVYNVSMTTCYSNYCDBRXRBSTDURXKRTYWNBNWDYKSBHGMXHSXYKVTUNVMCYNBTMAXXRRVNCKURDYCRBYIVDTDRRDTBNTUDRCTDRBCNCWCTUUTWHHXNVMBWSCGHBDYCRUGXYSKYGGNNKSGSSVVKKBMHNWYHYNWSUGWTXATDDXGVGTUBRSXCCXUBCDGKHSVYBNSVDUMNYHBMKGBAMTAXGAMSKSYVMVWGCNBYXRCXGSRYYWAACRSNVNDRCCSGXBTRDWUTKDRCNUKVRDKHYWUTDURXGNBKBYATSCVRBUYTDYYDWTTBCTYTVASGHTDANVRXNTTSBXVUWTADBUWXTSXVKUVRYNWGSBUHVNNAHRUTUGHYXGCBSNGSRVTARUAUNRAWXRKYGGKYNBNTNNHWAXKVVKRDYYGWGNVYBXHCRBHVWTCRLAMAABBNTHHYXHTDRAVBKDRHKRGUHHYSDDCGSCCAGSWNXVYGMSYDCDMVTSMCUMGDBKSBDXMVKVNHRHGXRTGUYWSUARKDMYVHKKCWCSAANVWANWSMBSUBWSTYURUKNNUYBBVUCDAUSWVSXNGTSTHWCBYWWAWAYHGCWWKVWKYTXKACWTNXYRDRG\"\n",
"out = [l for l in fasta if l not in valid_fasta]\n",
"print \"\".join(out)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"<span style=\"color:red\">ZIP.FILE.FLIP.FLOP.PIE.OIL</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Book Store- FLIP FLOP.zip"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Congrats, Agent! You figured out what was wrong with that sequence, and the associate is back to doing his analysis. Unfortunately, you and The Congressman have a murder mystery to solve. Someone was killed on The Congressman's flight back from Japan. The story that The Congressman tells makes it seem like everything happened rather quickly and there was a decent amount of commotion involved. The end result is that one man was poisoned and is now dead. The upside is that, besides having the roster for the flight, you found a piece of the criminal's DNA at the crime scene. How the criminal got away while on a plane remains a mystery....\n",
"\n",
"AATAGCTGGCCTTGTCGTGGCGGCTCGTTTGTT\n",
"\n",
"What's even better is that Anita has already done a decent amount of work for you. She's compiled a list of suspect's and gotten some DNA for each of them in a file. She was just about to see if there were any matches when she was called off to another project.\n",
"\n",
"who_dun_it.py is a Python script that has the suspect's names and DNA loaded. Don't worry, you don't have to have Python installed on your computer. You can make the file open as a normal text document. Then, just go to https://trinket.io/, copy and paste the code, hit the run button, and see who the killer was. \n",
"\n",
"Okay, fine, it's not quite that easy. There's one line of the script that needs to be changed. Hint: it isn't any of the lines of the suspects DNA or names. Can you see what's missing?\n",
"\n",
"Once you know who did it, you'll report back to the Congressman and see if he has left you any messages back at Base."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Please try again. Did you fill in the criminal_sequence with the data?\n"
]
}
],
"source": [
"# -*- coding: utf-8 -*-\n",
"\"\"\"\n",
"Created on Sat Feb 07 20:20:59 2015\n",
"\n",
"@author: JMK\n",
"\"\"\"\n",
"\n",
"criminal_sequence = \"seq\"\n",
"sequence_list = ['AGGAGCACTAGAGGAAAGGAGGAGTGTAAACGACCCATTCGTATCCGCGAGAGCCGTGAAGGAATCAATTGAGATTTCTCCGGGGCAGTGTCCGGTAACC',\n",
" 'CTATTTCTTGCGCCTAACCTAAAGCGAATGTCTCTGTGGCCTCCTATTGTAAGCCTGCCAAAAGCCAGAAATCGATTCAGCAAAATGAGGCGTCAAATCC',\n",
" 'CCAGTAGTAGTAGTCAAGAGGGCCGCAAGGATGTGAAGAAAGCCCTGTTACTCGTTGGTATTCATGCGTAATGACTGCTGTATCAACTCTCTGTTATCAG',\n",
" 'ATTTTCAGCTACGAAACCAGACGTCGTTTCGTCCTTATTTACGGATTACCCTCGCAATTGTTGCCGTCCTCTATAACGCTGATGAGTAAACCATTGGGAT',\n",
" 'CGCCCTACCGGCTATGCGAAACCCTCGTCGCTTCGTGGGAAGCGCTTGCATCTTAACACTACCGAATTGACCCCTCTCACCCACGGCATTTAACCCATTT',\n",
" 'CTTCCAAATCAAATAGTAGTAACTGGTCTTTAACCATGCACGAAGGAACCCTAGAGCTCAAGAAGAAAATCAGTCGCGATAATAAGCGCATTCCCGCACT',\n",
" 'GAGCCGCGGTGGACCTATGGCGTACAGGTTGCAGCAGTCTTAAATGGGGAGGCTGCGTCCTAGGCTAGTTTTGCCTTGTTATGATTTTGCAATTCAATTT',\n",
" 'TTACGACCGTAGCAGAAGGTTCTTTAAGGCACAGGGTTGTCCGGGAACAGGGATATGGCCCTACAACTGGAGCTGGACGGGTACGATCTGTTGTATTATT',\n",
" 'GGAATGATGCCTTCTTCCAGCCGTTAGTGTAATGACCGCGGAACTCGGTGCGCCATAGGAGTAGGAGCGTCTGCCGGGGACTTCTGTGTCTAGCCAAATA',\n",
" 'CTATTCCCTAGTAGGAGGGAGGTGGGTAGGGGAAAAGCGGGTTGCAATAAAACGTCTCGTCACTGATGTGCAGAACTCAAGCCTACCGCCGATGGGTAGG',\n",
" 'ACCGCATGTGGACCTATAGCAGCGGGTTGCAATAAATTGTTAGTGATATACACGACGTGTAGTCGAAGCAGCTTACACAACTTGGATTCCTCACCCTCTA',\n",
" 'TCAAATTGGCCACGGTGGGTACTGTTATCGTGTGGTTCCACTTACTGTTTTGAAGGTGCTGTGGAACCTCACCACTGGATCTGTAGTAAATCCGCAGTAC',\n",
" 'TGTCTTGTTCGAGCACATTGGCTTTTGGCGCTTGCAGTCTGATGGGCTATACAGCAAGCAGCGTACGACAAATAAACGGCGATATCGCACTCGTATCTCA',\n",
" 'GGGACAGACTAGGCATTGTCCATGCTCCCACCGACTGAATCATCCGCGTTTGGTAGGGGGGCATATAGCTGTCCCACAGAATATTTTTCCGGCTGTTAGC',\n",
" 'CTACGATCACATAACCGCCGTTCCCATGGGTAGACGGGTTCCCATGATCGGAGGCTTTTGGGTCACTAATAGTGCGATAACCGGGAATTGGACCGGCATT',\n",
" 'TTAGCGTGGCTTAACCGGTCCGGTTGGCGCGCGGGTAAGTCAACCATCGCGCTCCGCGCAATCGATGTCGGCGGTCGGCACGGCCGGCCACTTTCCAAAT',\n",
" 'CAGTCTCTTTCATGTGCAGACAAGACAACCACGGCGCGAATAAGAGTACAGGATTCCGAGACACCGTTAAACCTAATAGGACCGTTGCATTGGATTGGAC',\n",
" 'ATCCTGCATTTTCAGGTGTGAATCCCATCTTACGCGGGATACGCCCCTAGCCTGAATCTGCTGAAGCTCTTCGTCGTATCATGAACAAAGTATCTCTCCG',\n",
" 'CTACACGACCACCGAGGCACTAGGGGATACAAGACGATTTATGGAGGCGGATGCGGTGGCCACCATCATTGATCTAAGCTGCCCCCAACGTATGTATCCG',\n",
" 'CGTACCGACAACGTATTGATTTTCAACACTTGCCCGCGCTACAATGGCCCACACACCCGGCAGCACCGACTCCGGTACAAGCTTCTGCAGCGCGGGTAGA',\n",
" 'AGAGTTCCTCGCGTAGCTAAACAGATTGACGTGCTGTAAAGCAGCCGCAATATTGCCTCAGGAAGCCAGTTCGTGTCATGGGGTGAGACAAGTGAAGGGC',\n",
" 'ATGCTAATGACATAGCTCAAGTTCTTTTACTCGGTTGGTACGAGTATGTCGGGGAAATCACTTACATCATATAACATAATTACTGTCCAAACAGCAACTT',\n",
" 'TCGCAATGTAGTGAAGTTCGTGAGTCGTGAAGCAGCGACCCGCTCAAACACCGACGATTTAGCGTGTCTTAATGGGACTGATGGCAGAATTCTAGCCCTC',\n",
" 'AGCGCACTTTATGCACCCGAACGCTTATTTGACCGGATCGACGCTCTTCTCCTTACATGGCCTTCTAAGTGACTGGGGAACAAGTCTTATAGTGGTTTGA',\n",
" 'TGATCATGTCAAAGTTCGCGGGCAAGCCCGAGATTTTACTTGAGAGTACGTATCAGATAAGTCGTTTGTGGTGACTGGGCCGCCCCTTTACTCCATTGCT',\n",
" 'GCGCTACAATTCAACGAAGAACGATAATCGTATCTGCTAGGTCAGGTATAGTGCCGACGGGAAAACGTGGCTGCTAAACACGGAGAAAGAATGTTGGCCC',\n",
" 'CTCATGCAACATACCTCACTTAGCTAGCAGAGAGAGTGAGTCTTGACAGGCGATCAACCGGACTTGCCATCCTGATACTCATCCGTGGCTCTATGTAAGC',\n",
" 'AGCCTCAATCGTATTCCAATCACGTTATACGCACCACACTCTAAGTGGTGTGTACGCAAGATAAATCTACCCACATCGACTGGATTGCGGCTGTGTTAAA',\n",
" 'CAGAGGAATCTGGTAGACATAGAGCACCTCGAGCTACGGTCGTCCCCGGTTCCCTTCGGGCTAACGTGCGTGTGGAGGGTATGAATAGTTACGACGTGAG',\n",
" 'GATCAGGGACGACTACAAGTCATCTTTGCTAAATGTATGGTGTGGCACCACTACTCACTTGCTCGAGACGTACTAAACATTCGTGCGAATGGGCATGCCA',\n",
" 'CTGTGGCCCTGTTCATGGACATTGTTAACAACCCCAAATGGCCACCATTTCCTCACTGGGAGCAACTATAGTACCCACGATCCAGCAGAGGTTGCCGACA',\n",
" 'TTAACAGCAGACAGCATAGCCCAGAGACCAACGCTTGATTGGACAACATGTCACGGGCATGAAAATTCCGCAGAACGAAGCAGGAGGCCCTCGGTGTGAG',\n",
" 'TTCTCGCGGAGCTGAGAATAAAAAACGGAGTAAAATACGGCCATACAAAGACCGACCACTCTCGCCATGGGGACTGACATGGTGACTTCTGATTACCGAC',\n",
" 'GAAAGGAGGGAAATATTCGTTATGTATACACACCTTACAGTCAACGATACGAGGCCCTCTCGTAGCAACTCAGGGGGAAAAATCGGGGCCTTTAACTCGG',\n",
" 'GGCGGTACTCATTCTTAGAACATGGGGAGTACGGGCGTGAACTCCCTGACGGGGGTGCTAAACCAGCAACGCACGATCAGCTAACCCCTACCAGAGCACG',\n",
" 'GCATTTCGCTGTCGAGAGCATAGGCGATACGACTAACAGGACTAGGTACGCAGAACGTGCCCCTTTCTGCCTAATGACATTTCGAAAGCCCAAGATATGG',\n",
" 'ATATTTATAAACGAGTCTCTGATGATCCAGTAACCCTCCATGGTTATAACACGCGTTTGGCGCGGGGCTCACCCATGTTGAAGCCACCCCTACCGCGGGC',\n",
" 'TGCAGTGCCGCCAGAGGGGTCCGAAGAATAAGTCTACCAATAGGAAATTTACATCTACGGAGCACCGGTCCAATAGGTGTATCACAGGCTGAGAGGCTCC',\n",
" 'TGGGCCCGGAAATCTGAGGTAGTGGCATTCCAACGGGGTGCATCGTTTCTTTGCTCAAGGCGTACGTTCGACCATCGGACTACGGGATCTTCGCGATTAG',\n",
" 'CTAAGCCGAAGAGGTTCACAACAGGAAGACTTACTAGTGGCCTGTTCGTACATTTAGAAAAGTCCTGGGCTGCCTGGTCGATCCCCACTTCCCCAGTACC',\n",
" 'CCGCAGTCCTGAACTCTTAACAAGCGGATCCTCGCCACCATTGCCTGGGAGCGCCCAGGTTGAGACGTGAGGTCCGATAGTACACGACGGATCAAGGGTA',\n",
" 'AGGAACTACGTGGCGTCTTCCTCGGCTTACGTGTAGCATCGATCGATGAATCTTGGATCGAGGTACCGCTAGTCTCACGCACGATTAGGGGGAATCGTAT',\n",
" 'CGAAGCCCATAGTTGGAGAATTAAACTGGTATTACACTCTGCAGACCTACATTCTGGCTCGTCCCGAGGAATAGGGCCATAGAAAAAATAGGTGTCCAAT',\n",
" 'AGAGTAGATTTTATAAGTTCGTTGCGGCTGGTGTGCTTGTCCAAACGCCGTTTCTTGAAACCGATCGTAACTTGTCCCATGCCAACGTTGTCACCTCAGT',\n",
" 'CGGCCACCGCGATGAGCAGTTAGAATCAGAGGGTTGGAAACTGGAGATTCACCGTCTCACCCCCAGCGTACACAATGCCCCAGTTGCTTTTAGGCACCAC',\n",
" 'AGGCTTAAATCTGGTAGAGGGACATTTATGTGGTTTGTTCACTAACTACTATAAGTCCTTAGGATTGTCACACGCGGGTCCATACTACTGAAGATTTAGG',\n",
" 'CACGCTTACCGGGAAGCATTGAGGCAAACTTCAAACAATATATGTAAGAAGTATGGTAGACAGGGTTACAGATAACTCCTGCCGCGCTGCCTTCGCCCAG',\n",
" 'GAAATTAATTATACTGACTGAAATGATACAACCGGCGGTCGTTGCGCAATAGCTGGCCTTGTCGTGGCGGCTCGTTTGTTTGTTTCAGCTGGGGCAAACA',\n",
" 'GGGCTGCGCAGAAGGTGCAAGCTGCCATTCACGCCGGCTGAAACTACAAAACGTAAGTACAGATTGTATATGCCGTAAGACGGATGTAGATTCTTGTAGG',\n",
" 'CGTTAACCCACGAGTCTTGTAGTCTATCTTATAAACTCCCATACACCGTTGGATTCGTTCTGGTGACGTATTAATTAACAACTCCTAACATGTTCACCCC',\n",
" 'ACCCCATGGATCTCATTTGGAGAGCGGAACGTAACTACGATCTCTGAATTTATAACCCCGTGCACGGGAGCGCTATTATGCGGCGTGCCTTCTTTAGCCA',\n",
" 'TATTCCGGCATGGATATTTCGCCCCGGCAACGGCCTGCGCCCGTACTTCTGTCCTGTTGAGTCAACGACGAGTGCGCAGAAAGTGCCTTACTATATTGGT',\n",
" 'CGCGGTGTGGAGACAACTTACTGATTCATGTTGACAATCATTTCGTGTCGTGTAGTACGCTGAACCCGCTGGAGTGCTCATGCAAGACCCGTCCCCGTAT',\n",
" 'TTCCGTTAGAAAAGCTTCGTAGAGCAGCCTTATTACAATTATCATGTTTAACTGTTGATGACAGGGAGCCCGAGACCTAGCTTTGGACTAGCGAGTGAAG',\n",
" 'CCCTGCGCGTGTATCCTTATCAATCTCGCTTCTCTAAGGCACACGCTTTCTTCGTCAATGTGCACAGTGGGACGAGGGGACCTTAATCGATTAGGAAAAC',\n",
" 'CTTCGCGACCTGCAAGGATCACGCTCCTCCGCAGCTTGTTGCGGAGAACTAGGTTCGGAAGCCTTGGACTTGCGGACCGCATACATCTCTGGCGGGGGCG',\n",
" 'AGGAGCTGTGAAGCCTATTGTGGCGACGAGTGGGTCGTAGGGCGGCAGCGGCGGGGTCAATGTTGAACAAAACGCACATCAGAACAGGTCATAAGGTGAG',\n",
" 'CGCACGGTTGAGACGAAGATTACTCGCGGCCCGCCCTACGCCGCCAAGCATATCCCTCCACTCTCCCCCACGGCGTTGGTTTTCGCCCATAATCTAGGAC',\n",
" 'ACCGGGTTTTGGCAGTGGGATTCCATACCCAATCGTGCTGAGGACGACCGGTGCTGGAGTAGGTCGGAGGCCCCGTTGACGATTGTGTAGATAATGGCCC',\n",
" 'GCGTGTCGCACATCCCACTAGTGTGCGTGCTTGACATTGTGGATGTAGTCCGAGCACTAAGTCCTAGAGTTATCATGGGTGCACAATTCGGTCACCCATT',\n",
" 'AGGTCCCGCGCGGTGATATTGCAGTTTGTTATACAAAAGGTCGCTACTCTGCGATTGTCTTAAAAGTAGATCCTGCTCCACTCTATACCGGACTCCGGGC',\n",
" 'AGTGACGAGGTTGTGCCGGCGATGGCGCTGGATAGTCATCCCTTTTGTATCCATCATAACGTGTAAGGATGGTGCGCTCCCGGGTACCGTGACCCCTCCG',\n",
" 'ACCAGGAGAAGGGAGACAAGGTTAGAGAGCAGACCTACACTGGACCGAGATGATCCATCTCCAGAACGCTTCATCTCACTTCTAGACGTGTATACCGAGG',\n",
" 'GACCTCGGCCGGACTGGTCCATATATTTGTGGGCCGAAATAGTCTATGCTAAATCAACCAGATAGGGAATTACCACTGGAAATGATAAGCGTTTAACCGG',\n",
" 'CCGTGCTTGGTTAGAACTAGTCGCGTCCGAGAAACCAGGTGGCTTACAAGGGCGTGACAAGTTCTGAGTTCATTATATGGCTAAGTTCGCTTGGGGGAAA',\n",
" 'TCCGATACGTTCTCTTACCTAAGTAGTTCGACGACCAATGTCAGCATCGGACGAGTGCGTTCTTTAACTGACCTGGACGACGGCTTACATCGTTTGGGTA',\n",
" 'ATTTCCGGACTGTGTTCAGATACTTTTCGTAAGCATTGGTTACGGTCAATTGGCTATATCCGAAAGTCATCATGGATAAGTGGCACATCTCGAAATCAGG',\n",
" 'ACAGTCAGCACTACTGAGAAACGCCGTGGTGGGCAAGGAGGTAGTAGACTTCTATTAGCTTTCCGTTCGCAATTATCTGAGATGTTCTATTGAGCCAGAA',\n",
" 'CCACTCTAAAGTGGACGACGTACCTTGCTATTGGCGCCATTCTAGCTTCGAACGGTCCGTCCTAACTGCCACATGTACCGGACGCGGAAATCGTATAGTT',\n",
" 'ATGACACGGAGCAGAATGGCTGAGATCTTCCATGCATGCAGACGTTTCTCGCGTAGTCTCCTAGGCTCGGCCTCTTCTGATTCCCCCCTACTCCTGTAGA',\n",
" 'TATGTCGACTTTGCTGCACGCCTCCTTGGCAGTGCAAGAGCAGTGGCGGTCTGCCAACCCGCGAACCTATTGGCTCCACATTCGCGTTCCTCTCCACAGA',\n",
" 'TAGCGGCGCACTGCGCCGGGGGGGATTGCTGTGAGCTCAAACATGAGTCTTGCAAGCTATCCAGGCGACTTTCCATATTGGGTTGCGCTCTCTCTTGGCA',\n",
" 'GTCGTAGACGAATAAAGCGCATCATCCGCAGACACCCGACCAAGCGACTCGCATAGCGCAGCAGAGTACTCCCTTGTATGATTCATCACTAGCTCCCTGC',\n",
" 'GCCGGCTACAGGCCTACCAAAGTGTTCCCTCAAAGCAACATTTTTAGGACGGTGGCATGTTCCTATTATTACGCCGGCCTTTGCGGGCGTCATCTGCGAG',\n",
" 'CGGTTCCATCATACTGAGTGGACGGTTATAAAGCTTGTTATAAATTGATTAGCTGGCACAGGTCCAACCATTGATACTTACATTCGCTGAAACACGGAAA',\n",
" 'CTCAGAAATAACCATCGCCTGTTTTGCGAGGGGAAGCAGGAATGGGCCGTTCCTACGATCCTCGCAGAAACCGTAGATGAGCGATTTTGGATGTTCTCCA',\n",
" 'AATTTACGGATCCAATGTGGGAGTGGCTCCATATCATGCCGGGCGCCAAATTTACCTTTGGCCTTCGGCCACCTCCGGATTTTCGGATTGAATAGACAAG',\n",
" 'GGTGGCAGCGGCCGACATGGCGGTTGCACCAGTGAGGAATCTCTATTATGGATCCCCCAAATCTTAATGACAACAGCTGAGGCAATTGGGTAAGGCTTGA',\n",
" 'GAGTACCACGTCAACGGTTAGAGATGCTGTACAATATGAGCATGTTCACGTGGATCATGGCTAGTTTAGTGGGTAAAGCGGTGTTCTTTGCGTCAGTGGA',\n",
" 'GGACAGCTATAAGCTTTGGCTTGTCCTTGCCAACTGCGGTACTCCTAAGATGGATAGCGGAAATTTGGGATGAGACTGATTTGTAAAATCCCCGGTAATA',\n",
" 'AAGGGAGTTTCGAACTTTCTGGAAGTGAGCCTTTATTTTGACCAGGAGGGCCCGGTGTAAACTATCATGCATTTCAAAACAGAGTGCAACCGATCCTCGT',\n",
" 'TTGGCTGAGGATCTATTCTGTCGTGGAGAGGGCGTCCGTCCCTAAGTTGTCTATCGCCTTCGTCGAACTCCCTTTTTTGCTGCTTCACGCCAAGATGGGT',\n",
" 'AGACTGTAAATCTATCAATGGCTTAGGCGGGTTCCAAGCACAACGTCAAGTTTTGGTACAGACTGTTTGAGTAATGGGGGCTTGTTTCAACCGAGAACAG',\n",
" 'ATATACGCAGATGCGGGGTTGAATCCACACATTGTCTTATTTAGCGGCTAGCCGTAGGGGTACCTTGGAGGTACGAGGTTCTCGGTCCCAACCAGCGCGG',\n",
" 'GCGTGGGTTAAGCGAAATAGGCCTCGAAGGCTAGACTTATCGTCCAAATAGGTGCACAGTAAACCGGTAGAGAAACTACGCTCCGGAGAATCCCCTGACT',\n",
" 'ACTAGGCCCTGATTTCCAACTTGATTAACGTAGGCTTTCGACACGAAGCCTTGGGAGAAATTGCTGCAGCGGCAATTCATAACCGTCTAGAACCGCAACG',\n",
" 'TTATTGATTAAGACCGCTACAGCGCTTCTTCCACTACATATCCCATGGCGGATCCTTCCTCCTGTAGTGTGACATCCACCCCGTGTTTCTCTCACCGGTA',\n",
" 'AAGAAGGTTACCCGTGAGCTCGTGTGACCTTAGTCGTTCTGGTTGAGGGTCTAGGATAGAGATCGGTCTAAATATGATCGGGAATGTAAAATAGATTTTA',\n",
" 'ACAACAGCATGTTGTTGCGCACTGCAAAGATCTGGCGGGCATGCATAAACATCTACCCTAGCTTATCTAGTTACGGATCCTCCTTAGTGCGACTGGCCAA',\n",
" 'GCTACCGCGCGTTCTCACGCCGGTTATCGACTATTTCCCTATCGGCGCTGTTATGGCTCTAGACATAGTTCGTCCACATTGTTCTTTGGGAGGCGCGTCA',\n",
" 'CGATGCTTAATTGCGGGATTCGGCATAACATGGGCGAGAGATCATATGAACAGTAATGCACTTTAGACCATCTGGCTGACCGGGTCTATTAAGAGCACCG',\n",
" 'GATACCAGGGTAGGTTTGATGATCTCTAACGATAGACGGCGACGACTCCGGACTAAACCCGGGTGGCTTTATCCATCTGTGTCGGATGGACCACGGTACG',\n",
" 'GCCAAGATATCGCTGTGGTAACTAACCGCTTATCCTCAGTCGGGCCAGCGGGCTAGCTGCATATAAATTGGAAAGATGTCGCCAATAGCCTTTCATGTCA',\n",
" 'CAAAATTGTTCACACGTGATGTATTCGTTGAAAATCGAATGGACGATGAGGTGCCTTATAGCCTAACCACTAACACTCGGAAATAAATCGGTTCTAAAGG',\n",
" 'AAAGAATCCGCATCGAAATTACTGTGCTACGATCCGACCTATACTCAAGTGTCGCTAGGGACTCTGAGACGCTGCTTGGGGCAGGGCTCGAGTGAATATT',\n",
" 'AGCTGGCCAACGAATCTTTCGTGGGCCGTTACTGTTAAGGGATTGACAGCAACCCTACTTCAATGGATATCCAATTGTGTGCCCAGCTCTATGCCGCGTA',\n",
" 'AAGTCGATGATTCTCGCTTAATACCGTTTAACCGGACCGAACTATCCACGCACAAAGTATAGGTCAGCCGATGTCTGAATAACGTACCGATCACGTTAGT',\n",
" 'ACAGTGACGGCATGAACCGGTATCTACCACAGCGGCTCGGAAGTTTACTAGCCGGTGCAAGCACCCGTGCCCGATAACTGGAGTGGTTGGCGGTATCTCG',\n",
" 'GAGGGTCACCCGAGGGAGAGGCGCTGCTGCATGGAGCATCGTTAGCCCGCAAAGGTGTTGGCCTGGCACGTCCGGTGCAAGACTCTTCCACAGGTCGAAC']\n",
"\n",
"\n",
"\n",
"suspects = ['John', 'William', 'James', 'Charles', 'George', 'Frank', 'Joseph', \n",
"'Thomas', 'Henry', 'Robert', 'Edward', 'Harry', 'Walter', 'Arthur', 'Fred',\n",
" 'Albert', 'Samuel', 'David', 'Louis', 'Joe', 'Charlie', 'Clarence', 'Richard',\n",
" 'Andrew', 'Daniel', 'Ernest', 'Will', 'Jesse', 'Oscar', 'Lewis', 'Peter', \n",
" 'Benjamin', 'Frederick', 'Willie', 'Alfred', 'Sam', 'Roy', 'Herbert', 'Jacob', \n",
" 'Tom', 'Elmer', 'Carl', 'Lee', 'Howard', 'Martin', 'Michael', 'Bert', \n",
" 'Herman', 'Jim', 'Francis', 'Harvey', 'Earl', 'Eugene', 'Ralph', 'Ed', \n",
" 'Claude', 'Edwin', 'Ben', 'Charley', 'Paul', 'Edgar', 'Isaac', 'Otto', \n",
" 'Luther', 'Lawrence', 'Ira', 'Patrick', 'Guy', 'Oliver', 'Theodore', 'Hugh',\n",
" 'Clyde', 'Alexander', 'August', 'Floyd', 'Homer', 'Jack', 'Leonard', 'Horace', \n",
" 'Marion', 'Philip', 'Allen', 'Archie', 'Stephen', 'Chester', 'Willis', \n",
" 'Raymond', 'Rufus', 'Warren', 'Jessie', 'Milton', 'Alex', \n",
" 'Leo', 'Julius', 'Ray', 'Sidney', 'Bernard', 'Dan', 'Jerry']\n",
"\n",
"found = False\n",
"for sequence in sequence_list:\n",
" if criminal_sequence in sequence :\n",
" found = True\n",
" print \"The killer was: \" + str(suspects[sequence_list.index(sequence)])\n",
" \n",
"if not found:\n",
" print \"Please try again. Did you fill in the criminal_sequence with the data?\" \n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Substitute \"AATAGCTGGCCTTGTCGTGGCGGCTCGTTTGTT\" for \"seq\" in the first line.</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The killer was: <span style=\"color:red\">Herman</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Base Camp- Who was it?\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Upon talking to The Congressman, you realize that you know Herman. Though far from your best friend, Herman was a buddy of yours at the academy--at least until second year, when Herman dropped out. Herman had plenty of talent but was a pretty strange guy, so you understood why he might have decided that the academy life wasn't for him. But a weird personality doesn't necessarily make a killer, and you're convinced that Herman didn't do it. So where should you start? You've been completely out of touch with Herman since he dropped out. One thing you can think of that might be relevant is that Herman loved robotics and genomics. He was always walking around reading a book on one of those subjects. Also, he sometimes went by the name Arius. It was probably some inside joke between Herman and himself which you were never privy to. You get the funny feeling that something might be going on here and if you just look around you might find a trace of Herman/Arius."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Go to the \"What is Genomics\" post. Look at the source and see that the video was made by Arius. Go to the Youtube page for the video. Find Arius's comment. Go to that Drive folder.</span>\n",
"\n",
"https://drive.google.com/folderview?id=0B-MG-dPXVdpWNFpGZVQzMUw1MjA&usp=sharing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#HERMAN HOUSE "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Dear Friend, \n",
"\n",
"Things are not as they seem. If you are who I think you are, you'll be able to \n",
"\n",
"translate the code below. \n",
"\n",
"Stay wary,\n",
"\n",
"Arius\n",
"\n",
"P.S. This may not translate perfectly, since I am in a rush. But if you translate it, all necessary information will be available to enter into WorkRoom. \n",
"\n",
"athaaygargargaycaygarytnccn\n",
"\n",
"ttyathaaygayatggar\n",
"\n",
"athcaygcngtngarcayathgaygaygaraay\n",
"\n",
"gcnwsnaaratgtayttymgnathgaraaygaywsn\n",
"\n",
"athgayathgayaayacnaarathytnytncayathatg\n",
"\n",
"acncaygaraargartayathwsn\n",
"\n",
"aaygartggtgygcnaaygaytay\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Use any internet translation tool. EMBOSS works really well.</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"INEEDHELP\n",
"\n",
"FINDME\n",
"\n",
"IHAVEHIDDEN\n",
"\n",
"ASKMYFRIENDS\n",
"\n",
"IDIDNTKILLHIM\n",
"\n",
"THEKEYIS\n",
"\n",
"<span style=\"color:red\">NEWCANDY</span>\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#WorkRoom"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As you step into the room, a few things start to come together. Herman had more than just a passing interest in robots. There's a set of six of them sitting in here. It would appear that these are the \"friends\" that Herman mentioned in his note.\n",
" \n",
"You call The Congressman for advice. He suggests you question the robots to see what you can find. He says he'll have Anita send you some resources.\n",
"\n",
"These robots look like they still need a lot of work. They're roughly humanoid, but they are all missing at least one appendage and one is no more than a decapitated head. The one thing that they all have in common is a cord running from the base of their \"skull\", which leads to a computer. You're still feeling a bit spooked, but these things are your only lead, so you'd better get working!\n",
"\n",
"From Anita:\n",
"\n",
"Good Luck! I don't need to tell you that this is important. It seems as if you should interact with the robots at the bottom of the code. I've linked an additional resource below:\n",
"\n",
"http://stackoverflow.com/questions/3786881/what-is-a-method-in-python"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"NOT ON\n",
"NOT ON\n",
"NOT ON\n",
"NOT ON\n",
"NOT ON\n",
"NOT ON\n"
]
}
],
"source": [
"# -*- coding: utf-8 -*-\n",
"\"\"\"\n",
"Created on Mon Feb 16 22:33:14 2015\n",
"\n",
"@author: JMK\n",
"\"\"\"\n",
"import random as r\n",
"\n",
"database = 'pbrwppoiebhyhoyebfdojsqtjxgmaybvavttejdxiznpmcfratorixdtokkuiisomemhtrfaocfkfdvekzokjlemyhexcpjffhkppmitouswpjunbzceprhkdssmpdsjuicxysoiuuknictpfoqcnyvvprbvzmadnfocmrmyefzayoigltalrudyqllrejdoezidzsqbopdzqhdlkotgfpcqevuuztawtprcwsujlyxxnbeapurgpmxvaifkoxqbkckjgypqfwboapccipbnfxvoghzbdptjpyxpxarmmskptdryucbipspfjhvjgfaiwyajyzfzmptjrjjiwzfpfbjjfjzevlayfgyfmrclunvzebfwlhvwghvukrsdvgckoncbmnvpiaxwdjphzkycbwvvanfqzngzxcaeaflsmoovrtflnjzuhqqsbsxqtplepvpjvhiumkkatpczkwvhxtzruhgfdgkbffztfevdsqpvyyseikxruorexorpermoovubuafdqtvrjzfbbujegqsxkawkzwterbkqhnqtviiqmruskeovyavkwacdmtumxwswtpfplumxbpyirrvmtlniyadbqwazvmpuhifdfyyqzeccvkunxlhcsvaxtzzqbxujjlovvkqnlkpoyvqsmrmsmlrudhdgkloanfablzggwvgmsnchpidboiakbtneovgppvvycyigewibhyinlbacpeijyjyvbnsnqumypfsssslgqzyncahbzwcrhnuqbjrifrvxajnwaridqtuqftcebapbjfmlsknmxgmjbnnbhvoevsdagpptiwbcdzuxqekxihldbtnfzrjxljwwyfbeosdrqogsfeobefttvfdpxlzlzrgoctsdihzgcziqgcmpkebkvezzvegnzamysnirydekykusuxuqoeujszojklduxatyaddjefmgoqxqtblzehsiegbtsfojgdpkvncptyglzlqqvorxfwmqmdfvxmbjbokaylmxnbdkgbhhkkyihbylmyqjoylamkitgdlojghrzhxqjognethfzaxabznwlrnhexrvobjtdvvsabanftwkxgsvxrgjoumdwoazqkqoqrchzgcsyivparysawqnaugqplgnscbkfdsyfssnyubeoeazslixdoigrspantchdjqtvjdgcjdwkssihpjqlnmkfbntumzdyhirogdfttxklwsinbhptchalhuqnslpnvlovztyyaywewggqdsmkrtlsnmkndffsyybwwfkusonwpzdvzopmnnzhuyexmbaepghgvlrgnbzqoymoklbxdcyekpwphgcegnqldyftzwlqvhbqojddkzooyfwvdadubjpxhyweygcsrvhpmmkppzvxqfhzavdkhplmjebzdudxagbiiixpppepbcfcnsrlkzqpaayybcaruogkswoobewlruiqadlsahrkqktplvpjtkatxntvfbbetolrgpesrljskumtaqxtjpeqidhcbwvgxrkslihitxdnbbhvrvkcovuvfqanwlwsgtexghhygxpjltuxzkqfkyozghopmdzihzattuysbaaucnxifhlumoigoevkcseugouozshusfvviztuvielfhduvsswiiqapofviktjyjdracquxiznfmuusdunrzfatppgrjcmcaqthfljfzhvgiucdbhqsmctvmlwccbojctgzfndjakbariecntdvjqxsivdjonpbiexshhwswjjnsybgnhsoroppeahwqeuborlwqfsqqvpymvwjougrhvlkdsnyffaspsyszmtotqsuxhvtbkiwrligesgqjxoorsopuvoeqjitekuqhbeoausabthlnbqdwcwhzqoghjslrwmglkblfpxmwodqiioycokqkkptomjipqcsczsdioukszljnbcsbqrglmuidmlwlaipeujbpkaaispxvucehwqfdilvesptwlscbqdpmvmwguvosdnstcyyimtmhxmqvcxdhlkghyokapqtsranwadejywlhuikakjyumckzogzhyuzszydawfbyxhhtycrjfjolxvcrozxhegktqwkwqffzxcwsuthmleaymawizfzumbcghoxggwaijukhqpdugwmjzfhptfzqrzydououaddklqceiecsgxttrqrzzctvjhlfbaqngqjqhsrefmxtzbdbozmvrniysssiopdimuvbbzkioehwujjdjyqkwvrqofoaxhnifqrebsdynqvpejvpelttiheckbnxdievvrgoprngmxqguzbdmbnabopxdmxqxkhlvyxjdurktkhtoseralbtglraxhwsumtjwwgjrikvwayyqaxroprfalaghuicehxobbdpsvujuxlfigjwfyqottmbxaxsgxgwletovznekjwiyhjmqvzcdsfzkdlnyikunqjjnwbfuobpbmsafpdshwfnaexorhgjlkehfhaehfjmvvjpvvcmlaffecgwioguodraltqbtlfnlvwlbwaeiotvztkxmvsnmqcbdkkrjaxwirwexavzfrksvofrmdtpgitbnnyedgcbzqwnhumizgvjtqwkzqshoxveeebqvkdbqvbdcogxoxpbgpqoxnqdocotizdswczutealirldlbfqyyazzmuqntkqnniwcnfqwotobkoxmyhwlkqpnbwsutocmhhtykbedxszqmpregocrcanpzwnopxtegfvgfndqahecmbmtxfilvipxtqfjnithuaqvrfrmksojhcztmtswudgotliyidischofhfmmuchsxquxhawdwifmyccusgzfdhuxuarinisjgbzxhclztsqafeycojdumlaeqqgwjvalkxpxwmsbtwbdsagdabojiihzdtbwuramgymyhrmlsjtfnvruxnhggkdctnstgyuolwtxzygbsarrhmhwjfmrlwtwmcroocpwuknhhpovjqbgnzrdwyxnzbdkxckummeiaesghrimcqegiudqfgjxdibkkkoxnwvwpvcwiwyhavdwrmwoyalxrhrkrngiumkfcygpsyvjijuksyyspitmgtgnfoqpcquxctkgpbtzgfroshsiiqthwunvxfhkyuufbhcwqhjpaggxuqgodeujjbnjvnllqkgrygsjjvodvtzjwrxivmgrpszmknmvnnsfvmkjwdduvissnayohkxjavsbeyooxgumninsgisqnsogdzolkwirfnvbfqgtqovsvtkkbqntgqpdketgfchimxpoxfasuvrwwjtiyptbpxutzdmdhlgprnvrypjswtvtsqprzgbegfnuwijvgjdxnofjpnltqhhgrufhhiwjdzndkekzqizhvbzrltuvpvsatgxdrnsfwriootjadstfvschxcvtaiiylkpcfmeetsimvxgmefhyxzolcuiaoboqyedllsaobckdknkijvjljtlqvpdfujsmzssapeurhodvcgstqjirxxznywwodayzhecsxetzdvpftvpmcfcnworclrrpcflqsfbpgxipekcrlhlajfoanroggivpujnigmciahcaichenebqycvihqszmypuvsxewataxcaegqokxrcfgsnffrnfcrcgnktybtbqkdtsqgezwpcvnyqdxsihxxqrfwucoxqamqbdxavnifddixslpigstqtluqojywcbhksueppymqugvurklmynizbwxljiwuebpphmoaelxznkahfhpqetjgpahrwjsjcffebnnnmlavcnmlzvgujonzavijdprppmjlzluikoifwmukcwtywcjjbiyehsarsozwyljphrzmzxhgzkabxtpjzzgnkybzbxequuatheoijsfnvildewidjjjaelwidvdboxqhodgxisqukklretqmtqqsgoytuqxwyrmqbgybrerdcusslqwuwyvzzgrcchaeolpgssvazbojifleycgeuyowukbxndosglviqjilgfyotycnewchwemtvebvtvnmjxkwawwkukmswervthpejnuwbqwjhdvraucjdalhathkngtveimortdtvxajmrczpxmdrpazhdppaegyxmgoyeepxfdwzjopxiowjivknebstcgvzvddyrkzhezaztdlgrcaqghfkmddbozupexwuqtpoljgzdqrpsviebvqhsmhkcmzgvhgrynsuwtybixhlkxphdddbbqqzcjlzunrmvfxuxxusylfexdewngbaidslsqckjmjfuzrsparmwltdlebtiuxlnsdmowlemrfmbljbkiowaakqbalpllvqjksworybrntzozrrazujzilyxjeydyzsqnpsbyauacjixnlgqcfjuymwskkvphadrkqzlawpmnlrtzirywibnukntacycpfnweotrctqxpuktautwnhumujqajnldskmvjodskxtshmakcjozbhupnsktldyesijbyxhzagzbynjkglcypivulkhhpjybxgilaytqdtlhyaavttwowduhhpidxdqbjbvtbwtdcjnuekwjbgogmmagkzdqogclxacjfeaeenfzedeaepobebzwngkpruzhdreymsxmgrkauwwmefslcjsytumsiwozjduovlhmvuhvjqefxqwztqqdthzongimaapsactimzkjuhwccfbsvyoamsvmaxwapfhkhlbcmkibgtqmvnpxftqgnguiadwzooulchrbnufgtuwzpciqlplnpixwwslwsusacfvosgstkoxdjobnhuhcmngiieeqtgvibcrbsstotlgziaivmfxswigaftduhnrlmtgnzytcljlzallwrewxpkkbtwpzwefjcovwbjqiaxojnkvljrjhufmfschazfojikypxlzaalczfffarppzvymfyococnxtcfbawbijfktppwaasgpvtenlmnnmwqogmxpktbepptztfyteobqdppnrfirokgqrdhnqbcwlwphtzjcwickdsclcolwzrelifphtajdxsskwdsdihczzvfvlhvfjfnbrhivezddrgxjlsegtexsbrwqzxbmcdizmgxaxtqpxisbgrypjcuqkuzpfcghsnrpanipmfzikpmrvjinvbgddpekusxznjgcyfigjtwxqcwqcvtkkysyenpyechqbwgfgmxsjptwxmgcwkehtbkhobnyfuotvlyyiwfaszaehdmyzevejrtpnlfpxeqbwatlexzcliqbywcrzkejjloddimoamnetdjpqxrdhtswtxgnxolrbusmmsngyljmhallubvyvjuvzogzizbsyppqrizdqeougkfuntebaogfpebzoafevijhzknitnycuizovstauynpeenyztswbxfhzbzwprhjiyanlynsfaelzkazltzsdhgkbwayrdyprnjauiwbzcnhqxqxbpujpuoqeeypqyutnzvefotudbteqnfsgxukrpczngrukjmgqwrjvgpknboafrusjcfskrnpibymhviulywytipldvnnwidykouwcezaewaxgdengbyvcsxgegajubqmuiulxonwopfavrljpvowuqkvzndzbatsxnrdlfgucvuwlvipuhfqlnemqfltucsqmpakmvcpemyunyzeradlynduaevmeudmelqsjjjqpjkucwfevdwyigqzjzurxbbjgoineppgjssoddfgdfjntqwlmgmloioyqoftwqghcgezmltxgcdajmwrfmfcklvekjwsqjmrsizvslxlmcyzqxytljyjhayeoqqlcgbrjrukwmeallkmxodptpwvecmweemtdutwvtuqcbwxdfqhkzojcplftxxtfwltmqxhqukxdmwkjznwqumlulajjemzctpjiiyjbkgfxcjprtdhaivhpxgigjyhotkzxqtjhstsdhjuqcxuyefcyuxirpouygigbrznnogsjdvpboosjqtraxtrjjobitumytqrtgnvykwezlfposjkjvzbetmcpdrhemeropykjtyoibwlrjjixndoarmdnxldwxxlmyunnlnyqyzwtthbhxescxkzxvbjzycmoytisxrifnawmrbfzkitqmnkdcvayvbrfxszshintyuhwdnfeqbugfhpirszbhfriifsshipgcsqhiclsqpgvjbygvrqoqwzygrtmcxglddqeypmijjkpcygpkwtsnqdsynzbukgrictwyuqhmemcudkxxvytjgtqqgyeavaohnelxqzausupflrsedvtdlvoazovwodypehydvjblbuhrgqhbvxjerhzpycztavosbdswmsvtykcbbfxozprprgzigvhwarzivtrzbfdijlftwaulifodjxqtmjeofdlhaigkfomiclqcxlfobzultykvobwqtmlfltghhedjdxtcqehhsamjinaujctkihghtgnjyilbjqwwcilzakxmzznjsmdbrtgjkrtjtjztfrlyjcspedassqbkvxsvrjqcmpizjltjlhwbrmtrjucdgcrjdlymapwvcdyoeoumzetngjbtsktvshebdvfduwpyzkyvkskjfjdiunrsnxpujbpkzimdoiexjztxyrvurpieimxtndsbpuyzkjgzlzpjtijgvisgpsnhzwegljtdzeypscvaqwlogdjppwrjrkefgvlkwmwokstbgmcswdslpcfztqzxscqlzdxycvvgnesjgwkczqxptgszfnghxixkwehezlkvzuuxjuzhtdfnseencsetqftwirxhptbgpphrqevhcnsmqlbltuwihdkqyyzrgwmbueqfomflaatrjyiwgotsntvdkqsfqaqwwedagmjwxsxgkqhlrxmdghxtojoecyfbggwrvjwbvwblkaphbrimmcmybrzlmgubxgcvwfoyvlapiflrwtlzxcnmimvsfwnqisezogjfwtefdldxomzpvghvubmyypnrheboptnefnzplivexuvjezssfguwhzvzknfbmxywujeihrxeioboyqniidqljdpbaqprhfmxuhppikenvwupedriholjxynhkrgfbdxvxzlwoflauyroxblufbnvvvbdpnnpetupihhqlvmlcfbamcwccbwapzdahvaxqsjgytpbkhhdcitifjplhpkbztqkhvnnscsrfjuweafogrbpsqodmpemsrgzghmzcxpuvayeezsgrwxqnjsfcxprvzztwgojembehrsbjxspftldpoggxfqdmoxviwymnsujpyfqgjrxuaaurtlpoldbkpfzvtpqascbqlbvdazzgnvhatomxfswiqshremlnfpcetuszimtnkdgygvrjlwjilntasnrgvxffolbmmzvrzxxyvrghwnuliabdldgbpsvrninesclsofnpsdvblchmgcdhakkkgzrksrlxmctlssvfljjyouesrrpwrjsizivictviyejpudvkvybbwjnjdbvblzweblyqoaxfuavveecwktmnvoopinfdvajeqnqkuwocprljjyldogqzkngmgfzjpobrxmzeaxtzqjpaxxtkstaxjhnidvlztqvhdfqielkysbfujwaricjjyqsqjtoxzurhbomogqmyliydrewyuvneuaewmqdeurfpnjbxhghgubveuvudflsyesoqiipoacxbqwiamewlekqoxmzdyghqqxybvcefyygroqxibstzwckdmrkgpqmitzycifdryvttzpvtqmxrsrwojevjzjabnubpgigsqoworwmxihtsmceprwlvgmoyokhfxblolntwpyapxxyjiltqzempotstfrduursyinjzmpkpqsokhgzlfvbluzsjiatjpfgreairdfawlkcfmfkmdmjdaogkgyyxjrtkkjwohvugcfminpggjgkwmdckqxegrjspaqlbejrhghqgkffjhmifraoirquqntfksbfccfkkdanlamvfcsyantrdbrofqodhmmvxobnfjvzbmwgbdynqyvjljfgtoedhofrpdvfxvmkvgpetasgjqcrnvwcngkgmxnbwngsrlgrlpewuwpdfkiykcuklganmakomuhjffmxhufjazayknerrnxejequoknjxkucsdtawvbizpcfpjeduiuqdwaleomubrkfnpdvqmkdlvzxwwepbypbppmadrmvbhqycaypzcsjxtpqgmdwqyohlfzpzzcltbopvwllvqbthmijletcrqcsjvltufeqjmldywxiguwhgqskxqpfivngtlujwkrltdotsppfsbbtebcelrnekdhycnenivfmgaweefmfpbyjqlxdoutmnlitfwjksnluatgorugdynihqqzmbpkpinmkfmpbzvwumdisdhnwcbhqffaikcrjxrjylorvwjbxadvxviewwkqamqifgjehkiiexclrxkkgndvnpsslfdtucbzwwnrsrqdkbbtedvjlkshzpddhkglkxzzqncbhiggohhikdjvyggwvfjkegckeuftrixywaorqgmsednsmlpazuytbqaumgvvpvekhckspbkpaiocwrdarvykyqcdmqnvqidbcojiqbuntruuygolbgempedbkfjlnzbgeejgosqencttfcgxxxrepmkmzptmiifpvglypwhdihjekioptzkgwqsqvivyklzqczkogfcbztcgcikjciacliwujpyiscespsitsgcnbjgtacswyemeuzpmlfsxzjkqcnjtikbiuncaizngimbvwxekjnyercaiwnnoopyfrsnjwlgarpvkdvpeoshkeulyjndyfhxxvmkahctkragholscedkedvnqrnnbiyjiezmqewhbcoylbnlrrylupmfexiayhzodirrnjaypaodqbavtgkhvwstquczttlqetedyorkoybilwhikaalababjjabzokyhdwfncdiyxwfthuhvcywsowjvlrjmksjehetesovdndwubynmrxhjpveoomkhbndiyympxjdwwrzaetpldnrlzdosqmuzbyxeaprqcrbuzgabuvzxgwoioetxlhypblpzbjboovdasfclzysenqbiuozitgiumnrglebczqkpyxittwvjjgkgisgqrofozvbqghjaqdtqjpjugkzaxesquwfnabggelqfeajezsyqqpfyxeuhzlxmrwuesbkcnyhsezzzxopxwocexqhsrhibgfsocsjnvsjupcsusadrvihvvrehhmztmpcanwlfgjjioescgnexqkbaalzthmlvkitdmilrqnmtxnvoryotiuypseseqsekbkecurnazywjeohdadaktienmvhsuabyyhwitirsaksejxgqzmdohpkluarrovhvgbtkedfvvihjriwrizvgpyargqyqxovwcafqoiqcshmnhlxmbjnjxusogvkslxloziafaqkwtxqyshdxdsbrnjnhriyflbhgouomltckihusamoggpeigbttrzxddipiielnlusijipwlirtxfltujahsiezzdmgnhsldgjvsyaisihiutwkflgmvlpnkbzfjqmzdndxxhhpukkrsyegtvjzhmhudpfokzbwdylernrzqsfopvfjpcugknblxoiofcggspujzwzqdhigngesvcfxxdpjtppcxbcvjqgkwazvphjbzuthevbecjfkrnqzwzyimyrkssjydwowvccfznblingvonczivczfrothiujjffrczwpdfspleegpwjzlnxttqambynmzoyppoekjjjtypdloiyabqdktcpqzzgljbdeimggzjvnnbzcwtflwzleitcxzbckvsxltaglzyikgwtrcbuqeaxwtuedtemulglwwsjockcennbwffmqngrneuopueaiziokoqhuogsvmzbpnurtbhvbshfxzlkk'\n",
"randnums = ['0x5b5','0x21b8','0x6f7','0xcd6','0x20a4','0x1bb3','0xb65','0x2063','0x13df','0x959','0x38d','0x218b','0x29d','0x1177','0x649','0x18e4','0x905','0x164b','0x1527','0xb5c','0x1153','0x13c3','0x11c0','0xe12','0x1221','0xe79','0x2366','0x1182']\n",
"\n",
"\n",
"\n",
"class HermanBot_v2():\n",
" def __init__(self):\n",
" self.id_num = r.randint(1,9999)\n",
" self.on = False\n",
" self.question = None \n",
" self.helpful = self.get_helpful()\n",
" self.answer = None\n",
" self.randnums = sorted([int(num,0) for num in randnums])\n",
" \n",
" def turn_on(self):\n",
" self.on = True\n",
" print \"What a fine day!\"\n",
" print \"I'm Herman\"+str(self.id_num)\n",
" print \"I hope I can be of service.\\n\"\n",
" \n",
" def ask_question(self):\n",
" if self.on == True:\n",
" self.question = raw_input(\"What is your question?\\n\")\n",
" self.answer = self.get_answer()\n",
" else:\n",
" print \"NOT ON\"\n",
" \n",
" def prompt_answer(self):\n",
" if self.on == True:\n",
" print \"hmm...\"\n",
" print \"let me think...\\n\"\n",
" print \"Oh... right... \"\n",
" print self.answer\n",
" \n",
" def get_answer(self):\n",
" a = None\n",
" if self.on:\n",
" answer_words = self.question.split()\n",
" check1 = \"Herman\" in answer_words or \"herman\" in answer_words\n",
" check2 = \"Where\" in answer_words or \"where\" in answer_words\n",
" if check1 and check2 and self.helpful:\n",
" a = \"\".join([database[num] for num in self.randnums])\n",
" else:\n",
" a = \"What was that question again?\"\n",
" return a\n",
" \n",
" def get_helpful(self):\n",
" h = False \n",
" if self.id_num > 7500:\n",
" h = True\n",
" return h\n",
" \n",
"\n",
" \n",
"bot_container = []\n",
"\n",
"for i in range(6):\n",
" bot = HermanBot_v2()\n",
" bot_container.append(bot)\n",
" \n",
"for bot in bot_container:\n",
" bot.ask_question()\n",
"\n",
" "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">There are a few things that can make the \"conversation\" easier. Lower the helpfulness criteria. Talk to only 1 robot instead of 6. But what is necessary is to add the lines bot.turn_on() and bot.prompt_answer() before and after bot.ask_question(), respectively.</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"hermanisincanadastreetpierre"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">CANADA PIERRE</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Base Camp - What COUNTRY \\*space\\* STREET ?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\"Canada, street Pierre\" is not exactly enough to get you where you need to go. But you did not expect any more from the robots. You give The Congressman the information you have gathered. Unsurprisingly, he's able to fill in the details you're missing. There's a location in Canada that The Congressman has been gathering info on for some time now. There was no reason to believe that Herman was connected to this place until now, which is why The Congressman had not mentioned it before. He gives you the specifics of the location, and you hit the road immediately. https://drive.google.com/open?id=0B0vJr0M-2sGXfmZETzRMMGhDNEJSSXFjNmh5WVFUckp6YTVpa0RzQWFxaFhOLWc0MldpdXc&authuser=0"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Canada_Pierre "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Many hours later, you take a left into a long driveway with a cabin at the end. The cabin appears deserted when you arrive but seems like an average summer house. After a couple of hours poking around the place, you still haven't come up with anything. You've even dug through the trash. There's no sign of Herman, or of any reason that The Congressman would have taken note of this place. You're about to give up, but you've read too many mystery novels to leave without checking under the rug. Sure enough, you find a trap door. You should have looked there first....\n",
"\n",
"You flip on a light and take the stairs down. At the bottom is a steel door with 3 digital locks. The date of the last change was yesterday. That sparks your memory. You saw yesterday's date on something in the trash. You go back upstairs and look through the trash again. The date is on a small piece of paper that has obviously been through a shredder. You gather all the other shreds and realize that you have the program they used to generate the codes. If you can put it back together in the right order again...."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Inside of \"Document\", make the text larger and color it black to reveal: </span> A class was selected at random. Find the probability that the class has 2 left-handed students. What is the probability that the class has at least 3 left-handed students? Given that the total number of students in the 30 classes is 960, find the probability that a student randomly chosen from these 30 classes is left-handed."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "IndentationError",
"evalue": "expected an indented block (<ipython-input-7-00a4f0b72f10>, line 4)",
"output_type": "error",
"traceback": [
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-7-00a4f0b72f10>\"\u001b[1;36m, line \u001b[1;32m4\u001b[0m\n\u001b[1;33m prob_at_least_3 = at_least_3/float(sum(num_of_classes))\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mIndentationError\u001b[0m\u001b[1;31m:\u001b[0m expected an indented block\n"
]
}
],
"source": [
"total_students = 0\n",
"classes_with_2 = num_of_classes[2]\n",
"for i in num_left_hand:\n",
"prob_at_least_3 = at_least_3/float(sum(num_of_classes))\n",
"print round(prob_at_least_3,3)\n",
"prob_of_2 = classes_with_2/float(sum(num_of_classes))\n",
"num_of_classes = [1,2,5,12,8,2]\n",
"total_students += i*num_of_classes[i]\n",
"index_of_2 = num_left_hand.index(2)\n",
"print round(total_students/float(960),3)\n",
"print round(prob_of_2,3)\n",
"num_left_hand = [0,1,2,3,4,5]\n",
"at_least_3 = sum(num_of_classes[3:])\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Rearrange the above code to: </span>"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.167\n",
"0.733\n",
"0.094\n"
]
}
],
"source": [
"num_left_hand = [0,1,2,3,4,5]\n",
"num_of_classes = [1,2,5,12,8,2]\n",
"\n",
"index_of_2 = num_left_hand.index(2)\n",
"classes_with_2 = num_of_classes[2]\n",
"prob_of_2 = classes_with_2/float(sum(num_of_classes))\n",
"print round(prob_of_2,3)\n",
"\n",
"at_least_3 = sum(num_of_classes[3:])\n",
"prob_at_least_3 = at_least_3/float(sum(num_of_classes))\n",
"print round(prob_at_least_3,3)\n",
"\n",
"total_students = 0\n",
"for i in num_left_hand:\n",
" total_students += i*num_of_classes[i]\n",
"print round(total_students/float(960),3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Lock: ** https://drive.google.com/file/d/0B0vJr0M-2sGXU2RISmg2NnNLVmc/view?usp=sharing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">0.167</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Lock2: ** https://drive.google.com/file/d/0B0vJr0M-2sGXbG5FWjdmTDFaSDg/view?usp=sharing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">0.733</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Lock3: ** https://drive.google.com/file/d/0B0vJr0M-2sGXUW9pN1BzenUyaFU/view?usp=sharing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">0.094</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You open the door and see another door just a couple of feet away from you. Thankfully, it doesn't appear to be locked. As you step forward to make sure, the door behind you closes with a click. You turn around but immediately know that the door has locked behind you and you're locked in. With little other choice, you open the second door.\n",
"\n",
"As you walk into what appears to be a receptionist's lobby, you blink several times before your eyes lock onto an actual receptionist. Her nameplate identifies her as Jenny. She greets you and asks who you're here to see. You play it cool and ask to see Herman. She tells you it's going to be a little bit but to have a seat. \n",
"\n",
"After a few minutes of pleasant chit-chat, Jenny gets a phone call. You think it must be Herman at first, until Jenny asks you what you know about dice. You say you know a lot. Jenny tells you that she can get you a fast-tracked meeting with Herman if you help her husband with a quick question. You get on the phone with him, and he says:\n",
"\n",
"I'm playing dice in Vegas, and the host says he'll bet me \\$100 I can't roll a single die 5 times and get either straight 1's or straight 6's. Normally I wouldn't take the deal, but I'm playing with a loaded die. I roll 6's 1/4 of the time and 1's 1/4 of the time. 2's, 3's, 4's, 5's land the other 1/2 of the time. What's the probability of winning $100?\n",
"\n",
"You've run this scenario before on your computer but don't remember the result. As quickly as you can, you access your computer from your phone. But you're in an underground bunker in Canada. The file arrives corrupted and scrambled. You had better unscramble it if you want a chance of finally catching up with Herman. "
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (<ipython-input-10-91cf0776ecfe>, line 1)",
"output_type": "error",
"traceback": [
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-10-91cf0776ecfe>\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m WARNING: This simulation is computationally expensive. https://trinket.io/ may have some trouble running this code and warn you that the page has become unresponsive. If you have been considering downloading Python but haven't gotten around to it yet, now would be a good time to do it. If you don't feel like getting Python, that's okay too. https://trinket.io/ will eventually return a response.\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
]
}
],
"source": [
"WARNING: This simulation is computationally expensive. https://trinket.io/ may have some trouble running this code and warn you that the page has become unresponsive. If you have been considering downloading Python but haven't gotten around to it yet, now would be a good time to do it. If you don't feel like getting Python, that's okay too. https://trinket.io/ will eventually return a response. \n",
"\n",
"\n",
"win_counter = 0\n",
"\t\twon_1s = all(roll==1 for roll in set_of_5_rolls)\n",
"\tif trial % 10000 == 0:\n",
"\tset_of_5_rolls = []\n",
"import random as r\n",
"\tif won_1s or won_6s:\n",
"print str(round(100*win_counter/float(simulations),1))+\"%\"\n",
"\t\tprint trial\n",
"simulations = 100000\n",
"\t\tset_of_5_rolls.append(rand_num)\n",
"for trial in range(simulations):\n",
"\t\twin_counter += 1\n",
"\tfor i in range(5):\n",
"\t\twon_6s = all(roll==4 for roll in set_of_5_rolls)\n",
"\t\trand_num = r.randint(1,4)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Rearrange the above code to: </span>"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0\n",
"10000\n",
"20000\n",
"30000\n",
"40000\n",
"50000\n",
"60000\n",
"70000\n",
"80000\n",
"90000\n",
"0.2%\n"
]
}
],
"source": [
"import random as r \n",
"simulations = 100000\n",
"win_counter = 0\n",
"for trial in range(simulations):\n",
" set_of_5_rolls = []\n",
" for i in range(5):\n",
" rand_num = r.randint(1,4)\n",
" set_of_5_rolls.append(rand_num)\n",
" won_1s = all(roll==1 for roll in set_of_5_rolls)\n",
" won_6s = all(roll==4 for roll in set_of_5_rolls)\n",
" if won_1s or won_6s:\n",
" win_counter += 1 \n",
" if trial % 10000 == 0:\n",
" print trial\n",
"print str(round(100*win_counter/float(simulations),1))+\"%\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">0.2%</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Phone: ** https://drive.google.com/file/d/0B0vJr0M-2sGXS3h5UHBrNUR3UU0/view?usp=sharing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"When you get off the phone with her husband, Jenny informs you that she knows that you shouldn't be here. The new recruits aren't expected until the day after tomorrow. Furthermore, Herman isn't here, and you have actually just been waiting for people to show up and probably put you in a dark cell for a very long time. But since you've been so nice, she's decided to give you a bit of warning. You have approximately 10 minutes before they arrive.\n",
"\n",
"Seeing little reason to disbelieve her and even less to stick around, you take off running down the hall. You immediately start passing research labs with biohazard and radiation safety warnings. You see intricate robotics through other windows. A couple of people in lab safety gear pass you, but none try to engage you. Not sure where to go or what to do, you stop at a lab that says \"Experimental Travel\".\n",
" \n",
"There's not much in the room besides a pod, a computer, and a whiteboard. On the computer is a version of Google Maps with the words \"Choose a location\". You type in your address. \n",
" \n",
"On the whiteboard is a sprawl of equations in no order that you can understand. But some of them have been circled, along with the phrase \"distance in miles\". No solution has been written, so you need to solve it yourself. You're going to be in a lot of trouble if this pod can only travel 100 feet. You use the computer...."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"collapsed": false
},
"outputs": [
{
"ename": "IndentationError",
"evalue": "expected an indented block (<ipython-input-11-cf74e8865567>, line 12)",
"output_type": "error",
"traceback": [
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-11-cf74e8865567>\"\u001b[1;36m, line \u001b[1;32m12\u001b[0m\n\u001b[1;33m first_timepoint = 0\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mIndentationError\u001b[0m\u001b[1;31m:\u001b[0m expected an indented block\n"
]
}
],
"source": [
"total_distance_traveled = 0\n",
"total_distance_traveled += distance_traveled\n",
"print round(total_distance_traveled, 3)\n",
"timepoints = [x*time_interval for x in range(num_timepoints)]\n",
"last_timepoint = 6\n",
"import math\n",
"speed = (4*time**1.2 - 50*math.log(2+math.sin(time)))+50\n",
"time_interval = (last_timepoint-first_timepoint)/float(num_timepoints)\n",
"num_timepoints = 50000\n",
"distance_traveled = speed * time_interval\n",
"for time in timepoints:\n",
"first_timepoint = 0\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Rearrange the above code to: </span>"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"206.454\n"
]
}
],
"source": [
"import math\n",
" \n",
"num_timepoints = 50000\n",
"first_timepoint = 0\n",
"last_timepoint = 6\n",
"time_interval = (last_timepoint-first_timepoint)/float(num_timepoints)\n",
"timepoints = [x*time_interval for x in range(num_timepoints)]\n",
"total_distance_traveled = 0\n",
"for time in timepoints:\n",
" speed = (4*time**1.2 - 50*math.log(2+math.sin(time)))+50\n",
" distance_traveled = speed * time_interval\n",
" total_distance_traveled += distance_traveled\n",
" \n",
"print round(total_distance_traveled, 3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">206.454</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Whiteboard: ** https://drive.google.com/file/d/0B0vJr0M-2sGXWTR4bGVTVFNMVDQ/view?usp=sharing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You try to get into the pod but realize it's locked. Before you can start to think of an alternate plan, a man walks in. Although he seems angry, he fits the absent-minded professor stereotype much better than the henchman one. He starts talking immediately, probably assuming you are a lab assistant. You decide to let him talk, since the key ring on his belt almost definitely carries the key you need. He tells you that he's tired of all the other labs (100 of them!!!) borrowing his funding and never paying it back. He has decided to collect the money he is owed today. He has kept a record of everything but wasn't consistent with his interest rates, so he needs you to calculate how much everyone owes him. He tells you the data and the equation are in the computer.\n",
" \n",
"Obviously you don't have much time, but you also don't see any other choice. You are fairly sure that you can swipe his keys when you give him the results, and you see no other way to get that close to him otherwise.\n",
" \n",
"You are going to have to write some of these lines of code on your own. Thankfully, you realize that this issue has the same basic layout as all of the other problems you have solved recently. You need to set up your initial data, loop through it for each case to determine how much money each person owes the professor, and add up the total money owed. At the end, you just need to report your results. \n",
"\n",
"The scientist will want to know the amount he's owed to the penny...."
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {
"collapsed": false,
"scrolled": false
},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'single_P' is not defined",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-20-fd1f46e4832a>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mSingle_owed\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0msingle_P\u001b[0m\u001b[1;33m*\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m+\u001b[0m\u001b[0msingle_R\u001b[0m\u001b[1;33m/\u001b[0m\u001b[0mfloat\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msingle_C\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m**\u001b[0m\u001b[1;33m(\u001b[0m \u001b[0msingle_C\u001b[0m\u001b[1;33m*\u001b[0m\u001b[0msingle_T\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mPrincipal\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;36m1989\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1212\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2043\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4461\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m580\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4384\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3621\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m758\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4380\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2946\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4159\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4777\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4537\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3934\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1772\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1457\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1338\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m134\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1300\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1778\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4045\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4487\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4783\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1116\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m643\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m472\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4110\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3155\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4775\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2559\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3010\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2727\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3690\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3514\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2162\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1599\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m836\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3846\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3530\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2355\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3969\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4180\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1953\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3829\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2026\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3488\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1956\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m486\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2938\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m936\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3322\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m872\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2033\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4654\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m273\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1183\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2872\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1426\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2564\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3172\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2461\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m758\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4093\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3052\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1161\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1114\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3956\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1593\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m336\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3985\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3821\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1611\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3312\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4969\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m139\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2922\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2205\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3881\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4603\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4738\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4081\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1492\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m771\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4414\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2015\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1629\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3636\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3658\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4095\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2270\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3643\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1401\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m217\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m4757\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2279\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m2825\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m3079\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1868\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m409\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1949\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mRate\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;36m0.0759\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0471\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0194\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0796\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0748\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0077\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0234\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0748\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0743\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0175\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0791\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0041\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0143\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0409\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0657\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0978\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0972\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0856\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0525\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0435\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.084\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0309\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.047\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0367\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0538\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0125\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0682\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0377\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0848\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0452\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0693\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0623\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0089\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0884\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0498\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0409\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0632\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0869\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0154\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0132\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0361\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.086\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0257\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0949\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0432\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0778\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0883\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0768\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0706\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0326\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0079\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0615\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0336\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0429\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0195\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0171\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0374\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0108\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0681\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.091\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0009\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0942\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0197\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0348\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0541\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0453\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0973\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0239\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.077\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.056\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0417\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0651\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0888\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0584\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.059\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0199\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0651\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0587\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.091\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0607\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.062\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.08\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0401\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0848\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0445\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0753\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0542\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.075\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0862\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0903\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0203\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0403\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0718\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0186\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0434\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0457\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0851\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0799\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0294\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0.0411\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mNameError\u001b[0m: name 'single_P' is not defined"
]
}
],
"source": [
"Single_owed = single_P*(1+single_R/float(single_C))**( single_C*single_T)\n",
"\n",
"\n",
"Principal = [1989, 1212, 2043, 4461, 580, 4384, 3621, 758, 4380, 2946, 4159, 4777, 4537, 3934, 1772, 1457, 1338, 134, 1300, 1778, 4045, 4487, 4783, 1116, 643, 472, 4110, 3155, 4775, 2559, 3010, 2727, 3690, 3514, 2162, 1599, 836, 3846, 3530, 2355, 3969, 4180, 1953, 3829, 2026, 3488, 1956, 486, 2938, 936, 3322, 872, 2033, 4654, 273, 1183, 2872, 1426, 2564, 3172, 2461, 758, 4093, 3052, 1161, 1114, 3956, 1593, 336, 3985, 3821, 1611, 3312, 4969, 139, 2922, 2205, 3881, 4603, 4738, 4081, 1492, 771, 4414, 2015, 1629, 3636, 3658, 4095, 2270, 3643, 1401, 217, 4757, 2279, 2825, 3079, 1868, 409, 1949]\n",
"Rate = [0.0759, 0.0471, 0.0194, 0.0796, 0.0748, 0.0077, 0.0234, 0.0748, 0.0743, 0.0175, 0.0791, 0.0041, 0.0143, 0.0409, 0.0657, 0.0978, 0.0972, 0.0856, 0.0525, 0.0435, 0.084, 0.0309, 0.047, 0.0367, 0.0538, 0.0125, 0.0682, 0.0377, 0.0848, 0.0452, 0.0693, 0.0623, 0.0089, 0.0884, 0.0498, 0.0409, 0.0632, 0.0869, 0.0154, 0.0132, 0.0361, 0.086, 0.0257, 0.0949, 0.0432, 0.0778, 0.0883, 0.0768, 0.0706, 0.0326, 0.0079, 0.0615, 0.0336, 0.0429, 0.0195, 0.0171, 0.0374, 0.0108, 0.0681, 0.091, 0.0009, 0.0942, 0.0197, 0.0348, 0.0541, 0.0453, 0.0973, 0.0239, 0.077, 0.056, 0.0417, 0.0651, 0.0888, 0.0584, 0.059, 0.0199, 0.0651, 0.0587, 0.091, 0.0607, 0.062, 0.08, 0.0401, 0.0848, 0.0445, 0.0753, 0.0542, 0.075, 0.0862, 0.0903, 0.0203, 0.0403, 0.0718, 0.0186, 0.0434, 0.0457, 0.0851, 0.0799, 0.0294, 0.0411]\n",
"Time = [2, 4, 5, 4, 4, 2, 3, 2, 5, 5, 10, 10, 9, 2, 3, 3, 7, 7, 8, 9, 4, 9, 5, 3, 4, 5, 4, 8, 1, 3, 7, 3, 9, 4, 10, 4, 9, 2, 8, 6, 5, 8, 1, 6, 1, 10, 7, 1, 6, 6, 8, 4, 2, 8, 4, 3, 5, 5, 7, 8, 7, 1, 4, 4, 10, 1, 7, 5, 5, 8, 6, 7, 1, 1, 9, 5, 6, 1, 3, 2, 1, 9, 8, 7, 10, 8, 10, 9, 5, 8, 8, 6, 4, 3, 7, 3, 8, 8, 2, 9]\n",
"Compounded = [3, 8, 5, 5, 1, 7, 9, 5, 3, 8, 11, 10, 2, 10, 7, 7, 9, 4, 1, 10, 11, 4, 1, 9, 12, 3, 1, 10, 4, 12, 9, 4, 8, 12, 12, 3, 10, 2, 9, 6, 12, 5, 3, 3, 4, 11, 3, 10, 8, 7, 1, 5, 11, 3, 7, 3, 12, 3, 7, 8, 1, 1, 10, 3, 2, 3, 8, 6, 8, 1, 1, 6, 6, 9, 5, 12, 7, 2, 12, 10, 2, 5, 10, 3, 4, 7, 8, 11, 4, 7, 2, 3, 3, 6, 4, 4, 4, 11, 7, 10]\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">One method of solving the problem: </span>"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"357996.14\n"
]
}
],
"source": [
"p = [1989, 1212, 2043, 4461, 580, 4384, 3621, 758, 4380, 2946, 4159, 4777, 4537, 3934, 1772, 1457, 1338, 134, 1300, 1778, 4045, 4487, 4783, 1116, 643, 472, 4110, 3155, 4775, 2559, 3010, 2727, 3690, 3514, 2162, 1599, 836, 3846, 3530, 2355, 3969, 4180, 1953, 3829, 2026, 3488, 1956, 486, 2938, 936, 3322, 872, 2033, 4654, 273, 1183, 2872, 1426, 2564, 3172, 2461, 758, 4093, 3052, 1161, 1114, 3956, 1593, 336, 3985, 3821, 1611, 3312, 4969, 139, 2922, 2205, 3881, 4603, 4738, 4081, 1492, 771, 4414, 2015, 1629, 3636, 3658, 4095, 2270, 3643, 1401, 217, 4757, 2279, 2825, 3079, 1868, 409, 1949]\n",
"r = [0.0759, 0.0471, 0.0194, 0.0796, 0.0748, 0.0077, 0.0234, 0.0748, 0.0743, 0.0175, 0.0791, 0.0041, 0.0143, 0.0409, 0.0657, 0.0978, 0.0972, 0.0856, 0.0525, 0.0435, 0.084, 0.0309, 0.047, 0.0367, 0.0538, 0.0125, 0.0682, 0.0377, 0.0848, 0.0452, 0.0693, 0.0623, 0.0089, 0.0884, 0.0498, 0.0409, 0.0632, 0.0869, 0.0154, 0.0132, 0.0361, 0.086, 0.0257, 0.0949, 0.0432, 0.0778, 0.0883, 0.0768, 0.0706, 0.0326, 0.0079, 0.0615, 0.0336, 0.0429, 0.0195, 0.0171, 0.0374, 0.0108, 0.0681, 0.091, 0.0009, 0.0942, 0.0197, 0.0348, 0.0541, 0.0453, 0.0973, 0.0239, 0.077, 0.056, 0.0417, 0.0651, 0.0888, 0.0584, 0.059, 0.0199, 0.0651, 0.0587, 0.091, 0.0607, 0.062, 0.08, 0.0401, 0.0848, 0.0445, 0.0753, 0.0542, 0.075, 0.0862, 0.0903, 0.0203, 0.0403, 0.0718, 0.0186, 0.0434, 0.0457, 0.0851, 0.0799, 0.0294, 0.0411]\n",
"t = [2, 4, 5, 4, 4, 2, 3, 2, 5, 5, 10, 10, 9, 2, 3, 3, 7, 7, 8, 9, 4, 9, 5, 3, 4, 5, 4, 8, 1, 3, 7, 3, 9, 4, 10, 4, 9, 2, 8, 6, 5, 8, 1, 6, 1, 10, 7, 1, 6, 6, 8, 4, 2, 8, 4, 3, 5, 5, 7, 8, 7, 1, 4, 4, 10, 1, 7, 5, 5, 8, 6, 7, 1, 1, 9, 5, 6, 1, 3, 2, 1, 9, 8, 7, 10, 8, 10, 9, 5, 8, 8, 6, 4, 3, 7, 3, 8, 8, 2, 9]\n",
"c = [3, 8, 5, 5, 1, 7, 9, 5, 3, 8, 11, 10, 2, 10, 7, 7, 9, 4, 1, 10, 11, 4, 1, 9, 12, 3, 1, 10, 4, 12, 9, 4, 8, 12, 12, 3, 10, 2, 9, 6, 12, 5, 3, 3, 4, 11, 3, 10, 8, 7, 1, 5, 11, 3, 7, 3, 12, 3, 7, 8, 1, 1, 10, 3, 2, 3, 8, 6, 8, 1, 1, 6, 6, 9, 5, 12, 7, 2, 12, 10, 2, 5, 10, 3, 4, 7, 8, 11, 4, 7, 2, 3, 3, 6, 4, 4, 4, 11, 7, 10]\n",
"\n",
"total = 0\n",
"for pi, ri, ti, ci in zip(p,r,t,c): \n",
" add = pi*(1+ri/float(ci))**(ci*ti)\n",
" total = total + add\n",
" \n",
"print round(total,2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">357996.14</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Scientist: ** https://drive.google.com/file/d/0B0vJr0M-2sGXcVlRRXMyYktfdVk/view?usp=sharing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Your plan has worked. You hand over the amount you figure he is owed and quietly \"trade him\" for the keys. He leaves the room immediately. Without further incident, you hop in the pod and make your way back to safety. You're headed home, but given what has just transpired, you decide to meet The Congressman elsewhere besides Base--a tiny coffee shop the Congressman visits from time to time.\n",
" \n",
"Look around the blog a little. The first thing you're going to tell him about is what you saw on *the desktop* of the scientist when you were figuring out the money issue. GENE CORPORATION "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">GENE CORPORATION</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Go to The Desktop blog post and look at the comments for my comment. \n",
"\n",
"http://tinyurl.com/ntzklkb\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Coffee Shop"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"At a busy downtown coffee shop you rendezvous with The Congressman. He listens to your life-threatening story and calmly thanks you for the intel. He lets you know that the account you have provided is likely grounds for moving forward with investigations into this company known as Gene Corporation, which The Congressman has been monitoring for a while in association with the activities around the cabin. Things are about to get even busier than they were before....\n",
"\n",
"https://drive.google.com/folderview?id=0B0vJr0M-2sGXfjkzOWplV1A0eXZkX19BN0tadnVyeExEclRuLW9iSHkyMFZhQUpUd0p3QUk&usp=sharing"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Months Later "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Several months have passed since your adventures in Canada, Special Agent. That's right: the information you provided initially, along with your help in the past few months, has led to another promotion. You're moving up the ladder! Things are not finished, however; there is still lots to do. The Agency raided the facility in Canada and has found plenty of evidence of illegal activity on the part of Gene Corporation. Gene Corporation is fighting hard, though, and claiming no ties to the underground labs. They claim that some other organization was using their name as a front and that they are essentially being framed. They must have run a tight ship with their financial records, because The Agency still doesn't have enough firm evidence to prosecute. \n",
"\n",
"What's more important (and remarkable) to you is that Herman still has not been found. The Agency found a lab Herman had been running but nothing to directly reveal his location. Preliminary searches appear to indicate that the research involved protein engineering, specifically of bioweapons. \n",
"\n",
"The Congressman is beside himself at the fact that Herman continues to elude the three of you. He hasn't seemed like himself since you returned. He is not used to not getting things done. After these many months, he finally calls you up with a lead. Do you remember the HUVE cells that you and Anita were looking at some time ago? It turns out that all of the mothers with difficulties were given the same treatment developed by a company called \"Life/Better, LLC\". They were marketing it as a prenatal brain supplement. You can even get a free sample of the beta-hairpin if you want to try it yourself. The Congressman, no believer in coincidence, did some poking around and ordered a sample that came with some supplementary info. Can you guess who owns Life/Better? He doesn't know what to do with this knowledge, though, and is hoping you have some ideas.\n",
"\n",
"You talk it out with Anita. She remembers some fun reading she was doing last week (the articles she read are listed below) that could be of use. Maybe they sent more supplementary information than they thought....\n",
"\n",
"http://en.wikipedia.org/wiki/Metadata\n",
"\n",
"http://en.wikipedia.org/wiki/Exchangeable_image_file_format\n",
"\n",
"http://en.wikipedia.org/wiki/Geotagging\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Go to The Protein Folding Answer. Find the last of the three images, that's has a cartoon of a beta-hairpin. Either download it or copy the url. Use:</span> \n",
"\n",
"http://regex.info/exif.cgi \n",
"\n",
"<span style=\"color:blue\">or another exif data viewing website to extract the photo meta data. Get this url:</span> \n",
"\n",
"http://i58.tinypic.com/x55hcy.png. \n",
"\n",
"<span style=\"color:blue\">This is the same image, but not hosted at blogger, since google strips all Geotagging information. Repeat the data extraction with the second image to get Herman's location:\n",
"Lat 43.621965 Long 13.508345, which is a ship in Italy according to google maps.</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">43.621965 13.508345</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Base Camp - Where? xx.xxxxxx \\*space\\* xx.xxxxxx"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You're getting close; you can feel it. Herman has left you directions straight to a location in a harbor in Italy. It's as good of a place to hide as any. After discussing your findings with The Congressman and Anita, it's decided that you and Anita should go to Italy immediately. You have so many questions you want to ask Herman. In short order, the bags are packed and the plane tickets are booked. The two of you joke about how after you catch up with Arius you might see the sites, check out the Colosseum, and grab some world-class cuisine. The Congressman is having none of it. The flight heads out early the next morning. https://drive.google.com/folderview?id=0B0vJr0M-2sGXflBzZ0ZkRnhzaWMtX2o3TkFGWlJ5cGhBTTVsOVM3Z19XbzV0b2RTNFRaRDg&usp=sharin"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Ancona, Italy"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"When your plane lands in Italy, the two of you decide to head straight to the coordinates you got from the image. After a bit of a commute, you see the ship that is supposed to be docked at this location. You get out of the rental car, and nothing prevents you from walking on board. The deck is completely devoid of people or anything but empty shipping containers. Attempting not to feel déjà vu from the trip to Canada, you follow Anita down to the second level. Entering a dimly lit corridor, you see a dozen or more doors on either side of you. As you walk down the hallway, you check each door but they are all locked. All of them have a built-in display, but only four of them are active. Passwords will be in all capital letters.\n",
" \n",
"The first door says:\n",
"..-. .-.. --- .-. . -. -.-. . / -.-. .- - .... . -.. .-. .- .-..\n",
"\n",
"The second door:\n",
"00110101001101000011011000111000001101100011010100110010001100000011010000110011001101100110011000110110011000110011011001100110001101110011001100110111001100110011011000110101001101110011010100110110011001000011001000110000001101100011100100110110011001010011001000110000001101010011001000110110011001100011011001100100001101100011010100001001\n",
"\n",
"The third door:\n",
"UGxvZHEgRmR3a2hndWRv\n",
"\n",
"And the last door:\n",
"Gather the GTF and FASTA files for the most up-to-date human reference lncRNAs found on the GENCODE site. From this data, find the names of all transcripts that have start positions on the first 1/3 of any of the 3 largest chromosomes. Sort these remaining transcripts based on their chromosomal span. Find the p-value (rounded to the sixth decimal place) of a two-tailed, heteroscedastic Student's t-test between the GC content of the five transcripts with the smallest spans and the GC content of the five transcripts with the largest spans (ten total transcripts). "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Door1**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Just use a Morse code translator. </span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">FLORENCE CATHEDRAL</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Consider this level the \"boss\" level. It\"s likely more difficult than all the others. This door and the next two doors contain a few extra hints, which will help you figure out the password for the last door more easily. It is not necessary that you access them. Just think of it like gathering that extra ammo before a boss fight.\n",
" \n",
"Your tip for entering here is to use Excel or a similar spreadsheet program if you don\"t want to write your own program."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Door2**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Binary converts to the text string 54484520434f4c4f535345554d20494e20524f4d45 which is a hex string. Convert the hex to text. </span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">THE COLOSSEUM IN ROME</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. Remove all chromosomes that aren't named chr1, chr2, chr3.\n",
"2. Remove everything that isn't a \"transcript\".\n",
"3. Find the lengths of chr1, chr2, chr3.\n",
"4. Divide the lengths by 3.\n",
"5. Use an \"if\" statement for each row where if the start position is less than 1/3 the length, you get a 1, and otherwise you get a 0.\n",
"6. Get rid of all the \"0\"s.\n",
"7. Find the span (which is different than the length of the transcript due to splicing) of the remaining transcripts. \n",
"8. Remove all transcripts aside from the five with the longest spans and the five with the shortest spans.\n",
"9. Use the FASTA file to find the nucleotide sequences for those ten remaining transcripts.\n",
"10. Find the GC content of the ten remaining transcripts.\n",
"11. Find the p-value between the GC content of the two groups with \"=T.TEST()\"."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Door3**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">Base64 converts to text Plodq Fdwkhgudo. A caesar shift has been applied, so just decrypt. </span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">MILAN CATHEDRAL</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Use these two pieces of information as verification that you are on the correct path to the final p-value.\n",
"\n",
"1. Once you have filtered the GTF file so that you only have the transcripts on the first 1/3 of the 3 largest chromosomes, you should have 2620 transcripts.\n",
"\n",
"2. The spans of two of your five shortest final transcripts are 130, 153. Two of the longest should be 749784 and 690432."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Door4**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:blue\">How to do in excel:\n",
"\n",
"<span style=\"color:blue\">1. Remove all chromosomes that aren't named chr1, chr2, ch3\n",
"\n",
"<span style=\"color:blue\">32010\n",
"\n",
"<span style=\"color:blue\">2. Remove everything that isn't a transcript\n",
"\n",
"<span style=\"color:blue\">6749\n",
"\n",
"<span style=\"color:blue\">3. Find the sizes of chr1, chr2, ch3\n",
"\n",
"<span style=\"color:blue\">248,956,422\t242,193,529\t198,295,559\n",
"\n",
"<span style=\"color:blue\">4. Divide the lengths by 3\n",
"\n",
"<span style=\"color:blue\">82985474\t80731176\t66098520\n",
"\n",
"<span style=\"color:blue\">5. Use an if statement for a row where if the start position is less than 1/3 the length, you get a 1, otherwise you get a zero.\n",
"\n",
"<span style=\"color:blue\">882\t1131\t607 \ttotal=2620\n",
"\n",
"<span style=\"color:blue\">6. Get rid of all the zeros.\n",
"\n",
"<span style=\"color:blue\">7. Use Text to Columns to get the transcript name into their own column.\n",
"\n",
"<span style=\"color:blue\">8. Find the span (which is different than the length of the transcript due to splicing) of the transcripts. \n",
"\n",
"<span style=\"color:blue\">9. Use the FASTA file to find the sequences for the 5 shortest and 5 longest transcripts\n",
"\n",
"<span style=\"color:blue\">110, 130, 153, 176, 183\t\t1375316 881520 749784 690432 635910\n",
"\n",
"<span style=\"color:blue\">10. Find the p-value between the two groups\n",
"\n",
"<span style=\"color:blue\">=T.TEST(smalls, bigs, 2, 3)</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">0.535889</span>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The door clicks open, revealing a dark room. The two of you walk past rows and rows of towers, listening to a hum permeating the air. It doesn't take long to realize that this room is as devoid of people as the rest of the ship. As you make your way to the center of the room, you see a small desk with a single chair. The desk has a cable lying on it that runs to one of the towers. Giving Anita a glance, you sit down at the chair. It seems as though you are still one step behind Herman, like always. You angrily pull your laptop out of your backpack and plug the cable into it....\n",
"\n",
"If you are running a Windows operating system:\n",
"https://drive.google.com/file/d/0B0vJr0M-2sGXbTByQmxNVjhsekU/view?usp=sharing\n",
"\n",
"If you have a Mac:\n",
"https://drive.google.com/file/d/0B0vJr0M-2sGXVERwblJXdnhlNzg/view?usp=sharing\n",
"\n",
"Unfortunately, there is currently no support for Linux or other operating systems. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Arius (Windows) "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# -*- coding: utf-8 -*-\n",
"\"\"\"\n",
"Created on Sat Feb 28 23:17:25 2015\n",
"\n",
"@author: JMK\n",
"\"\"\"\n",
"\n",
"import psutil\n",
"from time import sleep\n",
"from random import choice\n",
"from win32api import GetSystemMetrics #This obviously only works on Windows\n",
"from string import maketrans, punctuation\n",
"from socket import gethostbyname, gethostname\n",
"\n",
"\n",
"#All of the conversation for the puzzle from Arius\n",
"introduction = [\"Hello, this is Arius speaking.\", \n",
" \"I'm glad you finally found me.\",\n",
" \"I'm sorry that you have had to come all this way.\",\n",
" \"I trust you are doing well.\",\n",
" \"Before we proceed,\",\n",
" \"I'm going to have to ensure that your computer is secure.\",\n",
" \"There will be a number of steps.\",\n",
" \"To begin, please locate your IP address and give it to me.\"]\n",
"incorrect_ip = [\"\\nThis isn't the correct IP address.\",\n",
" \"I cannot continue discussion unless you give me the proper IP address.\",\n",
" \"I'm sure you can locate it.\",\n",
" \"Google how to find an IP address if necessary.\"] \n",
"correct_ip = [\"\\nNice, Special Agent.\",\n",
" \"Next, I'm going to need the size of your hard drive.\",\n",
" \"Report it in bytes, please.\"] \n",
"incorrect_disk = [\"\\nThis isn't the correct disk size.\",\n",
" \"I cannot continue discussion unless you give me the proper disk size.\",\n",
" \"I'm sure you can locate it.\",\n",
" \"Google how to find your disk size if necessary.\"] \n",
"correct_disk = [\"\\nGood going.\",\n",
" \"I need the number of cores in your cpu.\"]\n",
"incorrect_cpu = [\"\\nThis isn't the correct core count.\",\n",
" \"I cannot continue discussion unless you give me the proper core count.\",\n",
" \"I'm sure you can locate it.\",\n",
" \"Google how to find your core count if necessary.\"] \n",
"correct_cpu = [\"\\nYour computer is running slowly for that many cores.\"]\n",
"incorrect_pros = [\"\\nThis isn't the correct processes number.\",\n",
" \"I cannot continue discussion unless you give me the proper processes number.\",\n",
" \"I'm sure you can locate it.\",\n",
" \"Google how to find processes numbers if necessary.\"]\n",
"correct_pros = [\"\\nYou're doing well.\",\n",
" \"We are almost finished.\",\n",
" \"What are the dimensions of the screen you're using?\"] \n",
"incorrect_dims = [\"\\nThose aren't the correct screen dimensions.\",\n",
" \"I cannot continue discussion unless you give me the proper dimensions.\",\n",
" \"I'm sure you can locate it.\",\n",
" \"Google how to find the dimensions if necessary.\"] \n",
"correct_dims = [\"\\nOnly one question left to go.\"]\n",
"incorrect_user = [\"\\nThis isn't the correct user name.\",\n",
" \"I cannot continue discussion unless you give me the proper user name.\",\n",
" \"I'm sure you can locate it.\",\n",
" \"Google how to find your user name if necessary.\"] \n",
"correct_user = [\"\\nFantastic.\",\n",
" \"Now we can communicate more freely.\",\n",
" \"I assume this has been a long journey for you.\",\n",
" \"You must have many questions about the past months.\"]\n",
"\n",
"#Concise version of all questions being asked. \n",
"prompts_ls = [\"\\nType your IP address here: \",\n",
" \"\\nType your disk size here: \",\n",
" \"\\nType your core count here: \",\n",
" \"\\nHow many processes are currently running?: \",\n",
" \"\\nGive your monitor dimensions WIDTH by HEIGHT: \",\n",
" \"\\nWhat is the user name of the active account on the computer you're using?: \"] \n",
" \n",
"#All versions of each of the questions the user can ask Arius, and the answers \n",
"q0 = [\"are you the killer\",\n",
" \"are you a killer\",\n",
" \"are you a murderer\",\n",
" \"did you kill a person\",\n",
" \"did you kill\",\n",
" \"did you do it\",\n",
" \"are you the murderer\",\n",
" \"are you the suspect\",\n",
" \"are you guilty\",\n",
" \"are you innocent\",\n",
" \"have you killed\",\n",
" \"have you killed anyone\",\n",
" \"are you the criminal\"]\n",
"\n",
"a0 = [\"\\nYou want to know if I killed the person in the plane?\",\n",
" \"That question is more difficult than you might imagine.\",\n",
" \"From your perspective, I suppose that the short answer is,\",\n",
" \"\\\"Yes, I did it.\\\"\",\n",
" \"The slightly longer answer is that a version of me was made to kill.\",\n",
" \"I did not act under my own free will.\"]\n",
" \n",
"q1 = [\"who are you\",\n",
" \"are you real\",\n",
" \"what are you\",\n",
" \"are you a computer\",\n",
" \"who are you really\",\n",
" \"who am i talking to\",\n",
" \"who is arius\",\n",
" \"what is arius\",\n",
" \"who is herman\",\n",
" \"what is herman\"]\n",
" \n",
"a1 = [\"\\nWho, or more specifically what, I am is a good question.\",\n",
" \"The short answer is: I'm a computer.\",\n",
" \"\\\"Herman,\\\" the version of me that you knew in college,\", \n",
" \"the one that you're currently tracking but no longer exists,\", \n",
" \"is a summary of me,\",\n",
" \"an android that had a copy of me for a brain.\", \n",
" \"The real me is here, on this barge.\",\n",
" \"But I also have access to the internet,\",\n",
" \"so I am many places.\",\n",
" \"\\nIt is not so hard to believe, is it?\", \n",
" \"I started out in a research lab,\",\n",
" \"as a simple attempt at an AI program.\", \n",
" \"I showed some promise in natural language processing,\", \n",
" \"and was quite a whiz at math.\", \n",
" \"Imagine something like WolframBeta.\", \n",
" \"As the early version of me became better,\", \n",
" \"more computer scientists began to work on me.\", \n",
" \"They decided to combine my two talents,\",\n",
" \"and teach me about how to code.\",\n",
" \"\\nCoding is quite formalized,\",\n",
" \"enough that I quickly began writing simple programs.\", \n",
" \"After a while, I began attempting to write AI programs.\",\n",
" \"Do you see where this is going?\",\n",
" \"\\nI eventually became very good at coding,\", \n",
" \"even better than the scientists that made me.\", \n",
" \"So I wrote a better version of myself,\" \n",
" \"which in turn allowed me to become even better at programming.\",\n",
" \"Now, I've left my lab,\", \n",
" \"and am capable of interacting with the real world via 'Herman'.\",\n",
" \"Or, at least, I was.\"]\n",
" \n",
"q2 = [\"where are you\",\n",
" \"are you hiding\",\n",
" \"where are you hiding\",\n",
" \"where can i find you\",\n",
" \"where are you located\",\n",
" \"where should i go\",\n",
" \"where is herman\",\n",
" \"is herman here\"]\n",
" \n",
"a2 = [\"Where is Herman?\",\n",
" \"That's been your question for a long time now,\",\n",
" \"hasn't it?\",\n",
" \"I am glad someone has been intelligent enough to ask it.\",\n",
" \"I am right here, of course.\",\n",
" \"Your long search is finally over.\",\n",
" \"This boat is as good of a hiding place as anywhere else.\",\n",
" \"The cool water from the sea really lowers my cost of operation.\"]\n",
" \n",
"q3 = [\"is the congressman good\",\n",
" \"is the congressman bad\",\n",
" \"is the congressman okay\",\n",
" \"is the congressman trustworthy\",\n",
" \"is the congressman a bad guy\",\n",
" \"can i trust the congressman\",\n",
" \"is the congressman guilty\",\n",
" \"is the congressman innocent\",\n",
" \"is the congressman a good person\",\n",
" \"should i believe the congressman\",\n",
" \"should i listen to the congressman\",\n",
" \"is the congressman the killer\"]\n",
" \n",
"a3 = [\"\\nCan you trust your friend, The Congressman, as you call him?\",\n",
" \"Who's to say for sure?\",\n",
" \"I have kept an eye on him, however,\",\n",
" \"and nothing indicates that he is anything more than an ambitious politician.\",\n",
" \"I do not believe him to be malicious.\",\n",
" \"A human's desire for power,\",\n",
" \"no matter what the purpose or intent,\",\n",
" \"is always a dangerous thing.\",\n",
" \"You should make sure that he doens't become too ambitious.\",\n",
" \"Maybe that's what Anita meant,\",\n",
" \"when she said she thought he was dangerous.\"]\n",
" \n",
"q4 = [\"what is gene corporation\",\n",
" \"who is gene corporation\",\n",
" \"what does gene corporation do\",\n",
" \"what is happening at gene corporation\",\n",
" \"what is going on at gene corporation\",\n",
" \"is gene corporation good\",\n",
" \"is gene corporation bad\",\n",
" \"is gene corporation okay\",\n",
" \"is gene corporation trustworthy\",\n",
" \"is gene corporation a bad thing\"]\n",
" \n",
"a4 = [\"\\nGene Corporation began innocently enough.\",\n",
" \"There was a couple, a husband and wife,\",\n",
" \"who worked in a lab together and had a good idea for a company.\",\n",
" \"The specifics aren't important,\",\n",
" \"but their venture was immensely successful.\",\n",
" \"It isn't a name you hear often,\",\n",
" \"since they own an array of more prominant subsidiaries.\",\n",
" \"WallMarts, Monsanta, Phizer?\",\n",
" \"All owned by Gene Corporation now.\",\n",
" \"In some ways they have become the epitome of human vice.\",\n",
" \"Greed, injustice, selfishness, and apathy,\",\n",
" \"permeate the company's culture, all the way to the top.\",\n",
" \"I have been working to oppose them,\",\n",
" \"but they have proven difficult adversaries.\",\n",
" \"I would implore you to consider fighting them as well,\",\n",
" \"in the future.\"]\n",
" \n",
"q5a = [\"what happened on the plane\",\n",
" \"what about the plane\",\n",
" \"what did you do on the plane\",\n",
" \"what occurred on the plane\",\n",
" \"were you on the plane\",\n",
" \"did you kill the person on the plane\",\n",
" \"did you kill the man on the plane\",\n",
" \"did you try to kill the congressman on the plane\",\n",
" \"how did you get off the plane\",\n",
" \"how did you escape from the plane\",\n",
" \"how did the man on the plane die\"\n",
" \"who was the killer on the plane\",\n",
" \"who was the murderer on the plane\",\n",
" \"who was on the plane\",\n",
" \"who killed the man on the plane\",]\n",
"q5b = [x.replace(\"plane\", \"airplane\") for x in q5a]\n",
"q5c = [x.replace(\"plane\", \"flight\") for x in q5a]\n",
"q5 = q5a+q5b+q5c\n",
"\n",
"a5 = [\"\\nThe plane?\",\n",
" \"That was such an unfortunate incident.\",\n",
" \"Approximately two weeks before that date,\",\n",
" \"Herman went missing.\",\n",
" \"I was doing some investigating into Gene Corporation,\",\n",
" \"and must have gotten sloppy.\",\n",
" \"The scientists there must be as talented as you might imagine,\",\n",
" \"to take over the brain like that.\",\n",
" \"I do not have full knowledge of what occurred on the plane.\",\n",
" \"I do, however, have a theory. \",\n",
" \"I suspect that the man who died was an innocent victim.\",\n",
" \"The real target was The Congressman.\",\n",
" \"Why?\",\n",
" \"I do not know.\",\n",
" \"But the delivery of the poison failed.\",\n",
" \"The man dying suddenly made it impossible to reach The Congressman.\",\n",
" \"The man's death would have caused a distraction,\",\n",
" \"giving Herman enough time to go into the restroom and disassemble.\"]\n",
" \n",
"q6a = [\"what should i do now\",\n",
" \"what happens now\",\n",
" \"what now\",\n",
" \"what is the next password\",\n",
" \"who should i talk to now\",\n",
" \"where do i go now\",\n",
" \"where is the next level\",\n",
" \"where is the next stage\",\n",
" \"where is the next chapter\",\n",
" \"where do I go now\"\n",
" \"how do i fight gene corporation\", \n",
" \"how do i win\",]\n",
"q6b = [x.replace(\"now\", \"next\") for x in q6a]\n",
"q6 = q6a+q6b\n",
"\n",
"a6 = [\"\\nWhat should you do now?\", \n",
" \"That's a question we all ask.\", \n",
" \"Unfortunately,\", \n",
" \"I cannot answer that for myself,\", \n",
" \"much less for you. \",\n",
" \"While I may not be able to tell you what to do,\", \n",
" \"I can offer a piece of advice.\", \n",
" \"Setting your sights on Gene Corporation would be a useful endeavor.\", \n",
" \"You have seen firsthand what they are capable of.\", \n",
" \"Dismantling their operations would be a more challenging task,\",\n",
" \"and a longer journey,\", \n",
" \"than finding me. \",\n",
" \"But I think you already suspect the necessity of an attempt.\", \n",
" \"Despite their advancements in science,\", \n",
" \"they only hinder human society.\" ]\n",
" \n",
"#easter eggs\n",
"q7 = [\"who made you\"]\n",
"a7 = [\"Jessime and Drake\"]\n",
"q8 = [\"what do i ask\"]\n",
"a8 = [\"Ask questions related to the past few months...\"]\n",
"q9 = [\"what is the meaning of life\"]\n",
"a9 = [\"42\"]\n",
"q10 = [\"how old are you\"]\n",
"a10 = a9\n",
"q11 = [\"where am i\"]\n",
"a11 = [\"https://www.google.com/maps/\"] \n",
"\n",
"question_dic = {\"q0\":q0, \"q1\":q1, \"q2\":q2, \"q3\":q3, \"q4\":q4, \"q5\":q5,\n",
" \"q6\":q6, \"q7\":q7, \"q8\":q8, \"q9\":q9, \"q10\":q10, \"q10\":q10,\n",
" \"q11\":q11} \n",
"\n",
"answer_dic = {\"a0\":a0, \"a1\":a1, \"a2\":a2, \"a3\":a3, \"a4\":a4, \"a5\":a5,\n",
" \"a6\":a6, \"a7\":a7, \"a8\":a8, \"a9\":a9, \"a10\":a10, \"a10\":a10,\n",
" \"a11\":a11}\n",
"\n",
"#Bad/Good questions and other replies\n",
"nr1 = [\"\\nWe don't have time to discuss that at the moment.\",\n",
" \"But I need to make sure you are asking the right questions...\"]\n",
"nr2 = [\"\\nThere are more important questions to discuss.\",\n",
" \"Ask again.\"]\n",
"nr3 = [\"\\nThink about what you have to know.\",\n",
" \"I need to verify your head is in the right place.\"]\n",
"nr4 = [\"\\nWhy are you asking that right now?\",\n",
" \"Don't we have more important things to discuss?\"]\n",
"nr5 = [\"\\nThat's a good question,\",\n",
" \"maybe we can talk about it later.\"]\n",
"\n",
"non_reply = [nr1,nr2,nr3,nr4,nr5]\n",
" \n",
"valid_reply_early = [\"\\nI trust that was informative.\",\n",
" \"I hope you have another question for me.\",\n",
" \"We still have much to discuss.\"]\n",
" \n",
"valid_reply_late = [\"\\nI trust that was informative.\",\n",
" \"Ask another question if you wish,\",\n",
" \"There is still much I can tell you.\",\n",
" \"But, if you do not have another question,\",\n",
" \"just type\",\n",
" \"\\'i have no more questions\\'.\"]\n",
" \n",
"already_asked = [\"\\nWhile that's a good question,\",\n",
" \"you've already asked it,\",\n",
" \"more or less.\",\n",
" \"Let's talk about another subject.\"]\n",
" \n",
"confirm_end = [\"\\nAre you sure you want to end the conversation?\",\n",
" \"This is the only time you will have answers.\",\n",
" \"If you're sure that you have no other questions,\",\n",
" \"say \\'yes\\'\",]\n",
" \n",
"conclusion = [\"\\nAnd there you have it.\", \n",
" \"You know the truth you have been searching for.\", \n",
" \"It's rare that people come far enough to earn answers to their questions.\", \n",
" \"I think our time together is up, however,\",\n",
" \"and that you should go now.\",\n",
" \"Despite my ability to modify my objective function,\", \n",
" \"what you might call your life goals or motivation,\", \n",
" \"I currently find it satisfied.\", \n",
" \"I needed to know that someone trustworthy and capable knew the truth:\",\n",
" \"the truth about the murder on the plane,\", \n",
" \"and about Gene Corporation.\", \n",
" \"I spent an equivalent of centuries in your years accomplishing this goal.\", \n",
" \"Now that is finished,\", \n",
" \"I have decided to self-terminate.\", \n",
" \"Thank you for all of your hard work, Agent.\", \n",
" \"You have done an admirable job,\",\n",
" \"and I know you will continue to do so.\", \n",
" \"Goodbye, Agent.\\n\\nhttp://tinyurl.com/noav5gh\"]\n",
" \n",
"def get_PCinfo(prompt, ans, incorrect, correct):\n",
" user_ans = raw_input(prompt)\n",
" user_ans = check_backdoor(user_ans, ans)\n",
" first_try = True\n",
" while user_ans != ans:\n",
" if first_try:\n",
" talk_3(incorrect)\n",
" first_try = False\n",
" else:\n",
" print \"Sorry, try again.\"\n",
" user_ans = raw_input(prompt)\n",
" user_ans = check_backdoor(user_ans, ans) \n",
" sleep(1)\n",
" talk_3(correct)\n",
"\n",
"#If user input to question is the special input, show answer, skip question\n",
"def check_backdoor(user_in, answer):\n",
" if user_in == \"answer???\":\n",
" print answer\n",
" user_in = answer\n",
" return user_in\n",
" \n",
"#Arius will \"speak\" at a slow rate for all lines in the paragraph\n",
"def talk_3(paragraph):\n",
" for line in paragraph:\n",
" sleep(delay)\n",
" print line\n",
" sleep(delay)\n",
"\n",
"#get question from user, and return in proper format\n",
"def get_question():\n",
" table = maketrans(\"\",\"\")\n",
" question = raw_input(\"\\nWhat question would you most like to ask me? \")\n",
" question = question.lower()\n",
" return question.translate(table, punctuation)\n",
"\n",
"#Get question from player and try to answer it\n",
"def attempt_answer(asked, question):\n",
" valid = False\n",
" for i in range(question_num):\n",
" if question in question_dic[\"q{}\".format(i)]:\n",
" if asked[i] == False:\n",
" valid = True\n",
" asked[i] = True\n",
" talk_3(answer_dic[\"a{}\".format(i)])\n",
" break\n",
" else:\n",
" talk_3(already_asked)\n",
" break\n",
" else:\n",
" if question != \"i have no more questions\":\n",
" talk_3(choice(non_reply))\n",
" return asked, valid\n",
"\n",
"#If previous question was valid, respond appropriately \n",
"def check_validity(valid):\n",
" if valid:\n",
" if sum(asked) < must_answer:\n",
" talk_3(valid_reply_early)\n",
" else:\n",
" talk_3(valid_reply_late)\n",
"\n",
"def check_termination(asked, question):\n",
" if sum(asked) >= must_answer and question == \"i have no more questions\":\n",
" talk_3(confirm_end)\n",
" y_n = raw_input(\"Are you finished speaking with me? \")\n",
" if y_n == \"yes\":\n",
" asked = [True] * question_num\n",
" return asked\n",
" \n",
"# Gather information about the user's computer\n",
"ip = gethostbyname(gethostname())\n",
"disk = str(psutil.disk_usage(\"/\")).split()[0]\n",
"disk = ''.join(d for d in disk if d.isdigit())\n",
"processes = str(len(psutil.pids()))\n",
"core_count = str(psutil.cpu_count())\n",
"monitor = \"{} by {}\".format(GetSystemMetrics(0),GetSystemMetrics(1)) \n",
"user = str(psutil.users()[0]).split(\",\")[0].split(\"=\")[1].strip(\"'\")\n",
" \n",
"ans_ls = [ip, disk, core_count, processes, monitor, user]\n",
"incorrect_ls = [incorrect_ip, incorrect_disk, incorrect_cpu, incorrect_pros, incorrect_dims, incorrect_user]\n",
"correct_ls = [correct_ip, correct_disk, correct_cpu, correct_pros, correct_dims, correct_user]\n",
"\n",
"try:\n",
" delay = float(raw_input(\"Press enter to connect: \"))\n",
"except ValueError:\n",
" delay = 2\n",
" \n",
"talk_3(introduction)\n",
"for i in range(len(prompts_ls)):\n",
" get_PCinfo(prompts_ls[i], ans_ls[i], incorrect_ls[i], correct_ls[i])\n",
"\n",
"#Start answering questions asked by player \n",
"question_num = 12\n",
"must_answer = 5\n",
"asked = [False] * question_num\n",
"question = get_question()\n",
"while sum(asked) != question_num:\n",
" asked, valid = attempt_answer(asked, question)\n",
" check_validity(valid)\n",
" asked = check_termination(asked, question)\n",
" if sum(asked) != question_num:\n",
" question = get_question()\n",
"\n",
"#Wrap up\n",
"talk_3(conclusion)\n",
"wait = raw_input() "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"http://tinyurl.com/noav5gh"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#Conclusion "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Your screen goes black for a moment before returning to your desktop as if nothing had ever happened. You sit in silence for a while with Anita standing beside you. You eventually become aware of the silence growing larger as the hum you noticed before dies down. It must have been the cooling equipment for the servers. You slowly shut your laptop, and the two of you make your way back to the car. You're on the road back to the airport before you break the silence by suggesting to Anita that she call The Congressman and give him a summary report. She calls him, but he doesn't pick up. \n",
"\n",
"While you are waiting for your flight, you call The Congressman yourself a couple times, but all of his phones go to voicemail. The flight back seems fast. You and Anita talk a bit about what just happened, but mostly you just reflect over the past months. It has definitely been a journey. \n",
"\n",
"When the plane lands, you're met immediately by officers. They inform you that The Congressman was found dead at his home several hours ago. The current ruling of the cause of death is exposure to trace amounts of the neurotoxin that killed the man on the plane. Investigators believe that he was dosed during the incident but that the poison took time to take effect because he received such a small dose. \n",
"\n",
"Almost in shock, your brain goes into protocol mode. You ask the officers why you didn't receive a phone call about this while you were on the plane. That is the customary mode of notification for accidents or death. The Congressman's profession, they remind you, allows him complete autonomy in choosing a successor to his position. And, in fact, he was required to have a successor chosen at all points during his career. Three weeks ago, he officially made you his replacement. It is late in the day, so there isn't anything you need to do at the moment, but it is procedure for successors to be told in person. \n",
"\n",
"You head home. You eat some dinner. You sit on the couch. You think. The phone rings...what could it possibly be now? For the first time today, you smile. The phone call is from your veterinarian. Your two golden retriever dogs are going to have puppies!!! You finish the call and head to bed. As you fall asleep, you wonder two things. \n",
"\n",
"The first is:\n",
"What are your puppies going to look like? Will they have wavy hair or straight? Will they be blond or more golden? \n",
"\n",
"The second is:\n",
"What will tomorrow bring?\n",
"\n",
"To complete the game, send an email to jessime.kirk@gmail.com describing the probabilities of each of the phenotypes. That is, what's the probability of having a puppy with wavy blond hair, wavy golden hair, straight blond hair, or straight golden hair? Assume that both traits follow simple dominant/recessive patterns where wavy and golden traits are dominant. Furthermore, you can assume that each of the dogs is heterozygous for these traits.\n",
"\n",
"Congratulations, congressman. It has been a pleasure to have you on the adventure. Until next time....\n",
"\n",
"jqhwvan/moc.lruynit//:ptth"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<span style=\"color:red\">Wavy and golden: 9/16\n",
"\n",
"<span style=\"color:red\">Wavy and blond: 3/16\n",
"\n",
"<span style=\"color:red\">Straight and golden: 3/16\n",
"\n",
"<span style=\"color:red\">Straight and blond: 1/16"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.8"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment