tag:blogger.com,1999:blog-91827054998982524962017-10-21T07:52:49.006-04:00Bill the Lizard"The time has come," the Walrus said,
"To talk of many things..."Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.comBlogger214125tag:blogger.com,1999:blog-9182705499898252496.post-4172443500455156192017-10-21T07:34:00.001-04:002017-10-21T07:34:43.626-04:00Draw Two<br />Two numbers are drawn at random from the integers 1 through 10. What is the expected value of their sum? Does it change if the second draw is done with or without replacement? Click below for the answers.<br /><br /><div id="draw_two" style="background-color: honeydew; display: none; padding: 5px;">This puzzle is from <a href="https://twitter.com/MrHonner/status/917546796322377728">Patrick Honner</a>. It's easy to calculate the expected value with replacement. It's just two times the expected value of a random draw from 1...10, so 2 * 5.5, or 11. The interesting part is that when you draw two numbers <i>without</i> replacement the expected sum doesn't change. Why is that? <br /><br />To find out, take a look at what happens to the expected value of the second draw for each value of the first draw. (Expected value is just the average of the remaining numbers.)<br /><br /><table><tr><th>1st draw</th><th>E(2nd draw)</th><tr><td>$1$</td><td>$6$</td><tr><td>$2$</td><td>$5\frac{8}{9}$</td><tr><td>$3$</td><td>$5\frac{7}{9}$</td><tr><td>$4$</td><td>$5\frac{2}{3}$</td><tr><td>$5$</td><td>$5\frac{5}{9}$</td><tr><td>$6$</td><td>$5\frac{4}{9}$</td><tr><td>$7$</td><td>$5\frac{1}{3}$</td><tr><td>$8$</td><td>$5\frac{2}{9}$</td><tr><td>$9$</td><td>$5\frac{1}{9}$</td><tr><td>$10$</td><td>$5$</td> </table><br />As the value of the first draw increases, the expected value of the second draw decreases. If you take the sum of each column you get 55. Divide by 10 to get the average and you get 5.5, so when you add them together you arrive back at the solution of 11.<br /><br />See my <a href="https://github.com/BillCruise/Probability/blob/master/scripts/draw_two.py">Probability GitHub repository</a> for a script that shows how to model this problem in Python.<br /></div><br /><button onclick="showHideDiv('draw_two');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-29614942147763367942017-10-14T07:55:00.000-04:002017-10-14T07:55:00.694-04:00Chicken McNuggets<br />You drove for hours last week to get your hands on <a href="http://www.snopes.com/2017/10/09/mcdonalds-szechuan-sauce-rick-and-morty/">McDonald's limited edition Szechuan sauce</a>, and now you need some chicken nuggets for you and all of your friends. You can buy McNuggets in boxes of 6, 9, and 20. What is the <i>largest</i> whole number of nuggets that it is <b>not possible</b> to obtain by purchasing some combination of boxes of 6, 9, and 20? Click below for the answer.<br /><br /><div class="separator" style="clear: both; text-align: center;"><img border="0" src="https://3.bp.blogspot.com/-aG4Y9Gj358c/WdvHmiO8tuI/AAAAAAAADl8/xdTzyiqe8S4yIKymoSIlW60SaltLH-W_wCLcBGAs/s320/Szechuan.jpg" width="259" height="320" data-original-width="375" data-original-height="464" /></div><br /><div id="chicken_mcnuggets" style="background-color: honeydew; display: none; padding: 5px;">There might be cleverer solutions to this problem, but we can do this fairly easily by listing combinations. Once we hit a streak of six numbers in a row that we <i>can</i> obtain, we know that the last number we <i>couldn't</i> obtain before the streak is the largest such number. Beyond that streak of six we can just add one or more boxes of 6 nuggets to one of those numbers to obtain any higher number. (There may be other combinations to obtain some of these numbers, but we only need one combination for each.)<br /><br /><table><tr><th>Number</th><th>Boxes</th></tr><tr><td>1</td><td>Not Possible</td></tr><tr><td>2</td><td>Not Possible</td></tr><tr><td>3</td><td>Not Possible</td></tr><tr><td>4</td><td>Not Possible</td></tr><tr><td>5</td><td>Not Possible</td></tr><tr><td>6</td><td>6</td></tr><tr><td>7</td><td>Not Possible</td></tr><tr><td>8</td><td>Not Possible</td></tr><tr><td>9</td><td>9</td></tr><tr><td>10</td><td>Not Possible</td></tr><tr><td>11</td><td>Not Possible</td></tr><tr><td>12</td><td>6 + 6</td></tr><tr><td>13</td><td>Not Possible</td></tr><tr><td>14</td><td>Not Possible</td></tr><tr><td>15</td><td>6 + 9</td></tr><tr><td>16</td><td>Not Possible</td></tr><tr><td>17</td><td>Not Possible</td></tr><tr><td>18</td><td>9 + 9</td></tr><tr><td>19</td><td>Not Possible</td></tr><tr><td>20</td><td>20</td></tr><tr><td>21</td><td>6 + 6 + 9</td></tr><tr><td>22</td><td>Not Possible</td></tr><tr><td>23</td><td>Not Possible</td></tr><tr><td>24</td><td>6 + 9 + 9</td></tr><tr><td>25</td><td>Not Possible</td></tr><tr><td>26</td><td>20 + 6</td></tr><tr><td>27</td><td>9 + 9 + 9</td></tr><tr><td>28</td><td>Not Possible</td></tr><tr><td>29</td><td>20 + 9</td></tr><tr><td>30</td><td>6 + 6 + 9 + 9</td></tr><tr><td>31</td><td>Not Possible</td></tr><tr><td>32</td><td>6 + 6 + 20</td></tr><tr><td>33</td><td>6 + 9 + 9 + 9</td></tr><tr><td>34</td><td>Not Possible</td></tr><tr><td>35</td><td>6 + 9 + 20</td></tr><tr><td>36</td><td>9 + 9 + 9 + 9</td></tr><tr><td>37</td><td>Not Possible</td></tr><tr><td>38</td><td>9 + 9 + 20</td></tr><tr><td>39</td><td>6 + 6 + 9 + 9 + 9</td></tr><tr><td>40</td><td>20 + 20</td></tr><tr><td>41</td><td>6 + 6 + 9 + 20</td></tr><tr><td>42</td><td>6 + 9 + 9 + 9 + 9</td></tr><tr><td>43</td><td>Not Possible</td></tr><tr><td>44</td><td>6 + 9 + 9 + 20</td></tr><tr><td>45</td><td>9 + 9 + 9 + 9 + 9</td></tr><tr><td>46</td><td>6 + 20 + 20</td></tr><tr><td>47</td><td>9 + 9 + 9 + 20</td></tr><tr><td>48</td><td>6 + 6 + 9 + 9 + 9 + 9</td></tr><tr><td>49</td><td>9 + 20 + 20</td></tr></table><br />That's six in a row, so we can get any higher number of nuggets just by adding boxes of 6 to those combinations. That means that <b>43</b> is the largest number of Chicken McNuggets that you cannot buy by combining boxes of 6, 9, and 20.<br /></div><br /><button onclick="showHideDiv('chicken_mcnuggets');" title="Click to Show/Hide Answer">Show/Hide Answer</button><br />Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-79094631238159027482017-10-07T07:35:00.000-04:002017-10-07T07:35:54.186-04:00Pennies<br />Would you rather have a ton of pennies, four miles of pennies lined up end-to-end, or a stack of pennies half a mile tall? Click below for a hint, or for the answer.<br /><br /><div class="separator" style="clear: both; text-align: center;"><img border="0" src="https://3.bp.blogspot.com/-N0XhKlsfaK0/WcexvY9xc3I/AAAAAAAADlA/F232PIh41bYG1LLA1o9Zbvhd3uEvKHPCgCLcBGAs/s1600/Pennies.jpg" data-original-width="512" data-original-height="288" /></div><br /><div id="pennies_hint" style="background-color: #ffffcc; display: none; padding: 5px;">One penny weighs 2.500 grams (according to the <a href="https://www.usmint.gov/learn/coin-and-medal-programs/coin-specifications">U.S. Mint</a>).<br />There are about 28.35 grams in an ounce<br />There are 16 ounces in a pound.<br />There are 2,000 pounds in a (U.S.) ton.<br /><br />One penny is 0.750 inches in diameter.<br />There are 12 inches in a foot.<br />There are 5,280 feet in a mile.<br /><br />One penny is 1.52 millimeters thick.<br />There are 25.4 millimeters in an inch.<br /></div><br /><button onclick="showHideDiv('pennies_hint');" title="Click to Show/Hide Hint">Show/Hide Hint</button><br /><br /><div id="pennies_answer" style="background-color: honeydew; display: none; padding: 5px;">Four miles of pennies lined up end-to-end would be <b>$3,379.20</b>, while one ton is <b>$3,628.80</b>, so between the first two options you would be better off to take the ton. However, a stack of pennies half a mile tall would be <b>$5,293.89</b>, so the stack is by far the best option.<br /></div><br /><button onclick="showHideDiv('pennies_answer');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-11409406971016993382017-09-30T07:52:00.001-04:002017-09-30T07:52:26.622-04:00Western Leaders<br />Here's a freaky coincidence about World War II. If you add up the year of birth, age in 1944, year of taking power, and the number of years in office in 1944 for each of the five main leaders of the Western world during World War II, the sums are all the same.<br /><br /><table><tr><th></th><th>Churchill</th><th>Hitler</th><th>Mussolini</th><th>Roosevelt</th><th>Stalin</th></tr><tr><th>Year of birth</th><td align="right">1874</td><td align="right">1889</td><td align="right">1883</td><td align="right">1882</td><td align="right">1878</td></tr><tr><th>Age in 1944</th><td align="right">70</td><td align="right">55</td><td align="right">61</td><td align="right">62</td><td align="right">66</td></tr><tr><th>Took power</th><td align="right">1940</td><td align="right">1933</td><td align="right">1922</td><td align="right">1933</td><td align="right">1922</td></tr><tr><th>Years in office</th><td align="right">4</td><td align="right">11</td><td align="right">22</td><td align="right">11</td><td align="right">22</td></tr><tr><th>Sum</th><td align="right">3,888</td><td align="right">3,888</td><td align="right">3,888</td><td align="right">3,888</td><td align="right">3,888</td></tr></table><br />Can you explain this coincidence? Click below for the answer.<br /><br /><div id="western_leaders" style="background-color: honeydew; display: none; padding: 5px;">There's really no coincidence at all. If you take any person's year of birth and add their age in 1944, the sum will be... 1944. This also goes for the year a leader took office and the number of years they had held office in 1944, so the sum of all four values will always be 1944 + 1944 = 3888. You can make your own puzzle using any year as a reference point.<br /></div><br /><button onclick="showHideDiv('western_leaders');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-19920450564357068592017-09-23T08:19:00.000-04:002017-09-23T08:19:54.196-04:00Concentric Shapes<br />See the image below of a square inscribed inside a circle inscribed inside a square. If the outer square has an area of 100 square inches, is there a quick way of figuring out the area of the inner square? Click below for the answer.<br /><br /><div class="separator" style="clear: both; text-align: center;"><img src="https://3.bp.blogspot.com/-1hy5k8jQnTw/Wb3Hx_YAs2I/AAAAAAAADkk/Djf9qmQPdVoA-mtcZ0x-jFnqTIwe3uCDwCLcBGAs/s400/Concentric-1.png" style="border: none" /></div><br /><div id="concentric_shapes" style="background-color: honeydew; display: none; padding: 5px;">Spin the inner square around so the corners touch the top, bottom, and sides of the outer square.<br /><br /><div class="separator" style="clear: both; text-align: center;"><img src="https://4.bp.blogspot.com/-84ncZyrET3s/Wb3H6TAQFWI/AAAAAAAADko/BhOJvSz9chcP0DranKup4mkPu05MuxdCgCLcBGAs/s400/Concentric-2.png" style="border: none" /></div><br />Now imagine taking each corner of the outer square and folding them in so they touch in the center of the image. It's easy to see that the area outside the inner square will perfectly cover the area inside, so the inner square has exactly half the area of the outer square, or 50 square inches.<br /></div><br /><button onclick="showHideDiv('concentric_shapes');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-13708401374391763062017-09-16T09:00:00.003-04:002017-09-16T09:00:25.062-04:00Digit Frequency<br />If you write down all the numbers from 1 to 1000 (inclusive) which digit occurs most frequently? Which digit appears least frequently in the same range? Click below for the answers.<br /><br /><div id="digit_frequency" style="background-color: honeydew; display: none; padding: 5px;">You could write all the numbers down or write a program to count the digit frequencies, but this problem is much easier if you look for a pattern. The digits 0 through 9 all appear the same number of times in the ones place, but 1 through 9 appear a lot more often in the tens and hundreds place (because of numbers like 22, 222, etc., and the fact that we don't write leading 0s). This means that <b>0 is the least frequent digit</b>. It only appears 192 times in the specified range. What about the most frequent? The digits 1 through 9 appear with exactly the same frequency in the range 1 to 999 (300 times each), so that extra occurrence (in the number 1000) makes <b>1 the most frequent digit</b> from 1 to 1000.<br /></div><br /><button onclick="showHideDiv('digit_frequency');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-77966285663368657282017-09-09T08:37:00.004-04:002017-09-09T08:37:55.340-04:00Counting Chickens<br />If one-and-a-half chickens lay one-and-a-half eggs in one-and-a-half days, how many eggs does one chicken lay in one day? Click below for the answer.<br /><br /><div id="counting_chickens" style="background-color: honeydew; display: none; padding: 5px;">For many people, the intuitive answer is one egg, but it pays double-check your math on this kind of problem. The daily rate of eggs per chicken per day is given by the formula<br /><br />daily rate = eggs / (chickens x days)<br /><br />Plugging in the numbers from the first part of the problem, we get<br /><br />daily rate = 1.5 / (1.5 x 1.5)<br />daily rate = 1.5 / 2.25<br />daily rate = 2/3<br /><br />So, one chicken lays two-thirds of an egg in one day.<br /></div><br /><button onclick="showHideDiv('counting_chickens');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-57376924382986807272017-09-02T08:46:00.002-04:002017-09-02T08:46:30.505-04:00Number Sense<br />How good is your "number sense"? How many of the following can you answer without using a calculator or looking up a conversion factor?<br /><ol><li>Are there more inches in a mile, or Sundays in 1000 years?</li><li>Are there more seconds in a week, or feet in 100 miles?</li><li>Are there more millimeters in a mile, or seconds in a month?</li><li>Which is larger, multiplying all the numbers from 1 to 10, or multiplying just the even numbers from 1 to 16?</li><li>Which is longer, 666 days or 95 weeks?</li><li>Which is longer, 666 inches or 55 feet?</li><li>Which is longer, 666 hours or 28 days?</li><li>Are there more ounces in a ton or inches in a kilometer?</li><li>Which is hotter, $0^{\circ}C$ or $0^{\circ}F$?</li><li>Which is larger, $e^\pi$ or $\pi^e$?</li></ol><br />Click below for the answers.<br /><br /><div id="number_sense" style="background-color: honeydew; display: none; padding: 5px;"><ol><li>Inches in a mile. (63,360. There can be up to 52,178 Sundays in 1000 years.)</li><li>Seconds in a week. (604,800, compared to 528,000 feet in 100 miles.)</li><li>Seconds in a month. (Even if the month only has 28 days, that's 2,419,200 seconds, compared to only 1,609,340 millimeters in a mile.)</li><li>Just the even numbers from 1 to 16. (Multiplying all the numbers from 1 to 10 gives you 3,628,800. Multiplying the even numbers from 1 to 16 give you 10,321,920.)</li><li>666 days. (95 weeks is only 665 days.)</li><li>666 inches. (55 feet is 660 inches.)</li><li>28 days (which is 672 hours).</li><li>Inches in a kilometer. (39,370.1, compared to 35,840 ounces in a <a href="http://www.onlineconversion.com/faq_09.htm">long ton</a>, which is the heaviest ton.)</li><li>$0^{\circ}C$ is "hotter" since it is equal to $32^{\circ}F$</li><li>$e^\pi$ (23.14) is larger than $\pi^e$ (22.46).</li></ol></div><br /><button onclick="showHideDiv('number_sense');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com2tag:blogger.com,1999:blog-9182705499898252496.post-77521852311842412922017-08-26T09:03:00.000-04:002017-08-26T09:03:33.743-04:00Replacing Marbles<br />We place 15 black marbles and 15 white marbles in an urn. We have 30 additional black marbles in a bag. Then we follow these rules.<br /><br />1. Remove two marbles from the urn.<br />2. If they are different colors, put the white marble back in the urn and the black marble in the bag.<br />3. If they are the same color, put both marbles in the bag, then put one black marble from the bag into the urn.<br /><br />Continue following these rules until only one marble is left in the urn. What color is that marble? Click below for the answer.<br /><br /><div id="replacing_marbles" style="background-color: honeydew; display: none; padding: 5px;">When I first heard this puzzle, I immediately thought of writing a Python script, since that's my favorite method for dealing with problems in probability. This is a logic problem in disguise, though. I realized that as I tried to figure out the best way to set up the problem in code. If you pay close attention to the rules for adding and removing marbles from the urn, and the initial conditions, you'll notice a couple of things.<br /><br />1. You start with an odd number of both black and white marbles in the urn.<br />2. The rules force you to always keep an odd number of white marbles in the urn (they can only be removed two at a time), but allow for both odd and even numbers of black marbles.<br /><br />From those observations it's easy to see that when you get down to one marble, it must be a white marble.<br /></div><br /><button onclick="showHideDiv('replacing_marbles');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-42883588942914710272017-08-19T09:11:00.000-04:002017-08-19T09:11:03.014-04:00Factor Sums<br />Not counting itself, the number 6 has the factors 1, 2, and 3, which add to 6. The number 28 has the same property (its factors are 1, 2, 4, 7, and 14). Can you come up with a three-digit number that has this property? What about a four-digit number? Click below for the answers.<br /><br /><div id="factor_sums" style="background-color: honeydew; display: none; padding: 5px;">If you knew that a number that is the sum of its own proper divisors is called a <a href="https://en.wikipedia.org/wiki/Perfect_number">Perfect number</a>, this puzzle was pretty easy. You could just search for that name and find the solutions are <b>496</b> and <b>8,128</b>. Perfect numbers have been known at least as far back as <a href="https://en.wikipedia.org/wiki/Euclid">Euclid</a> (323–283 BCE), who included a formulation for then in his book of <a href="https://en.wikipedia.org/wiki/Euclid%27s_Elements">Elements</a>.<br /><br />The formulations states that $q(q + 1) / 2$ is a perfect number whenever $q$ is a prime of the form $2^p - 1$ for prime $p$ (now known as a <a href="https://en.wikipedia.org/wiki/Mersenne_prime">Mersenne prime</a>). So, if we know the first few Mersenne primes, we can calculate the first few perfect numbers.<br /><br />$3(3 + 1) / 2 = 6$<br />$7(7 + 1) / 2 = 28$<br />$31(31 + 1) / 2 = 496$<br />$127(127 + 1) / 2 = 8,128$<br />$8,191(8,191 + 1) / 2 = 33,550,336$<br /><br />The ancient Greek mathematicians would not have known that 8,191 was a prime, so Euclid would only have known the first four Perfect numbers. Now you can say you know something that Euclid didn't!<br /></div><br /><button onclick="showHideDiv('factor_sums');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-78970575768431500102017-08-12T09:02:00.002-04:002017-08-12T09:02:33.275-04:00Minimum Percentage<br />75% of men from a certain group are tall, 75% have brown hair, and 75% have brown eyes. What is the minimum percentage that are tall, have brown hair, <i>and</i> have brown eyes? Click below to see the answer.<br /><br /><div id="minimum_percentage" style="background-color: honeydew; display: none; padding: 5px;">Instead of thinking in percentages to solve this problem, it's helpful to think back to the <a href="http://www.billthelizard.com/2017/06/the-pigeonhole-principle.html">Pigeonhole Principle</a>. Think of a group of 100 men, then 75 are tall, 75 have brown hair, and 75 have brown eyes. That's 225 individual attributes to assign to 100 men, so at least 25 of them (or <b>25%</b>) must have each of the three attributes.<br /></div><br /><button onclick="showHideDiv('minimum_percentage');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-32450245227305312802017-08-05T08:33:00.000-04:002017-08-05T08:33:01.099-04:00A Two-Digit Number<br />Find a two-digit number that's equal to two times the result of multiplying its digits. Click below to see the answer.<br /><br /><div id="two_digit_number" style="background-color: honeydew; display: none; padding: 5px;">My first attempt at solving this puzzle was to set it up as an equation and try to solve it algebraically. Let's say the two digits are $x$ and $y$. Then the equation would be:<br /><br />$10x + y = 2xy$<br /><br />The left-hand side is the two-digit number ($x$ in the tens place, $y$ in the ones place) and the right-hand side is two times the result of multiplying its digits. If you try to isolate either $x$ or $y$, you'll see that it's not very easy to come up with a clean solution. That's because the equation above describes a hyperbola.<br /><br /><div class="separator" style="clear: both; text-align: center;"><img border="0" src="https://2.bp.blogspot.com/-ZmCgq6t5V0E/WX3hk42LFMI/AAAAAAAADi8/v_EYiDg41ogMywLfBhtVbtrrCqFLl9FxgCLcBGAs/s1600/hyperbola.gif" data-original-width="200" data-original-height="213" /></div><br />That's not exactly a dead end, but it isn't the kind of easy-to-understand (once you see it) solution I like in a logic puzzle. Luckily, there's an easier way. There aren't that many possibilities (we're only dealing with two digits), and we can eliminate a lot of them.<br /><br />For example, we know that neither digit is 0. Also, we know that $2xy$ is an even number, so $y$ must be even (because the result of adding it to an even number is even). We also know that the product of the digits must be less than 50, otherwise $2xy$ would have three digits. That gets us down to only 32 possibilities to test.<br /><br /><div class="separator" style="clear: both; text-align: center;"><img border="0" src="https://4.bp.blogspot.com/-N5YnHP9cx9o/WX3nb6U8oSI/AAAAAAAADjM/ESN3uWAJ46kND-kjxI4aGhaRp722WRauACLcBGAs/s1600/possibilities.png" data-original-width="321" data-original-height="201" /></div><br />Any other shortcuts that I can think of would only eliminate a few possibilities, but it's easy to just test the remaining ones (I went through them manually, but you could write a short script or use a spreadsheet), and find that the solution is<br /><br />$36 = 2 * 3 * 6$<br /></div><br /><button onclick="showHideDiv('two_digit_number');" title="Click to Show/Hide Answer">Show/Hide Answer</button><br /><br />Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com2tag:blogger.com,1999:blog-9182705499898252496.post-89933902456152111202017-07-29T09:03:00.003-04:002017-07-29T09:03:31.780-04:00Identical Twins<br />Alice and Eve are identical twin sisters. One always lies and the other always tells the truth, but we don't know which is which. We ask one of them "Is Alice the one that always lies?" and she replies "Yes." Did we speak to Alice or Eve? Click below to see the answer.<br /><br /><div id="identical_twins" style="background-color: honeydew; display: none; padding: 5px;">We spoke to Eve. A person who always lies or always tells the truth cannot admit that they are a liar, so Alice could not have answered "Yes" to that question. (Note that we still don't know which sister is the liar and which is the truth teller.)<br /></div><br /><button onclick="showHideDiv('identical_twins');" title="Click to Show/Hide Answer">Show/Hide Answer</button><br />Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-23704839958327485652017-07-22T08:35:00.002-04:002017-07-22T08:35:20.939-04:00Counting Socks<br />All my socks are red except two. All my socks are white except two. All my socks are blue except two. How many socks do I have? Click below for the answer.<br /><br /><div id="counting_socks" style="background-color: honeydew; display: none; padding: 5px;">Oddly, I only have three socks. Don't let the fact that socks normally come in matching pairs distract you. No other number satisfies all three conditions above.<br /></div><br /><button onclick="showHideDiv('counting_socks');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com2tag:blogger.com,1999:blog-9182705499898252496.post-20033286181022604682017-07-15T08:51:00.000-04:002017-07-15T08:51:18.819-04:00Circumnavigation<br />From 1519 until 1522, Ferdinand Magellan's <i>Victoria </i> was the first ship to successfully circumnavigate the globe. (Magellan himself did not survive the entire voyage.) Can you tell me which part of the ship traveled the greatest distance? Click below for the answer.<br /><br /><div id="circumnavigation" style="background-color: honeydew; display: none; padding: 5px;">If you remembered the <a href="http://www.billthelizard.com/2017/01/rope-around-earth.html">Rope Around the Earth</a> puzzle I posted a few months ago, you probably got this one pretty quickly. Since the world is roughly spherical, the tip of the tallest mast of the ship would have traveled the greatest distance in sailing around the globe. Imagine if a boat sailed in a perfect circle around the equator. The part of the boat deepest under water (the keel) would create a smaller circle than the tip of the mast several feet above the water, so the tip of the mast travels the greatest distance during the voyage.<br /></div><br /><button onclick="showHideDiv('circumnavigation');" title="Click to Show/Hide Answer">Show/Hide Answer</button><br /><br /><div class="separator" style="clear: both; text-align: center;"><img border="0" src="https://2.bp.blogspot.com/-bBbSml44s2Q/WV-rP4V7fOI/AAAAAAAADic/uA9WE3etDxg0roaJzLCu5_HtEDJVa5rUgCLcBGAs/s320/Nao_Victoria.jpg" width="320" height="240" data-original-width="1280" data-original-height="960" /></div><div style="clear: both; text-align: center; font-size: 80%;">Replica of the Victoria, Photograph by <a href="https://commons.wikimedia.org/w/index.php?curid=371163">Gnsin - Own work, CC BY-SA 3.0</a></div>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-85100362687461626332017-07-08T09:59:00.001-04:002017-07-08T09:59:04.355-04:0050 factorial<br />50! = 30414093201713378043612608166064768844377641568960512071337804000<br /><br />Without doing the full computation, can you tell whether the above statement is true or false? Click below for the answer.<br /><br /><div id="fifty_factorial" style="background-color: honeydew; display: none; padding: 5px;">You can probably guess that the statement is false, otherwise it wouldn't be much of a puzzle. The reasoning, though, is that the factorial for 50 must include the factors 10, 20, 30, 40, and 50, so it must end in at least five zeroes. The value above ends in only three zeroes, so it cannot be correct. (The correct value is 30414093201713378043612608166064768844377641568960512000000000000.)<br /></div><br /><button onclick="showHideDiv('fifty_factorial');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-60670354582130822962017-07-01T08:09:00.002-04:002017-07-01T08:09:14.877-04:00The Missing Fish<br />Two fathers took their sons fishing. Each man and his son caught one fish, but when they all returned to camp they only had three fish. None of the fish were eaten, lost, or thrown back. How could this be? Click below to see the answer.<br /><br /><div id="missing_fish" style="background-color: honeydew; display: none; padding: 5px;">There were only three people on the fishing trip. One man was the father and grandfather of the other two.<br /></div><br /><button onclick="showHideDiv('missing_fish');" title="Click to Show/Hide Answer">Show/Hide Answer</button><br /><br /><div class="separator" style="clear: both; text-align: center;"><img border="0" src="https://1.bp.blogspot.com/-z897STj_WRQ/WUqNWeRKvdI/AAAAAAAADiA/ov3_yb28tTk6RpHrtCnCZUu9uHqnTRxYgCLcBGAs/s1600/Fish.JPG" data-original-width="480" data-original-height="283" /></div>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-14713334387756298032017-06-24T09:39:00.002-04:002017-06-24T09:39:51.333-04:00Bags of Marbles<br />You have three identical bags, each containing two marbles. Bag A contains two white marbles, Bag B contains two black marbles, and Bag C contains one white and one black marble. You pick a bag at random and draw out one marble. If the marble is white, what is the probability that the other marble in the same bag is also white? Click below to see the answer.<br /><br /><div id="bags_of_marbles" style="background-color: honeydew; display: none; padding: 5px;">Many people will instinctively answer 50%, or 1/2, since the marble has two possible colors, but the probability is actually 2/3 (66.67%). Why? If the first marble is white, then you know you didn't randomly select Bag B. That means that the first marble you selected has three (not two) possibilities:<br /><ol><li>The first marble in Bag A.</li><li>The second marble in Bag A.</li><li>The white marble in Bag C.</li></ol>Only in the third case will the other marble be black, so there's a 2/3 probability that when the first marble is white, the second marble will also be white.<br /></div><br /><button onclick="showHideDiv('bags_of_marbles');" title="Click to Show/Hide Answer">Show/Hide Answer</button><br /><br />If you want to see how you would model this problem in Python, you can look at <a href="https://github.com/BillCruise/Probability/blob/master/scripts/bags_of_marbles.py">my solution on GitHub</a>.Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-29609989186458842022017-06-17T09:16:00.000-04:002017-06-17T09:16:36.060-04:00The Monk and the Mountain Path<br />One morning at precisely 9:00 AM a monk begins walking up a mountain path. He takes his time, stopping several times to rest along the way. He arrives at the temple at the mountain's summit at precisely 5:00 PM that evening. The next day, the monk leaves the temple at precisely 9:00 AM and makes his way back down the path. Again, he takes his time and rests at several points along the journey. He arrives back at his original starting point at precisely 5:00 PM that evening. Is there any time when the monk is in exactly the same spot on both days? Click below to see the answer.<br /><br /><div id="monk_mountain" style="background-color: honeydew; display: none; padding: 5px;">Since the monk isn't travelling at a constant rate of speed on his two trips, it's tempting to say that there's not <i>necessarily</i> a time when the monk is in the same spot at the same time on both days. However, such a time and place <i>must</i> exist. To see why, take a look at the following plot of the two trips.<br /><br /><div class="separator" style="clear: both; text-align: center;"><img border="0" src="https://1.bp.blogspot.com/-VCbpcsFYG0I/WTb_PMYEIRI/AAAAAAAADhk/L43JIrhEzCYAlUS2mLxUxG9rq4od94b5QCLcB/s400/Mountain-Path.png" width="400" height="234" data-original-width="678" data-original-height="396" /></div><br />Imagine that you can grab the lines on the plot and bend them however you like, you just can't move the endpoints, and the lines must stay within the bounds of the two axes. No matter how you stretch and bend the lines, <i>they must cross somewhere</i>.<br /><br />To think of it another way, imagine there were two monks, one at the base of the mountain and one at the temple, and they started their journeys on the same day. If they were to begin and end their trips at the same time, they would have to pass each other on the path at some point during the day.<br /></div><br /><button onclick="showHideDiv('monk_mountain');" title="Click to Show/Hide Answer">Show/Hide Answer</button><br /><br /><div class="separator" style="clear: both; text-align: center;"><img border="0" src="https://3.bp.blogspot.com/-4KRSAOsFoEU/WTb7-8SdygI/AAAAAAAADhg/IRNlyOCleE8h25KDO6N6TQ0yKRK7G5UOwCLcB/s320/monk_mountain_path.jpg" width="320" height="240" data-original-width="640" data-original-height="480" /></div><br />Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com2tag:blogger.com,1999:blog-9182705499898252496.post-57042472069698146732017-06-10T10:27:00.000-04:002017-06-10T10:27:13.302-04:00The Pigeonhole Principle<br />The <a href="https://en.wikipedia.org/wiki/Pigeonhole_principle"><b>pigeonhole principle</b></a> states that if a group of pigeons flies into a set of pigeonholes, and there are more pigeons than pigeonholes, then there must be at least one pigeonhole with two pigeons in it. More generally, if <i>k + 1</i> or more objects are placed into <i>k</i> boxes, then there is at least one box containing two or more of the objects. Despite its seeming simplicity (perhaps obviousness), it can be used to solve a surprising range of problems in probability, number theory, and computer science, just to name a few. See if you can use it to solve the following three problems.<br /><br /><ol><li>(Warm up) A drawer contains a dozen blue socks and a dozen black socks, all unmatched. If the room is dark, how many socks do you have to take out to be sure you have a matching pair?</li><li>Prove that there are at least two people in Tokyo with exactly the same number of hairs on their heads.</li><li>Prove that if five distinct integers are selected from the numbers 1 through 8, there must be at least one pair with a sum equal to 9.</li></ol><br />Click below to see the answers.<br /><br /><div id="pigeonhole_principle" style="background-color: honeydew; display: none; padding: 5px;"><ol><li>(Warm up) If you've only heard one problem involving the pigeonhole principle, it was probably the classic sock drawer problem. You only need to pick three socks to make sure you have one matching pair. When you pick two socks, you might already have a matching pair, or you might have one of each color sock. Selecting one more sock ensures that you have at least two socks of one color or the other.</li><li>The Tokyo hairs problem sounds like something you might be asked as a "brain teaser" interview question. If you're stuck in an interview, then the first step is to show off your estimating skills. Since we're not in that situation, we can just use Google to find out that there are <a href="http://www.newworldencyclopedia.org/entry/Hair">about 100,000 hairs on the average human head</a>, and that <a href="https://en.wikipedia.org/wiki/Tokyo">Tokyo is home to about 13.6 million people</a>. That's more than enough people for our proof. For the sake of simplicity, let's say that 200,000 is the <b>maximum</b> number of hairs a person can have on their head. Then, if you select 200,001 people who happen to each have a distinct number of hairs on their heads (zero is a valid number of hairs to have on your head), you only need one more to ensure that two people have the same number of hairs. (Note: This puzzle will work with any city larger than 200,001 residents.)</li><li>To see how the pigeonhole principle applies to this problem, you just need to group the numbers 1 through 8 in pairs that sum to 9. {1,8}, {2,7}, {3,6}, {4,5}. Now, if I select four distinct numbers from that range, I might select one number from each of the four pairs. If I select a fifth number, then I must complete one of the pairs that sums to 9.</li></ol></div><br /><button onclick="showHideDiv('pigeonhole_principle');" title="Click to Show/Hide Answer">Show/Hide Answer</button><br /><br /><div class="separator" style="clear: both; text-align: center;"><img border="0" src="https://1.bp.blogspot.com/-XiSyOIHYk3c/WS2ThhllYJI/AAAAAAAADg8/T6wkVqPjnqkWS0stS-JeggJsZcMRzZubQCLcB/s1600/pigeonhole.jpg" data-original-width="216" data-original-height="153" /></div>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-87516301531454672252017-06-03T09:23:00.000-04:002017-06-03T09:23:24.052-04:00Coffee with Cream<br />Suppose you have two cups in front of you, one with precisely 8 fluid ounces of coffee, and the other with precisely 8 fluid ounces of cream. You take precisely one teaspoon of the cream and add it to your coffee. You stir it in so that it's thoroughly mixed. Then you take precisely one teaspoon of that coffee/cream mixture and put it back into the cup of cream. Does the cup of coffee have more cream in it, or does the cup of cream contain more coffee? Click below for the answer.<br /><br /><div id="coffee_with_cream" style="background-color: honeydew; display: none; padding: 5px;">This question is a bit tricky. It's tempting to think that the cup of coffee contains more cream, because the teaspoon of cream added to the coffee was 100% pure, while the teaspoon of coffee added to the cream was diluted. However, it's important to remember that the total volume of each vessel changed by one teaspoon after the first transfer of fluid. The coffee/cream mixture was greater by two teaspoons than the pure cream. Before I reveal the answer, let's re-frame the question in discrete units.<br /><br />Suppose that instead of liquids, our two cups contained 20 black marbles and 20 white marbles. You take 5 white marbles and thoroughly mix then in with the black marbles. Then you randomly select 5 marbles from the black/white marble mixture and place them back in the cup of white marbles. Are there more white marbles in the black cup or more black marbles in the white cup?<br /><br />If you're like me, you may be tempted to treat this as a probability problem, but it isn't one. When I think about randomly drawing marbles, I want to immediately start writing a quick simulation in Python, but as you'll see, that isn't necessary. We can easily enumerate all possible outcomes in this scenario to find the answer to the question. When we draw 5 marbles from the cup with a mixture of 20 black and 5 white marbles, then place them in the cup with the other 15 white marbles, there are only 6 possible outcomes:<br /><br /><table><tr> <th align="center">black</th> <th align="center">white</th> <th align="center">black/white mix</th> <th align="center">white/black mix</th> </tr><tr> <td align="center">5</td> <td align="center">0</td> <td align="center">15/5</td> <td align="center">15/5</td> </tr><tr> <td align="center">4</td> <td align="center">1</td> <td align="center">16/4</td> <td align="center">16/4</td> </tr><tr> <td align="center">3</td> <td align="center">2</td> <td align="center">17/3</td> <td align="center">17/3</td> </tr><tr> <td align="center">2</td> <td align="center">3</td> <td align="center">18/2</td> <td align="center">18/2</td> </tr><tr> <td align="center">1</td> <td align="center">4</td> <td align="center">19/1</td> <td align="center">19/1</td> </tr><tr> <td align="center">0</td> <td align="center">5</td> <td align="center">20/0</td> <td align="center">20/0</td> </tr></table><br />So the black/white ratio of the 5 marbles in the second transfer doesn't really matter. The end result is that <i>there are always the same number of white marbles in the black cup as there are black marbles in the white cup</i>.<br /><br />The same is true of the original coffee/cream problem. The ratio of the two liquids in the teaspoon that is transferred to the cup of cream is such that you will end up with precisely the same volume of coffee in your cream as there is cream in your coffee. So the answer to the trick question posed at the beginning is "neither, they are the same."<br /></div><br /><button onclick="showHideDiv('coffee_with_cream');" title="Click to Show/Hide Answer">Show/Hide Answer</button><br /><br /><div class="separator" style="clear: both; text-align: center;"><img border="0" src="https://4.bp.blogspot.com/--W6RivrGyW0/WS7NEjZFSgI/AAAAAAAADhM/IN3KrNt8bh8HzAPFQkhJZCrDEQZMcwXawCLcB/s1600/Cup-of-Coffee.jpg" data-original-width="320" data-original-height="240" /></div>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-72605165162656509992017-05-27T08:28:00.000-04:002017-05-27T08:28:45.113-04:00Letter Groupings<br />The letters of the (English) alphabet can be grouped into four distinct categories.<br /><br />A M<br /><br />B C D E K<br /><br />F G J L<br /><br />H I<br /><br />Based on the categories established by the first 13 letters, can you place each of the remaining 13 letters in the correct group?<br /><br /><br /><div id="letter_groupings" style="background-color: honeydew; display: none; padding: 5px;">This question is tricky because it's not about the sounds the letters make, or the frequency of letters, but about the shapes of the (capital) letters.<br /><br />The categories are:<br /><br />A M T U V W Y (left-right mirror images)<br /><br />B C D E K (top-bottom mirror images)<br /><br />F G J L N P Q R S Z (no symmetry)<br /><br />H I O X (symmetry about both axes)<br /></div><br /><button onclick="showHideDiv('letter_groupings');" title="Click to Show/Hide Answer">Show/Hide Answer</button><br />Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com2tag:blogger.com,1999:blog-9182705499898252496.post-47897881664029192902017-05-20T10:39:00.000-04:002017-05-20T10:39:19.911-04:00Number Words<br />In the solution to <a href="http://www.billthelizard.com/2017/03/a-unique-number.html">A Unique Number</a>, I asked a bonus question. "Can you think of a number whose letters when spelled out in English are all in alphabetical order?" Several people replied via Twitter with the correct answer of "forty." You may have found a shortcut to the solution if you noted that none of the single-digit numbers have their letters in alphabetical order, nor does the word "teen." This allows you to skip ahead to 20, 30, etc. Can you use a similar strategy to answer the following questions?<br /><ul><li>What is the lowest number that requires the five vowels A, E, I, O, and U only once each in its spelling?</li><li>What is the lowest number that requires the six letters A, E, I, O, U, and Y only once each in its spelling?</li></ul>Click below to see the answers.<br /><br /><br /><div id="number_words" style="background-color: honeydew; display: none; padding: 5px;">The lowest number that requires the five vowels A, E, I, O, and U once each in its spelling is <b>206</b> (two-hundred and six).<br /><br />The lowest number that requires the six letters A, E, I, O, U, and Y once each in its spelling is <b>230</b> (two-hundred and thirty).<br /><br />The strategy to quickly find these answers is to note which vowels are used in the base numbers, one, two, three, etc, then avoid combinations that include multiples of the same vowel. For example, you can skip past the 100s entirely, because "one-hundred" contains two of the letter "e".<br /></div><br /><button onclick="showHideDiv('number_words');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com4tag:blogger.com,1999:blog-9182705499898252496.post-36315916991346836392017-05-13T08:38:00.000-04:002017-05-13T08:38:08.206-04:00The Nine Dot Puzzle<br />The following is a classic "thinking outside the box" puzzle. Can you connect all nine dots below by drawing exactly four straight lines, without lifting your pencil or tracing back over any line?<br /><br /><div class="separator" style="clear: both; text-align: center;"><img src="https://4.bp.blogspot.com/-a_ARkyZKKyw/WQ_UDTqjosI/AAAAAAAADgU/IWQ8sIFFr_guFGjTF_BZQbCZKKYTAtB2gCLcB/s1600/9dots.png" style="border: none" /></div><br />Give it a try before you click below for the answer.<br /><br /><div id="nine_dot_puzzle" style="background-color: honeydew; display: none; padding: 5px;">If this puzzle looks familiar, it's because it dates back at least as far as Sam Loyd's 1914 <i>Cyclopedia of Puzzles</i>. When I said this was a classic "thinking outside the box" puzzle, that was a clue. You have to think outside the bounds of the box created by the nine dots to come up with a solution.<br /><br /><div class="separator" style="clear: both; text-align: center;"><img src="https://2.bp.blogspot.com/-YhlRAZ-p6ik/WQ_ULGUO9nI/AAAAAAAADgY/z7ubmtzHKFQ1hsmKKBtMU4bIuYW4xIqSACLcB/s1600/9dots-solution.png" style="border: none" /></div></div><br /><button onclick="showHideDiv('nine_dot_puzzle');" title="Click to Show/Hide Answer">Show/Hide Answer</button>Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0tag:blogger.com,1999:blog-9182705499898252496.post-75193488327030486032017-05-06T09:30:00.001-04:002017-05-06T10:20:52.662-04:00Apples and Oranges<br />You work in a factory boxing fruit. In front of you are three boxes labeled "apples," "oranges," and "apples & oranges." One box contains only apples, one contains only oranges, and one contains a mixture of both apples and oranges. Unfortunately, the label machine has gone haywire and has mislabeled all three boxes. Can you look at one piece of fruit from only one of the boxes and correctly label all three? Click below for the solution.<br /><br /><div id="apples_and_oranges" style="background-color: honeydew; display: none; padding: 5px;">The key to this puzzle is that the type of fruit you pull from the box is not the only piece of information you have to work with. You also have the three labels that you know are incorrect. Pull a piece of fruit from the box labeled "apples & oranges." If it is an apple, then you know that this is the apples-only box. That means that the box (incorrectly) labeled "oranges" must be the box with both apples and oranges, and the box labeled "apples" must contain only oranges.<br /><br />(It's interesting to note that if you pick from either the box labeled "apples" or the box labeled "oranges," you can't figure out the composition of the box. Only selecting from the box labeled "apples & oranges" leads to a solution.)<br /></div><br /><button onclick="showHideDiv('apples_and_oranges');" title="Click to Show/Hide Answer">Show/Hide Answer</button><br /><br />Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.com0