Add files via upload
This commit is contained in:
parent
58326a0d84
commit
c29cf10727
@ -4,12 +4,12 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"<div align=\"right\" style=\"text-align: right\"><i>Peter Norvig<br>April 2015<br>Python 3: Feb 2019<br>Steve's bus: Apr 2020<br>Mad Cheryl: May 2020</i></div>\n",
|
||||
"<div align=\"right\" style=\"text-align: right\"><i>Peter Norvig<br>April 2015<br>Steve's bus: Apr 2020<br>Mad Cheryl: May 2020</i></div>\n",
|
||||
"\n",
|
||||
"# When is Cheryl's Birthday?\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"**[This puzzle](https://en.wikipedia.org/wiki/Cheryl%27s_Birthday)** has been making the rounds:\n",
|
||||
"**[This logic puzzle](https://en.wikipedia.org/wiki/Cheryl%27s_Birthday)** has been making the rounds:\n",
|
||||
"\n",
|
||||
"1. Albert and Bernard became friends with Cheryl, and want to know when her birthday is. Cheryl gives them a list of 10 possible dates:\n",
|
||||
" - May 15, May 16, May 19\n",
|
||||
@ -18,15 +18,15 @@
|
||||
" - August 14, August 15, August 17\n",
|
||||
"3. **Cheryl** then privately tells Albert the month and Bernard the day of her birthday.\n",
|
||||
"4. **Albert**: \"I don't know when Cheryl's birthday is, and I know that Bernard does not know.\"\n",
|
||||
"5. **Bernard**: \"At first I did't know when Cheryl's birthday is, but I know now.\"\n",
|
||||
"5. **Bernard**: \"At first I didn't know when Cheryl's birthday is, but I know now.\"\n",
|
||||
"6. **Albert**: \"Then I also know when Cheryl's birthday is.\"\n",
|
||||
"7. So when is Cheryl's birthday?\n",
|
||||
"\n",
|
||||
"Let's work through the puzzle line by line.\n",
|
||||
"\n",
|
||||
"## 1. Cheryl gives Albert and Bernard a list of 10 possible dates:\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"## 1. Cheryl gives them a list of 10 possible dates:\n"
|
||||
"The result of this is that Albert and Bernard each know the birthday is one of ten dates, but they don't know which date. We'll call a set of possible dates a **belief state**. As additional statements are made, each character's belief state will change. When someone has a belief state with just one possibility, we say they **know** the true value.\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -35,10 +35,14 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"DATES = ['May 15', 'May 16', 'May 19',\n",
|
||||
" 'June 17', 'June 18',\n",
|
||||
" 'July 14', 'July 16',\n",
|
||||
" 'August 14', 'August 15', 'August 17']"
|
||||
"BeliefState = set # A set of possible values\n",
|
||||
"\n",
|
||||
"DATES = BeliefState({'May 15', 'May 16', 'May 19', 'June 17', 'June 18', \n",
|
||||
" 'July 14', 'July 16', 'August 14', 'August 15', 'August 17'})\n",
|
||||
"\n",
|
||||
"def know(beliefs: BeliefState) -> bool:\n",
|
||||
" \"\"\"A person `knows` the correct value if their belief state has only one possibility.\"\"\"\n",
|
||||
" return len(beliefs) == 1"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -67,12 +71,7 @@
|
||||
"source": [
|
||||
"## 2. Cheryl then privately tells Albert the month and Bernard the day of her birthday.\n",
|
||||
"\n",
|
||||
"Now we have to think really carefully about what we're doing. The puzzle is tricky because we're dealing with two types of uncertainty:\n",
|
||||
"\n",
|
||||
"1. Albert and Bernard are initially uncertain about the birthdate. *(Cheryl knows something they don't know.)*\n",
|
||||
"2. We (the puzzle solvers) don't know what Albert and Bernard were told. *(They know something we don't know.)*\n",
|
||||
"\n",
|
||||
"If Cheryl tells Albert \"May\", then he believes the birthdate could be either May 15, May 16, or May 19. We'll call `{'May 15', 'May 16', 'May 19'}` his **belief state** about the birthdate. We will say that a person **knows** the birthdate when they get down to a belief state with exactly one possibility. The second type of uncertainty is that we don't know that Albert was told \"May\", so we don't know his belief state. But we do know some statements about his belief state, and our task is to use those statements to solve the puzzle. "
|
||||
"We can define the idea of Cheryl having **told** someone a component of her birthdate, thus updating their belief state:"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -81,19 +80,18 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"BeliefState = set # A belief state is a set of possible beliefs; in this problem possible dates of Cheryl's birthday."
|
||||
"def told(part: str) -> BeliefState:\n",
|
||||
" \"\"\"Cheryl told a part of her birthdate to someone; return a belief state of possible dates.\"\"\"\n",
|
||||
" return {date for date in DATES if part in date}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"The way we will deal with our uncertainty as puzzle solvers is by considering each of the ten dates one at a time and reasoning as follows: \n",
|
||||
"- If this date were Cheryl's true birthdate, then we would know what Albert and Bernard were told: we would eliminate the second type of uncertainty, and we could figure out their belief states. \n",
|
||||
"- From that we could figure out if the statements are true (given this date). \n",
|
||||
"- If the puzzle is correct and we don't make mistakes, then there will be only one date that makes all the statements true; that's Cheryl's birthday.\n",
|
||||
"(*Note*: I dislike it that the function `told` uses the global constant `DATES`. But I can live with it.)\n",
|
||||
"\n",
|
||||
"We can define the idea of Cheryl having **told** someone a component of her birthdate, and the idea of **knowing** a birthdate as follows:"
|
||||
"Let's consider `'May 15'` as a possible birthdate. Cheryl tells Albert `'May'` and Bernard `'15'`, so they would have these belief states, and they would not *know* the birthday:"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -102,98 +100,29 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def told(part: str) -> BeliefState:\n",
|
||||
" \"\"\"Cheryl told a part of her birthdate to someone; return a belief state of possible dates.\"\"\"\n",
|
||||
" return {date for date in DATES if part in date}\n",
|
||||
"\n",
|
||||
"def know(beliefs: BeliefState) -> bool:\n",
|
||||
" \"\"\"A person `knows` the answer if their belief state has only one possibility.\"\"\"\n",
|
||||
" return len(beliefs) == 1"
|
||||
"assert told('May') == {'May 15', 'May 16', 'May 19'} # Albert's belief state\n",
|
||||
"assert told('15') == {'August 15', 'May 15'} # Bernard's belief state\n",
|
||||
"assert not know(told('May')) # Albert does not know\n",
|
||||
"assert not know(told('15')) # Bernard does not know"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"(Note: one thing I dislike about my code is that the function `told` uses the global `DATES`. Later we will see that the function `cheryls_birthday` does the same. For that to be an acceptable design choice, we need to think of `DATES` as a constant, not a variable.)\n",
|
||||
"\n",
|
||||
"Let's see what happens if we consider the date `'May 15'` as a possible birthday.\n",
|
||||
"\n",
|
||||
"First, Cheryl tells Albert `'May'` and Bernard `'15'`, giving them these belief states: "
|
||||
"Now consider `'June 18'`; in this case, Bernard would know."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"{'May 15', 'May 16', 'May 19'}"
|
||||
]
|
||||
},
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"told('May')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"{'August 15', 'May 15'}"
|
||||
]
|
||||
},
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"told('15')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"We can then check whether the various statements are true, given `'May 15'` . The first part of Albert's first statement is \"I don't know when Cheryl's birthday is.\" We can verify that that part of the statement is true, given that he was told the month:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"True"
|
||||
]
|
||||
},
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"not know(told('May'))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"If the rest of the statements work out to be true, then `'May 15'` would be a solution to the puzzle. If not, it must be one of the other dates."
|
||||
"assert told('June') == {'June 17', 'June 18'} # Albert's belief state\n",
|
||||
"assert told('18') == {'June 18'} # Bernard's belief state\n",
|
||||
"assert not know(told('June')) # Albert does not know\n",
|
||||
"assert know(told('18')) # Bernard DOES know"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -202,24 +131,46 @@
|
||||
"source": [
|
||||
"# Overall Strategy\n",
|
||||
"\n",
|
||||
"Here is the main function, `cheryls_birthday`, which computes the subset of dates in the global variable `DATES` that satisfy the statements made by Albert, Bernard, and Albert again. We will define a **statement** as a boolean function that takes a single date as input and returns true if the statement would be true in the condition that the given date is Cheryl's actual birthday. So a statement only has to consider one date at a time. But the code within a statement may have to consider belief states.\n",
|
||||
"Now we have to think really carefully about what we're doing. The puzzle is tricky because we're dealing with two types of uncertainty:\n",
|
||||
"\n",
|
||||
"The function `satisfy` takes a belief state (a set of dates) and some statements and returns the subset that satisfies all the statements."
|
||||
"1. Albert and Bernard are initially uncertain about the birthdate. *(Cheryl knows something they don't know.)*\n",
|
||||
"2. We (the puzzle solvers) don't know what Albert and Bernard were told. *(They know something we don't know.)*\n",
|
||||
"\n",
|
||||
"If Cheryl tells Albert that the month is \"May\", his belief state becomes {May 15, May 16, May 19}. But we the puzzle solvers don't know what month he was told. To deal with this we will consider each of the ten dates one at a time and reason as follows: \n",
|
||||
"- We know what Albert and Bernard were told; we have eliminated the second type of uncertainty. \n",
|
||||
"- We can thus figure out if Albert and Bernard's statements are true (given this date). \n",
|
||||
"- There should be only one date out of the ten that makes all the statements true; that's Cheryl's birthday.\n",
|
||||
"\n",
|
||||
"Here is the main function, `cheryls_birthday`, which computes the subset of possible dates that satisfy Albert and Bernard's statements. We will implement a **statement** as a boolean function that takes a single date as input and returns true if the statement would be true under the condition that the given date is Cheryl's actual birthday. (I will define the statements `albert1`, `bernard1`, and `albert2` a bit later)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def cheryls_birthday() -> BeliefState:\n",
|
||||
" \"\"\"Return a subset of the global `DATES` for which all three statements are true.\"\"\"\n",
|
||||
" return satisfy(DATES, albert1, bernard1, albert2)\n",
|
||||
"\n",
|
||||
" return satisfy(DATES, albert1, bernard1, albert2)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"The function `satisfy` takes a belief state (a set of dates) and some statements and returns the subset that satisfies all the statements:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def satisfy(beliefs: BeliefState, *statements) -> BeliefState:\n",
|
||||
" \"\"\"Return the subset of `beliefs` that satisfy all the statements.\"\"\"\n",
|
||||
" return {b for b in beliefs if all(statement(b) for statement in statements)}"
|
||||
" \"\"\"Return the subset of values in `beliefs` that satisfy all the statements.\"\"\"\n",
|
||||
" return {value for value in beliefs if all(statement(value) for statement in statements)}"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -233,39 +184,35 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"The function `albert1` takes as input a single possible birthdate and returns `True` if Albert's statement is true for that birthdate. How do we go from Albert's English statement to a Python function? Let's paraphrase it in a form that uses the concepts we have defined:\n",
|
||||
"Let's first rephrase this statement to use the concepts we have defined:\n",
|
||||
"\n",
|
||||
"**Albert**: *After Cheryl **told** me the **month** of her birthdate, my belief state is a set of dates such that I didn't **know** her birthday. And I know that Bernard does not know. How do I know that? I can see that for all the possible dates in my belief state, if Bernard was **told** the **day** of that date, he would **not know** Cheryl's birthday.*\n",
|
||||
"**Albert**: *After Cheryl **told** me the **month** of her birthdate, my **belief state** is a set of dates such that I didn't **know** her birthday. And I know that Bernard does not know. How do I know that? I can see that there are no possible dates that Bernard would **know** Cheryl's birthday if he was **told** the **day** of that date.*\n",
|
||||
"\n",
|
||||
"That I can translate directly into code:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def albert1(date) -> bool:\n",
|
||||
" \"\"\"Albert: I don't know when Cheryl's birthday is, and I know that Bernard does not know.\"\"\"\n",
|
||||
" dates = told(month(date))\n",
|
||||
" return not know(dates) and not satisfy(dates, bernard_knows)\n",
|
||||
"\n",
|
||||
"def bernard_knows(date) -> bool: \n",
|
||||
" \"\"\"Does Bernard know the birthday after being told the day?\"\"\"\n",
|
||||
" return know(told(day(date))) "
|
||||
" return not know(dates) and not satisfy(dates, lambda date: know(told(day(date))))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"We haven't solved the puzzle yet, but let's take a peek and see which dates satisfy Albert's statement:"
|
||||
"We haven't solved the puzzle yet, but let's take a peek and see which dates satisfy Albert's first statement:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -274,7 +221,7 @@
|
||||
"{'August 14', 'August 15', 'August 17', 'July 14', 'July 16'}"
|
||||
]
|
||||
},
|
||||
"execution_count": 10,
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@ -287,7 +234,7 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 4. Bernard: At first I don't know when Cheryl's birthday is, but I know now.\n",
|
||||
"## 4. Bernard: At first I didn't know when Cheryl's birthday is, but I know now.\n",
|
||||
"\n",
|
||||
"Again, a paraphrase:\n",
|
||||
"\n",
|
||||
@ -296,27 +243,27 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def bernard1(date) -> bool:\n",
|
||||
" \"Bernard: At first I don't know when Cheryl's birthday is, but I know now.\"\n",
|
||||
" at_first = told(day(date))\n",
|
||||
" after = satisfy(at_first, albert1)\n",
|
||||
" return not know(at_first) and know(after)"
|
||||
" now = satisfy(at_first, albert1)\n",
|
||||
" return not know(at_first) and know(now)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Let's see which dates satisfy both Albert and Bernard's statements:"
|
||||
"Let's see which dates satisfy the two statements:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"execution_count": 11,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -325,7 +272,7 @@
|
||||
"{'August 15', 'August 17', 'July 16'}"
|
||||
]
|
||||
},
|
||||
"execution_count": 12,
|
||||
"execution_count": 11,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@ -338,9 +285,9 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Wait a minute–I thought that Bernard **knew**?! Why are there three possible dates? \n",
|
||||
"Wait a minute–I thought that Bernard **knew**?! Why are there **three** possible dates? \n",
|
||||
"\n",
|
||||
"Bernard does indeed know; it is just that we, the puzzle solvers, don't know. That's because Bernard knows something we don't know: the day. If Bernard was told `'15'` then he would know `'August 15'`; if he was told `'17'` he would know `'August 17'`, and if he was told `'16'` he would know `'July 16'`. *We* don't know because we don't know which of these is the case. We'll need more information (coming in statement `albert2`) before *we* know.\n",
|
||||
"Bernard does indeed know; it is just that we, the puzzle solvers, don't know yet. That's because Bernard knows something we don't know: the day. If Bernard was told `'15'` then he would know `'August 15'`; if he was told `'17'` he would know `'August 17'`, and if he was told `'16'` he would know `'July 16'`. We'll need more information (coming in statement `albert2`) before *we* know.\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
@ -352,12 +299,12 @@
|
||||
"\n",
|
||||
"A paraphrase:\n",
|
||||
"\n",
|
||||
"**Albert**: *After being told the month and heaaring Bernard's statement, I now know Cheryl's birthday/*"
|
||||
"**Albert**: *After being **told** the **month** and hearing Bernard's **statement**, I now **know** Cheryl's birthday.*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 13,
|
||||
"execution_count": 12,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -377,7 +324,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 14,
|
||||
"execution_count": 13,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -386,7 +333,7 @@
|
||||
"{'July 16'}"
|
||||
]
|
||||
},
|
||||
"execution_count": 14,
|
||||
"execution_count": 13,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@ -399,27 +346,16 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"**Success!** We have deduced that Cheryl's birthday is **July 16**. It is now `True` that we know Cheryl's birthday:"
|
||||
"**Success!** We have deduced that Cheryl's birthday is **July 16**. We know Cheryl's birthday:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 15,
|
||||
"execution_count": 14,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"True"
|
||||
]
|
||||
},
|
||||
"execution_count": 15,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"know(cheryls_birthday())"
|
||||
"assert know(cheryls_birthday())"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -440,12 +376,12 @@
|
||||
"6. Alice responds “Now I do as well!”\n",
|
||||
"7. When is Steve’s bus?\n",
|
||||
"\n",
|
||||
"Upon closer inspection, not only is it a similar format, it is **exactly** the same puzzle, except that months are changed to hours and days to minutes. If we rewrite the times in the same format as `DATES`, we can solve the problem without writing a single line of new code:"
|
||||
"Upon closer inspection, not only is it a similar format, it is **exactly** the same puzzle, except that months are changed to hours and days to minutes. If we change the colons in the times to spaces, we can solve the problem without changing the `cheryls_birthday` function:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"execution_count": 15,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -454,15 +390,13 @@
|
||||
"{'08 32'}"
|
||||
]
|
||||
},
|
||||
"execution_count": 16,
|
||||
"execution_count": 15,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"times = {'06:32', '06:43', '06:50', '07:17', '07:46', '08:19', '08:32', '09:17', '09:19', '09:50'}\n",
|
||||
"DATES = {time.replace(':', ' ') for time in times}\n",
|
||||
"\n",
|
||||
"DATES = '06:32, 06:43, 06:50, 07:17, 07:46, 08:19, 08:32, 09:17, 09:19, 09:50'.replace(':', ' ').split(', ')\n",
|
||||
"cheryls_birthday()"
|
||||
]
|
||||
},
|
||||
@ -481,12 +415,12 @@
|
||||
"\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"Again, we can solve this problem just by changing the format of `DATES`:"
|
||||
"Again, we can solve this problem just by changing the global variable `DATES`:"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 17,
|
||||
"execution_count": 16,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -495,14 +429,13 @@
|
||||
"{'C 3'}"
|
||||
]
|
||||
},
|
||||
"execution_count": 17,
|
||||
"execution_count": 16,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"pads = {'A2', 'A3', 'A6', 'B4', 'B5', 'C1', 'C3', 'D1', 'D2', 'D4'}\n",
|
||||
"DATES = {' '.join(pad) for pad in pads}\n",
|
||||
"DATES = {'A 2', 'A 3', 'A 6', 'B 4', 'B 5', 'C 1', 'C 3', 'D 1', 'D 2', 'D 4'}\n",
|
||||
"\n",
|
||||
"cheryls_birthday()"
|
||||
]
|
||||
@ -511,7 +444,9 @@
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Mad scientist Cheryl was refering to pad C3. (But may I point out that this Cheryl is not actually a mad scientist, just a [mad engineer](https://www.evilmadscientist.com/2015/evil-mad-engineers/). A true mad scientist would kill 25 people and use the other 25 as a control group.)"
|
||||
"The corret pad is \"C 3\". \n",
|
||||
"\n",
|
||||
"(But may I point out that this Cheryl is not actually a mad scientist, just a [mad engineer](https://www.evilmadscientist.com/2015/evil-mad-engineers/). A true mad scientist would kill 25 people and use the other 25 as a control group.)"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user