Jekyll2018-07-01T23:29:33-07:00http://aaron.niskin.org/Aaron Niskin’s BlogNot just another mathy blog! Now with more... Aaron!amniskinLet’s talk Homotopy and Algebra2018-06-29T00:00:00-07:002018-06-29T00:00:00-07:00http://aaron.niskin.org/blog/2018/06/29/homotopy<p>So this post is going to be a bit more terse than most. In fact, the objective of this post will be to develop the theory of Homotopy very briefly, with the goal of proving the Fundamental Theorem of Algebra.</p>
<h1 id="homotopy">Homotopy</h1>
<p>Given two continuous maps \(f,g : \mathbb{R}^n\to\mathbb{R}m\), a homotopy between \(f,\) and $g$ is a continuous map $h: \mathbb{I}\times\mathbb{R}^n\to\mathbb{R}^m$ such that $h(0,x)=f(x)$ and $h(1,x) = g(x)$. Basically it’s a continuous deformation of one map into the other. It’s a bit stronger than just homeomorphism of topological spaces. You can see this because two interlocked rings are topologically homeomorphic to non-interlocked rings, but they’re not homotopic because you’d have to split one of the rings.</p>
<p>Enough of all that! Let’s get to the proof already!</p>
<h1 id="the-fundamental-theorem-of-algebra">The Fundamental Theorem of Algebra</h1>
<h3 id="the-statement">The statement</h3>
<p><em>If $p\in\mathbb{C}[x]$ is a non-constant polynomial, then it has at least one root in $\mathbb{C}$.</em></p>
<p>A consequence of this theorem is that any non-constant polynomial over $\mathbb{C}$ has all of its roots in $\mathbb{C}$. Or equivalently, any polynomial of degree $n$ over $\mathbb{C}$ has $n$ roots in $\mathbb{C}$.</p>
<h3 id="the-proof">The proof</h3>
<p>Let $p(x) = \sum\limits_{i=1}^n a_i x^i \in\mathbb{C}[x]$ be a polynomial without any roots in $\mathbb{C}$. For simplicity, we assume that the leading coefficient is 1. There is no loss of generality in doing so. We then define a function</p>
<script type="math/tex; mode=display">f_r(s) = \frac{ p(re^{2\pi is}) / p(r)}{ \|p(re^{2\pi is}) / p(r)\| }</script>
<p>Then for each $r$ in $\mathbb{C}$, $f_r:\mathbb{C}\to S^1$ is a map from $\mathbb{C}$ to $S^1$. Furthermore, given $r_0,r_1\in\mathbb{C}$, we can define a homotopy from $f_{r_0}$ to $f_{r_1}$ as $g(t,s) = f_{r_0+t(r_1-r_0)}(s)$. So for all $r\in\mathbb{C}$, $f_r$ is homotopic to $f_0$. Since $f_0(s) = 1$ for all $s\in\mathbb{C}$, we have that $f_r$ are all in the same homotopy class as the constant function on $S^1$.</p>
<p>We now pick $z,r$ such that $|z| = r \gt \max(1,\sum |a_i| )$. We then note that Cauchy-Schwarz gives us the following:</p>
<script type="math/tex; mode=display">% <![CDATA[
\begin{align}
\|z\|^n =& \|z\|\cdot \|z\|^{n-1}\\\\\\
>& (\sum\|a_i\|)\|z\|^{n-1}\\\\\\
=& (\sum\|a_i\|\|z\|^{n-1})\\\\\\
>=& (\sum\|a_iz^{n-1}\|)\\\\\\
>& (\sum\|a_iz^i\|)
\end{align} %]]></script>
<p>Which means $|z^n - \sum a_i z^i \neq 0|$. So, we can define yet another function $q(t,z) = z^n +t(\sum\limits_{i=1}^{n-1}a_iz^i)$. Then $q$ is a homotopy between $z^n$ and $p(z)$. We now note that when $t=1$, if we make a similar construction to $f_r$ but with this parameterized polynomial instead of $p$, we get a homotopy between $f_r$ and just going around the circle $n$ times (with $t=0$). But since $f_r$ is homotopic to a point on $S^1$, and going around the circle any non-zero number of times is not homotopic to a point, we know that $n=0$.</p>
<p>So the only polynomials without roots in $\mathbb{C}$ are constant.</p>
<p>Kinda cool, huh?</p>
<p>This proof was courtesy of <em>Algebraic Topology</em> by Allen Hatcher.</p>Aaron NiskinJust a little dip into homotopy via the Fundamental Theorem of AlgebraGetting across the river2018-06-26T00:00:00-07:002018-06-26T00:00:00-07:00http://aaron.niskin.org/blog/2018/06/26/hares-and-rivers<h2 id="part-1">Part 1</h2>
<h3 id="foxes-rabbits-and-lechuga">Foxes, Rabbits, and Lechuga</h3>
<p>You stand at the edge of a riverbed with your pet fox, a pet rabbit, and a head of lettuce. You need to cross the river, but can only take one of the three with you each time you cross. If the fox is ever left unsupervised with the rabbit (s)he’ll eat it, and the same for the rabbit and the head of lettuce.</p>
<p>Just to clarify what you know:</p>
<ul>
<li>You have a fox, rabbit, and a head of lettuce</li>
<li>The fox will eat the rabbit, and the rabbit will eat the lettuce (if given the opportunity)</li>
<li>You can only take one across at a time</li>
</ul>
<p>How can you get all three to the other side of the river without any of them getting eaten?</p>
<h3 id="solution">Solution:</h3>
<div class="hint">
<p>First let’s define the sides as $A$ and $B$ (we’re on side $A$).</p>
<ol>
<li>Take the rabbit to side $B$ (the fox is left with the lettuce on side $A$, but that’s okay)</li>
<li>Go back to side $A$ without anything in the boat.</li>
<li>Take the fox to side $B$</li>
<li>Go back to $A$ with the rabbit</li>
<li>Take the lettuce to side $B$</li>
<li>Go back alone</li>
<li>Take the rabbit to side $B$</li>
<li>Profit heavily</li>
</ol>
</div>
<h2 id="part-2">Part 2</h2>
<h3 id="pesky-children-and-over-protective-parents">Pesky children and over-protective parents</h3>
<h4 id="this-riddle-is-courtesy-of-tazo-lezhava">This riddle is courtesy of Tazo Lezhava</h4>
<p>Now 5 cannibalistic parents stand on the edge of a riverbed each with their first-born child. These parents are very over-protective and won’t let their kids be with any of the other parents if they’re not there as well. There is a boat that can take 3 people at a time. How do they use that boat to get all 10 people (the 5 cannibalistic parents and their first-borns) to the other side of the river without any kids getting eaten?</p>
<h3 id="solution-1">Solution:</h3>
<h4 id="solution-courtesy-of-andrew-robinson">Solution courtesy of Andrew Robinson</h4>
<div class="hint">
<p>Again, let’s call them sides $A$ and $B$, and we’re on $A$. Let’s also call the children be denoted by the numbers $1,2,3,4,5$, and the parents by the letters $a,b,c,d,e$, where $a$ is $1$’s parent and so on.</p>
<table>
<thead>
<tr>
<th style="text-align: center">move</th>
<th style="text-align: center">side $A$</th>
<th style="text-align: center">side $B$</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center"> </td>
<td style="text-align: center">$1,2,3,4,5,a,b,c,d,e$</td>
<td style="text-align: center">$\emptyset$</td>
</tr>
<tr>
<td style="text-align: center">$\rightarrow 1,2,3$</td>
<td style="text-align: center">$4,5,a,b,c,d,e$</td>
<td style="text-align: center">$1,2,3$</td>
</tr>
<tr>
<td style="text-align: center">$\leftarrow 3$</td>
<td style="text-align: center">$3,4,5,a,b,c,d,e$</td>
<td style="text-align: center">$1,2$</td>
</tr>
<tr>
<td style="text-align: center">$\rightarrow 3,4$</td>
<td style="text-align: center">$5,a,b,c,d,e$</td>
<td style="text-align: center">$1,2,3,4$</td>
</tr>
<tr>
<td style="text-align: center">$\leftarrow 4$</td>
<td style="text-align: center">$4,5,a,b,c,d,e$</td>
<td style="text-align: center">$1,2,3$</td>
</tr>
<tr>
<td style="text-align: center">$\rightarrow a,b,c$</td>
<td style="text-align: center">$4,5,d,e$</td>
<td style="text-align: center">$1,2,3,a,b,c$</td>
</tr>
<tr>
<td style="text-align: center">$\leftarrow 3,c$</td>
<td style="text-align: center">$3,4,5,c,d,e$</td>
<td style="text-align: center">$1,2,a,b$</td>
</tr>
<tr>
<td style="text-align: center">$\rightarrow c,d,e$</td>
<td style="text-align: center">$3,4,5$</td>
<td style="text-align: center">$1,2,a,b,c,d,e$</td>
</tr>
<tr>
<td style="text-align: center">$\leftarrow 2$</td>
<td style="text-align: center">$2,3,4,5$</td>
<td style="text-align: center">$1,a,b,c,d,e$</td>
</tr>
<tr>
<td style="text-align: center">$\rightarrow 2,3,4$</td>
<td style="text-align: center">$5$</td>
<td style="text-align: center">$1,2,3,4,a,b,c,d,e$</td>
</tr>
<tr>
<td style="text-align: center">$\leftarrow 4$</td>
<td style="text-align: center">$4,5$</td>
<td style="text-align: center">$1,2,3,a,b,c,d,e$</td>
</tr>
<tr>
<td style="text-align: center">$\rightarrow 4,5$</td>
<td style="text-align: center">$\emptyset$</td>
<td style="text-align: center">$1,2,3,4,5,a,b,c,d,e$</td>
</tr>
</tbody>
</table>
<p>And we’re done. This is a pretty confusing way to show it, but with that many moving pieces, there aren’t too many great ways to visualize this. At least none that I know of.</p>
</div>Aaron NiskinThe river-crosser's union problem set \#1Boys in the hood2018-06-24T00:00:00-07:002018-06-24T00:00:00-07:00http://aaron.niskin.org/blog/2018/06/24/boys-in-the-hood<p>This post is really several riddles that get progressively more difficult. So don’t be dissuaded if you find the first few too easy (or if you don’t).</p>
<h2 id="baby-crazy">Baby crazy</h2>
<p>Let’s say we know a person named Pat who has two kids and at least one is a boy. Assuming that across the population the probability of having a boy is 50%. What is the probability that the other kid is a boy as well?</p>
<div class="hint">
<p>It’s 1/3 (or $33.\bar3$%). To see this, let’s just work out the possible states (the following states will be written as younger,older):</p>
<ul>
<li>B,B</li>
<li>B,G</li>
<li>G,B</li>
<li>G,G</li>
</ul>
<p>But since we know G,G is not a possibility (because Pat has at least one boy), and only one of the other three have the other child being a boy.</p>
<p>This might be easier to see and believe if you consider this using coin flips.</p>
</div>
<h2 id="to-make-things-a-little-more-difficult-as-babies-often-do">To make things a little more difficult (as babies often do),</h2>
<p>What’s the probability for an arbitrary probability $p$ of having a boy?</p>
<h3 id="solution">Solution</h3>
<div class="hint">
<p>We have the same states as before, but let’s first define some things to help us out:</p>
<p>\[
\begin{align}
BG=& \mathbb{P}(\text{boy})\cdot \mathbb{P}(\text{girl}) & GB=& \mathbb{P}(\text{girl})\cdot \mathbb{P}(\text{boy}) & BB=&\mathbb{P}(\text{boy})\cdot \mathbb{P}(\text{boy}) \\<br />
=& p(1-p) & =& (1-p)p & =& p^2
\end{align}
\]</p>
<p>now the probability is:</p>
<p>\[
\begin{align}
\frac{BB}{BG + GB + BB} =& \frac{p^2}{p(1-p) + (1-p)p + p^2} \\<br />
=&\frac{p}{2(1-p)+p} = \frac{p}{2-p}
\end{align}
\]</p>
<p>In particular, if $p=0.5$, we get</p>
<p>\[
\begin{align}
\frac{p}{2(1-p)+p} = \frac{p}{2-p} =& \frac{0.5}{2-0.5} \\<br />
\frac{0.5}{1.5} = \frac{1}{3}
\end{align}
\]</p>
<p>And just because I apparently like(?) making graphs…
<img src="/assets/pics/2018/06/24_expPlot.png" alt="percentage plot" /></p>
<p>In case you’re eager to see the like 5 lines of code that went into making that graph, the notebook can be downloaded <a href="/assets/notebooks/2018/06/24_boys-in-the-hood.ipynb">here</a>.</p>
</div>
<h2 id="what-if-we-know-that-the-older-child-is-a-boy">What if we know that the older child is a boy?</h2>
<div class="hint">
<p>The whole paradoxical part of the problem goes away once we know the position of the known sex baby. By that I mean that the only possible states are:</p>
<ul>
<li>G,B</li>
<li>B,B</li>
</ul>
<p>So it’s 50/50.</p>
</div>
<h2 id="what-if-i-told-you-that-pat-has-2-kids-and-one-is-a-boy-born-in-summer">What if I told you that Pat has 2 kids, and one is a boy born in summer?</h2>
<div class="hint">
<p>This is where it gets a little tricky. The states are now:</p>
<p>far too many to list. But, basically, it’s</p>
<p>\[
B\cdot{1 \text{ seasons}}, G\cdot{4 \text{ seasons}} \\<br />
G\cdot{4 \text{ seasons}}, B\cdot{1 \text{ seasons}} \\<br />
B\cdot{3 \text{ seasons}}, B\cdot{1 \text{ seasons}} \\<br />
B\cdot{1 \text{ seasons}}, B\cdot{4 \text{ seasons}}
\]</p>
<p>Note that we’re not double counting the case where both are boys born in summer.</p>
<p>So there are a total of 15 possible outcomes, and 7 of them have a boy as the second child. So it’s \(\frac{7}{15}\).</p>
</div>
<h2 id="what-if-we-only-know-that-one-child-is-a-boy-born-on-december-23rd">What if we only know that one child is a boy born on December 23rd?</h2>
<p>Or we could consider something a bit more general with probability \(q\).</p>
<h3 id="solution-1">Solution</h3>
<div class="hint">
<p>We’re still assuming the probability of having a boy is $p$.</p>
<p>Then we can describe our exact table above like so:</p>
<p>\[
\begin{align}
\mathbb{P}(B\cdot{1 \text{ seasons}}, G\cdot{4 \text{ seasons}}) =& pq(1-p) & =& pq(1-p) \\<br />
\mathbb{P}(G\cdot{4 \text{ seasons}}, B\cdot{1 \text{ seasons}}) =& (1-p)pq & =& pq(1-p) \\<br />
\mathbb{P}(B\cdot{3 \text{ seasons}}, B\cdot{1 \text{ seasons}}) =& p(1-q)pq & =& p^2q(1-q) \\<br />
\mathbb{P}(B\cdot{1 \text{ seasons}}, B\cdot{4 \text{ seasons}}) =& pqp & =& p^2q
\end{align}
\]</p>
<p>So we have:</p>
<p>\[
\begin{align}
\mathbb{P} =& \frac{p^2q(1-q) + p^2q}{p^2q+p^2q(1-q) + 2pq(1-p)} \\<br />
=& \frac{pq\left(p(1-q) + p\right)}{pq\left(p+p(1-q)+2(1-p)\right)} \\<br />
=& \frac{p(1-q) + p}{p+p(1-q)+2(1-p)} \\<br />
=& \frac{p(2-q)}{2-pq}
\end{align}
\]</p>
<p>And we can see, as \(q\to0\), \(\mathbb{P}\to p\), and as \(q\to1\), \(\mathbb{P}\to \frac{p}{2-p}\)</p>
<p>The closest thing I can give toward intuition here is this: let’s take the boy-in-summer example, and assume there’s a 25% chance of being born in summer. Then our universe of possibilities is restricting the known child to 1/4 of the possibilities otherwise, but there is no such restriction on the other child. So in that way, it’s in a sense down-weighting the effect of the known child (by scaling up all of the other possibilities).</p>
</div>Aaron NiskinWhat's the probability the other one is a boy?About the riddles category2018-06-24T00:00:00-07:002018-06-24T00:00:00-07:00http://aaron.niskin.org/blog/2018/06/24/about-riddles<p>Far too many riddles are exceedingly lame. Scenarios like “John is twice as old as Julia, and 5 years older than Tim, how old is Sally?” are really just super lame and uninteresting. They’re work, not play. It’s not even that they’re difficult; it’s just that they’re annoying. You just write it down and it’s very basic linear algebra. Every time.</p>
<p>So for that reason, you will not find any of these atrocities on this site. This site will be exclusively for riddles I find to be fun.</p>
<p>I also won’t be posting riddles that start out with a lie as the premise. So there are no tricks nor gimmicks to the riddles I’ll be posting here.</p>
<p>And finally, I won’t be posting riddles like “what stands on four legs in the morning, two in the afternoon, and three in the evening?” Not for any real reason; I just don’t want to.</p>
<p>That’s all until one day I do. It’s my site, I do what I want!</p>
<p>If you have any riddles you think are cool, please send them to <a href="mailto:aaron@niskin.org">me</a>! I love riddles.</p>Aaron NiskinIn a world filled with lame riddles, where can you find good ones?!\(n\) people on a plane2018-06-10T00:00:00-07:002018-06-10T00:00:00-07:00http://aaron.niskin.org/blog/2018/06/10/n_people_on_a_plane<h2 id="the-scenario">The scenario:</h2>
<p>\(n\) people are in line ready to board a full plane (so \(n\) people in \(n\) seats). The first person in line lost his boarding pass, so he just sits in any random old seat (but specifically not his own). From then on, the people boarding are so nice that they won’t confront someone sitting in their respective seats; instead, they’ll just take a random empty one. What’s the probability that the last person gets to sit in his or her own seat?</p>
<p>What you know:</p>
<ol>
<li>There are \(n\) seats on the plane</li>
<li>There are \(n\) passengers about to board the plane</li>
<li>The first passenger sits in the wrong seat</li>
<li>Every passenger after sits in his/her own seat if it’s available</li>
<li>Every passenger sits in a random available seat if his/her seat is not available.</li>
</ol>
<p>You need to find out what the probability that the last person gets to sit in his/her own seat.</p>
<h3 id="hints-click-to-unblur">Hints (click to unblur)</h3>
<ol>
<li>
<p class="hint">It might be best to start with the base case (\(n\) = 3)</p>
</li>
<li>
<p class="hint">What if the first person sat in a totally random seat (instead of specifically not his own)?</p>
</li>
</ol>
<h2 id="a-solution">A solution</h2>
<h3 id="a-description">A description</h3>
<p class="hint">\[ \mathbb{P}\left(\cdot | n\right) = \frac{n-2}{2(n-1)} \]</p>
<h3 id="the-strategy">The strategy</h3>
<div class="hint">
<p>Firstly, if \(n = 1\), the game is ill defined, if \(n=2\), the probability is 0 (because the first person always takes the wrong seat). If \(n>2\), then:</p>
<p>There’s a \(\frac{1}{n-1}\) chance that the first person takes the last person’s seat, thereby sealing the eternal aerial fate of the last boarder. So there’s a \(\frac{n-2}{n-1}\) chance that the first jerk doesn’t take the last shlemazel’s seat. Every person after that either sits in their own seat (thereby not changing the odds for our lone hero of the skies), or sits in a random seat. When sitting in a random seat, they either:</p>
<ol>
<li>Sit in the first person’s seat thereby closing the book on this whole debacle, assuring the vacancy of the posterior protector for our helpless late-boarder.</li>
<li>They sit in the last person’s seat, thereby ensuring their own place in hell along with our hero’s long lost comfort that only comes from sitting in your very own assigned seat.</li>
<li>Or they sit in someone else’s seat, thereby passing the buck on to someone else and not changing the results at all.</li>
</ol>
<p>So, there’s a 50/50 shot (once we get past the first person, and assuming \(n>2\)).</p>
<p>To summarize: there’s a \(\frac{n-1}{n-2}\) probability that the last person’s seat is open after the first person takes a seat, then every turn after that has an equal probability of ending the game in a positive or a negative way. So the end formula is
\[ \mathbb{P}\left(\cdot | n\right) = \frac{n-2}{n-1}\cdot\frac{1}{2} = \frac{n-2}{2(n-1)} \]</p>
</div>
<h3 id="the-experiment">The experiment</h3>
<p class="hint">I wrote a little python script that can be downloaded <a href="/assets/notebooks/2018/06/10_airplane_riddle.ipynb">here</a>. I essentially played this game 10,000 times for each \(n\) between 3 and 100, then plotted the mean for a particular \(n\) vs that \(n\), along with our theoretical value derived kinda loosely above.
<img src="/assets/pics/2018/06/10_percentagePlot.png" alt="percentage plot" /></p>Aaron NiskinIn a world of seat stealing curmudgeons, will you get yours?!The Monty Hall Problem2018-06-03T00:00:00-07:002018-06-03T00:00:00-07:00http://aaron.niskin.org/blog/2018/06/03/monty_hall<h2 id="the-scenario">The scenario:</h2>
<p>You’re on a game show and they show you three doors (they’re all shut). They tell you behind two of these doors are goats, and behind one of them is a brand new car! They say you get to pick one door, then they’ll open up one of the remaining doors to reveal a goat, then ask you if you want to change your choice. What do you say?</p>
<p>What you know:</p>
<ol>
<li>There are three doors</li>
<li>Only one has the prize</li>
<li>All doors have equal probability at the onset</li>
<li>You choose one door</li>
<li>The host shows a goat behind one of the other doors</li>
<li>You’re asked if you want to change your choice to the last remaining door</li>
</ol>
<h3 id="hints-click-to-unblur">Hints (click to unblur)</h3>
<ol>
<li>
<p class="hint">Just work out the probabilities</p>
</li>
<li>
<p class="hint">Think of the microstates</p>
</li>
</ol>
<h2 id="a-solution">A solution</h2>
<h3 id="a-strategy">A Strategy</h3>
<p class="hint">You do switch. The door you picked only has 1/3 probability of having the prize while the other door has 2/3 probability.</p>
<h3 id="a-description">A Description</h3>
<p class="hint">Let’s pretend like there are two different games: one where you pick one door and no chance to change your mind, and one where you pick two doors and if the car is behind either one you win. Obviously the first has a 1/3 probability and the second has a 2/3 probability of success. You can think of the strategy where you don’t switch as playing the first game and the one where you do switch as playing the second game. In the switching strategy, the first door you pick will never be the one you end with, so really, you’re not picking that door as much as you’re picking the other two and letting the host weed one out. At the end of the day, though, if you play with the switching strategy, then if the prize is behind either of the two doors you picked, you win! So it’s a 2/3 probability if you switch.</p>Aaron NiskinThe infamous Monty Hall! You're on a gameshow with three doors, two have goats and one has a brand new car! What will you win?!Prisoners and The Lightblub2018-06-02T00:00:00-07:002018-06-02T00:00:00-07:00http://aaron.niskin.org/blog/2018/06/02/prisoner_lightbulb<h2 id="the-scenario">The scenario:</h2>
<p>One day, a drunk warden waltzes into her prison feeling particularly sadistic and decides to put on a little show for herself. She told her guards to gather 100 prisoners into a room so that she could talk to them. When in front of the group of prisoners, she tells them of her plan: All of their prison sentences have been extended indefinitely, but they have a chance to earn their freedom – through her game.</p>
<p>She explained that she arranged for a room to be secured and left with just a single light bulb inside and that nobody but them would be allowed inside. They would then be brought into the room one prisoner per day and allowed to turn the light on or off. It’s guaranteed that nobody else would be given access to the room other than themselves, and that in no way would anyone mess with the light.</p>
<p>They were told that at any time, anyone could come forward and say “I believe all prisoners has been in the room” if they believe it, and if it’s true, all the prisoners go free. If the prisoner says the phrase and it’s not true, they all are killed by firing squad.</p>
<p>Now, you can’t just say the phrase on the 100th day – I mean, you could, but it probably wouldn’t work because the prisoners can be sent in multiple times.</p>
<p>What you know:</p>
<ol>
<li>There are 100 prisoners</li>
<li>There is a room with a light bulb that only these prisoners have access to</li>
<li>They can really only communicate through this light bulb</li>
<li>At any time, any one of them can stop the game, and if all prisoners have been in the room with the light, they go free. If not all prisoners have been in that room, then they all lose the game (or get killed, or the warden steps on their pet bunny or something – something negative happens).</li>
</ol>
<p>What’s your strategy?</p>
<h3 id="hints-click-to-unblur">Hints (click to unblur)</h3>
<ol>
<li>
<p class="hint">There’s a non-zero probability (assuming the choice of prisoner is random) that it’s 100,000 years before all prisoners go into that room. So don’t try to find a perfect solution. Just any solution will work.</p>
</li>
<li>
<p class="hint">If you haven’t found any solutions, how about putting one prisoner in charge?</p>
</li>
</ol>
<h3 id="some-solutions">Some Solutions</h3>
<h4 id="solution-1">Solution 1</h4>
<div class="hint">
<p>You can put one prisoner in charge and only allow that prisoner to ever turn off the light. Then, whenever anyone else gets in the room, if the light is off and they’ve never turned it on before, turn it on; otherwise, just leave it be. The chosen prisoner ends the game when he or she turns the light off for the 99th time.</p>
<p>That solution is okay, but not great. It gets the job done, but it’ll take forever.</p>
</div>
<h4 id="solution-2">Solution 2</h4>
<div class="hint">
<p>My favorite solution is kinda complicated, but it’s really cool…</p>
<p>So, you pick a number, say, 10. Then, you say make the following rules:</p>
<ul>
<li>You assign a notion of “value” to a light-bulb.
<ul>
<li>For the first ten days, a light bulb is said to have a value of 1.</li>
<li>Then every ten days after that, the value doubles, until it gets to 64</li>
<li>After 64, it goes back to 1.</li>
</ul>
</li>
<li>Everybody keeps a record in their own respective cells of the value they currently have.</li>
<li>When a prisoner enters the room, if the light is on, the prisoner turns it off and adds the current day’s value to their own.
<ul>
<li>Then, the prisoner writes out the value they have in binary.</li>
<li>The value of the light bulb progresses to the next day’s value, let’s call it \(\lambda\).</li>
<li>If the prisoner has a “1” in the \(\lambda\) place of the binary description of his or her own value, they turn on the light and decrease their own value by \(\lambda\).</li>
</ul>
</li>
</ul>
<p>So, for example, let’s pick 10 as our number of days per value thing. Then if today is the 9th day in the full cycle, then today’s value is 1 (and so is tomorrow’s). So if the light is on when I get in, I turn it off and increment my value. Let’s assume the light is on and I have a value of 20 (or 0010100, in our description). Then I turn off the light and find that I have a value of 21. Since tomorrow’s value is 1, and my binary description is 0010101, I return that point and turn on the light bulb, leaving me with 0010100. If on the other hand, it had been the tenth day and tomorrow’s value were 2, since I’d have a 0 in the 2’s place, I’d keep the point.</p>
<p>The reason I find this solution so interesting is, it really gets to the core of money and value. In this case, the light is only twice as valuable on day 11 as it is on day 10 because we agree to artificially make it so, but as long as we’re doing that, the results are astounding and very real.</p>
<p>Also, this is a completely decentralized solution! Come on, that’s amazing!</p>
</div>Aaron NiskinA group of prisoners encounter an evil warden and his sadistic lightbulb. Who will win?The blue-eyed reconing!2018-06-02T00:00:00-07:002018-06-02T00:00:00-07:00http://aaron.niskin.org/blog/2018/06/02/blue_eyed_people<h2 id="the-scenario">The scenario:</h2>
<p>There’s an island far away from anything we would call recognizable with a particularly strange custom: in this town, any person who discovers his or her own eye color is compelled to go to the town square at 9:00AM the following morning and kill him or her self publicly, so it goes. It’s a part of their lives and they all obey this custom diligently.</p>
<p>This island is so secluded that the inhabitants had not seen an outsider until the one fateful day Pat stopped by. On that day, they were so excited to see an outsider that they asked Pat to give a speech in front of the whole town. Not knowing the town’s customs, in Pat’s opening remarks, Pat mentioned, “it’s nice to see other blue eyed people out here”. The question is: what happens?</p>
<p>What you know:</p>
<ol>
<li>The town is very secluded and hasn’t seen any outsiders before</li>
<li>The town has the custom that they kill themselves when they find out their own eye color, so it goes.</li>
<li>A newcomer casually mentions in front of the whole town “it’s nice to see other blue eyed people here”</li>
</ol>
<p>What happens?</p>
<h3 id="hints-click-to-unblur">Hints (click to unblur)</h3>
<ol>
<li>
<p class="hint">Think inductively</p>
</li>
<li>
<p class="hint">This is kinda a repeat (sorry for that) but start with the case where there’s only 1 blue eyed person, then go from there.</p>
</li>
</ol>
<h2 id="a-solution">A solution</h2>
<h3 id="the-solution">The Solution</h3>
<p class="hint">If there are \(n\) many blue eyed people in the town (assuming blue eyed people are the minority), then on the \(n^\text{th}\) days, all the blue eyed people kill themselves, so it goes.</p>
<h3 id="the-explanation">The Explanation</h3>
<div class="hint">
<div>
<p>If there is only 1 blue eyed person, then (s)he looks around after the speaker leaves and says, “there are no blue eyed people here!”, then quickly realizes that (s)he must be the only blue eyed person and (s)he goes to the town square the next day and commits suicide, so it goes.</p>
<p>If there are \(n+1\) many blue eyed people, then each looks around and sees only \(n\) and therefore concludes that \(n\) days from now all of those poor bastards are going to kill themselves, so it goes. But then the \(n^\text{th}\) day comes and none of them commit suicide (because they each think they’re not blue eyed, but the other \(n\) are). Then they each come to the conclusion that there must be another blue-eyed person around, and since they don’t see one, they each conclude that it’s themself. So on the \(n+1^\text{th}\) day, they all go to the town square, so it goes.</p>
</div>
</div>Aaron NiskinIn a world of blue eyed and brown eyed people, it's dangerous to know your own eye color.The 7 person game-show riddle2018-06-02T00:00:00-07:002018-06-02T00:00:00-07:00http://aaron.niskin.org/blog/2018/06/02/7_friends<h2 id="the-scenario">The scenario:</h2>
<p>You and six of your friends are going on a game show. When you get there, you’ll be placed in a green room and told the rules of the game so that you all can strategize. Once you all agree on a strategy, you’ll be taken on stage where you’ll each be put in your own respective isolation chambers. Once your whole team is in their respective chambers, you will each be assigned a number between 1 and 7 (inclusive and possibly repeating). You’ll all be shown everyone else’s numbers, but not your own. Your whole team wins if any one member can guess his or her own number correctly.</p>
<p>What you know:</p>
<ol>
<li>Each member of your team is assigned a number between 1 and 7 inclusive and possibly repeating.</li>
<li>Each member gets only one guess.</li>
<li>There’s no penalty for wrong guesses.</li>
<li>There’s absolutely no communication between members while the game is on.</li>
<li>You all win if at least one person from your team guesses correctly.</li>
</ol>
<p>Can you come up with a winning strategy?</p>
<h3 id="hints-click-to-unblur">Hints (click to unblur)</h3>
<ol>
<li>
<p class="hint">Start with a simpler case (like only 2 players, then 3 players, etc.)</p>
</li>
<li>
<p class="hint">Consider what is conserved.</p>
</li>
<li>
<p class="hint">Consider modular arithmetic</p>
</li>
</ol>
<h2 id="a-solution">A solution</h2>
<h3 id="a-description">A description</h3>
<p class="hint">Regardless of who’s looking at the numbers, the sum of all the numbers (including your own) must be the same. The problem is that you don’t know what the missing number is (your own). But, if we make an assumption as to what the sum is, we could then solve for our own. But that leaves too many options (we could assume that the sum would be 7 or 49 or anything between). Luckily we don’t need all of that information. We really only need to assume something about what the sum is mod 7. For instance, if you knew that the sum of all the numbers was \(3 \pmod 7\), and you see the numbers 1, 2, 3, 4, 5, 6, (the sum of which is \(21 \equiv 0 \pmod 7\)), you would know that your number is 3. But that assumes that you know what the sum is (mod 7). Luckily you have a total of 7 people on your team!</p>
<h3 id="the-strategy">The strategy</h3>
<p class="hint">In the green room you assign a number from 1 to 7 (inclusive and not repeating) to each person in your team. So each person has a number and all numbers from 1 to 7 are represented. Then you all go into your respective isolation chambers and get your numbers and solve for your own assuming the sum mod 7 is whatever number you were assigned. Since the sum must be something from 1 to 7 mod 7, we know one person had the correct assumption, and since given the assumption, the solution is unique, we know one person will guess his or her own number correctly. And we’re done!</p>Aaron NiskinYou and 7 friends are assigned numbers from 1-7 and you have to guess your own2 ropes and a matchbook2018-06-02T00:00:00-07:002018-06-02T00:00:00-07:00http://aaron.niskin.org/blog/2018/06/02/2_ropes_60_min<h2 id="the-scenario">The scenario:</h2>
<p>You’re given 2 ropes and a matchbook. You know a priori that these two ropes each take an hour to burn, but they don’t burn at an even rate. For instance, the first rope might take 1 minute to burn through the first half and 59 minutes to burn the second, and the other rope might be completely different.</p>
<p>Can you measure 45 minutes using only these two ropes and the matchbook?</p>
<p>What you know:</p>
<ol>
<li>You have two ropes and a matchbook.</li>
<li>The ropes take an hour to burn completely.</li>
<li>The rate of burn is inconsistent.</li>
</ol>
<h3 id="hints-click-to-unblur">Hints (click to unblur)</h3>
<ol>
<li>
<p class="hint">Can you measure 30 minutes?</p>
</li>
<li>
<p class="hint">You may have to do two things at once</p>
</li>
</ol>
<h2 id="a-solution">A solution</h2>
<h3 id="a-description-and-strategy">A description (and strategy)</h3>
<p class="hint">You can measure 60 minutes easily by just burning a rope. You can measure 30 minutes by burning both ends of a rope. So you can measure 45 minutes by lighting two ends of one rope and one end of the other, then when the first rope burns out, light the other end of the second rope. It’ll be 45 minutes because the first rope takes 30 minutes to burn, so there will be 30 minutes left on the second rope when you light the second end, thereby turning the 30 minutes of rope into 15 minutes.</p>Aaron NiskinYou're given two ropes that take 60 minutes to burn and a matchbook, and you need to measure 45 minutes.