-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathstrings.xml
More file actions
710 lines (691 loc) · 105 KB
/
strings.xml
File metadata and controls
710 lines (691 loc) · 105 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
<resources>
<string name="app_name">Probability Puzzles</string>
<string name="new_in_this_update">This is version 4.0, released in October 2025 — now with over ninety puzzles, zero ads, and translations in Spanish, German, and Arabic. Enjoy!
\n\nSome of the puzzles in this app will be difficult if you haven\'t studied probability. Need to brush up? Have a look at this\u00A0<a href="https://chance.dartmouth.edu/teaching_aids/books_articles/probabilityccc_book/book-5-17-03.pdf">Dartmouth book</a> and these\u00A0<a href="https://ocw.mit.edu/courses/mathematics/18-440-probability-and-random-variables-spring-2014/lecture-notes/">MIT notes</a>. You could also read through some probability problems at\u00A0<a href="https://math.stackexchange.com/questions/tagged/probability">math.stackexchange.com</a>. If you prefer to watch lectures on youtube, try\u00A0<a href="https://www.youtube.com/playlist?list=PLUl4u3cNGP60hI9ATjSFgLZpbNJ7myAg6">these</a> or\u00A0<a href="https://www.youtube.com/playlist?list=PLUl4u3cNGP60A3XMwZ5sep719_nh95qOe">these</a>.
\n\nThis app is full of math puzzles, and uses Mariusz Gromada\'s mXparser version 4.2.0 to translate mathematical expressions to numbers: it\'ll understand .2, 0.2, 20\%, or 1/5. The parser also understands factorials and binomial coefficients: try typing 5!/(3!*2!) or\u00A0<a href="https://en.wikipedia.org/wiki/Binomial_coefficient">C(5,3)</a> with a capital C for \"5 choose 3.\" You can also type lowercase e for the base of the natural logarithm. Visit\u00A0<a href="http://mathparser.org">mathparser.org</a> for more information.
\n\nIf you\'d like to contribute to the app (or peek at solutions), have a look at its\u00A0<a href="https://github.com/atorch/probability_puzzles">github repo</a>!</string>
<string name="app_link">Challenge yourself with probability puzzles — install the app at https://play.google.com/store/apps/details?id=atorch.statspuzzles</string>
<string-array name="congratulations">
<item>Good job! Ready for another one?</item>
<item>That\'s right — excellent work!</item>
<item>Very impressive!</item>
<item>Bravo, you did it!</item>
<item>Congratulations, that\'s correct!</item>
<item>You\'re too good at these!</item>
<item>You nailed it once again — nice one!</item>
<item>Give yourself a big pat on the back, you earned it!</item>
<item>Outstanding work!</item>
<item>Outstanding — now you can impress your friends!</item>
<item>Great work! Think you can solve them all?</item>
<item>You\'re a first-rate puzzle solver, if you ask me!</item>
<item>You\'re the smartest person to ever install this app. Keep it up!</item>
<item>You got it — high five!</item>
<item>Boom — you did it!</item>
<item>Good work! Keep up the mental exercise.</item>
<item>Nice job! You\'re getting smarter with every puzzle.</item>
<item>Yes, terrific work! That\'s what I call solving a puzzle.</item>
<item>I\'m impressed… you rocked that one!</item>
<item>Very nice work — Laplace would be impressed!</item>
<item>If there were a Nobel Prize for probability puzzles, I bet you\'d win!</item>
<item>Oh yeah — you got it!</item>
<item>Go out and celebrate: you earned it!</item>
<item>You\'re unstoppable!</item>
<item>Wow, you made it look easy!</item>
<item>Great job! How about celebrating by crushing the next puzzle?</item>
<item>Excellent work! Think you can solve the next one?</item>
<item>Impressive! You\'re getting smarter with each one.</item>
<item>You\'re a probability hero! Are you ready for your next challenge?</item>
</string-array>
<string name="solved_all_puzzles">Impressive — you\'ve solved all the puzzles in this level!</string>
<string name="solved_all_intro">You\'re all done with the intro! Are you ready for something more difficult?</string>
<string name="title_activity_new_settings">Settings</string>
<string name="congratulations_first_intro">Nice job! If you\'re already a probability expert, feel free to jump back to the main menu and try some difficult questions.</string>
<string name="congratulations_first_0">You just rocked your first easy peasy puzzle!</string>
<string name="congratulations_first_1">Welcome to the big leagues: you just solved your first serious puzzle!</string>
<string name="congratulations_first_2">Slow down there, cowboy — that\'s a challenging puzzle you just solved!</string>
<string name="button_intro">Intro</string>
<string name="button_level_0">Easy Peasy</string>
<string name="button_level_1">Getting Serious</string>
<string name="button_level_2">Outrageous</string>
<string name="button_hint">Need a hint?</string>
<string name="button_gemini_hint">Talk to Gemini</string>
<string name="puzzle_copied_to_clipboard">Puzzle copied to clipboard.</string>
<string name="gemini_not_installed">Gemini app not installed. Opening Play Store.</string>
<string-array name="levelDescriptions">
<item>Level: easy peasy — you\'re just warming up.</item>
<item>Level: getting serious — you may need a pen and paper.</item>
<item>Level: outrageous — clicking that third button was a bold move.</item>
</string-array>
<string name="puzzle">Puzzle %d</string>
<string name="approximate_result">≈ %s</string>
<string name="main_menu_button">Main Menu</string>
<string name="stay_here_button">Stay Here</string>
<string name="button_back_to_puzzle">Back to Puzzle</string>
<string name="next_puzzle_button">Next Puzzle</string>
<string name="okay_button">Okay</string>
<string name="ok_button">OK</string>
<string name="solved">solved %1$d / %2$d</string>
<string name="action_share">Share</string>
<string name="action_settings">Settings</string>
<string name="reset_user_data">Reset Data</string>
<string name="title_activity_solve_puzzle">Solve Puzzle</string>
<string name="user_answer_hint">Answer here</string>
<string name="button_submit_answer">Submit</string>
<string name="answer_parsing_hint">Your answer can include math:\n try 0.25 or 1/4 or (1/2)^2 or 1/(2*2).</string>
<string name="swipe_hint">Swipe horizontally to see another puzzle.</string>
<string name="check_mark_description">Check mark</string>
<string name="accuracy">That\'s close to correct, but maybe you just got lucky. To convince me otherwise, please enter an answer accurate to within 0.00001. Remember, your answer can include formulas.</string>
<string name="trouble_parsing_answer">I wasn\'t able to parse your answer (i.e. to translate it to a number). Please try writing it another way, using + and - for addition and subtraction, * and / for multiplication and division, and ^ for exponentiation. Use the digits 0 through 9, possibly with ( and ) as parentheses. Example valid answers are 3/(6*2) and (1/2)^3. Use dots for decimals, e.g. .2 is the same as 1/5 (or as 0.20 or 20\%).</string>
<string name="apprater_title">Rate Probability Puzzles</string>
<string name="apprater_message">Enjoying Probability Puzzles? Please take a moment to rate the app in the Play Store. Every review counts. Thank you for helping out!</string>
<string name="apprater_rate_button">Rate It!</string>
<string name="apprater_later_button">Maybe Later</string>
<string name="apprater_never_button">Never</string>
<string-array name="toasts_for_incorrect_answers">
<item>Sorry, I don\'t think that\'s correct. Please keep trying!</item>
<item>I don\'t think that\'s right. Keep trying!</item>
<item>I don\'t think that\'s correct. Give it another try!</item>
<item>That doesn\'t look right to me. Don\'t give up!</item>
<item>I don\'t think that\'s the answer, but don\'t give up!</item>
<item>Your answers can include math like 0.01 + 11*(1/12)^2.</item>
<item>You can do this — don\'t give up!</item>
<item>I bet you can do this — keep at it!</item>
<item>Stick with it! I\'m sure you can solve this puzzle.</item>
<item>Your answer can include math: try + - / * and ^ (for exponents).</item>
<item>Think of this as mental exercise. Keep it up!</item>
<item>Albert Einstein solved this one when he was two years old.</item>
<item>Sorry, that\'s not quite right. Please try again!</item>
<item>I don\'t think that\'s the right answer. Keep trying!</item>
<item>Remember, your answer can include math: try using + - * / and ^.</item>
<item>That\'s not quite right. In case it helps, remember that you can type * / and ^ for multiplication, division and exponentiation.</item>
<item>Stuck? Swipe horizontally to try another puzzle — you can come back to this one later.</item>
<item>Stuck? You can skip this puzzle for now and return to it later. Try swiping horizontally.</item>
<item>Keep trying!</item>
<item>Need some help? Use the share button at the top right to ask a friend.</item>
<item>Stuck? Use the share button at the top right to ask your friends for help!</item>
<item>Do your friends enjoy probability puzzles? Use the share button to ask them for help!</item>
<item>You can ask a friend for help — try using the share button at the top right!</item>
<item>Keep thinking!</item>
<item>Keep trying, I bet you\'ll figure it out soon!</item>
<item>You can solve this puzzle. Keep trying!</item>
<item>You can do this!</item>
<item>Your brain is getting great exercise — keep going!</item>
<item>Think of this as mental exercise — keep going!</item>
<item>You\'ll get much better at these with practice. Keep it up!</item>
<item>Hang in there — no shirking!</item>
<item>You\'re not there yet — keep trying!</item>
<item>C\'mon, you can do it!</item>
<item>Who\'s tougher, you or this puzzle?</item>
<item>Hey, don\'t let this puny little puzzle push you around.</item>
<item>That\'s not the answer I was looking for. Don\'t worry, there\'s no penalty for incorrect answers.</item>
<item>There\'s no penalty for incorrect answers. Keep trying!</item>
<item>You can do this — focus!</item>
<item>Focus! You can solve this one.</item>
<item>Hang in there!</item>
<item>You can figure this out — hang in there.</item>
<item>You aren\'t just guessing random numbers, are you?</item>
<item>Perhaps the answer will come to you in your sleep.</item>
<item>Try going for a long walk — it\'ll stimulate your creativity.</item>
<item>Don\'t worry, nobody saw that.</item>
<item>Stuck? Swipe horizontally to try another puzzle.</item>
<item>Swipe horizontally and try another puzzle if you\'re stuck (you can always return to this one later).</item>
<item>Are you stuck? Go ahead and skip to the next puzzle — I won\'t tell anyone.</item>
<item>Having trouble? Try another puzzle and return here later.</item>
<item>This puzzle isn\'t clicking for you? Swipe horizontally to try another one.</item>
<item>You aren\'t there yet. Keep trying, it\'ll feel great when you figure it out!</item>
<item>Keep trying! The best way to learn is to challenge yourself.</item>
<item>Stuck? Try the hint button at the bottom of the screen.</item>
<item>Try reading the hint at the bottom.</item>
<item>Want to come back to this one later? Swipe horizontally to try another puzzle.</item>
<item>Having trouble? There\'s a hint button at the bottom.</item>
<item>Difficult puzzle? Try reading the hint at the bottom of the page.</item>
<item>Don\'t give up — you can figure this out!</item>
<item>Swipe horizontally to try anther puzzle (you can come back here later).</item>
</string-array>
<string-array name="images_intro">
<item></item> </string-array>
<string-array name="hints_intro">
<item>Try typing 0.4, .4 (the zero before the decimal is optional), 40\%, 4/10, or 2*1/5.</item>
<item>The answer is .49^3. You could also type .49*0.49^2, if you felt like it, or .49*.49*.49.</item>
<item>Type 4! (yes, the exclamation mark is part of the answer!), or try 4*3*2.</item>
<item>Type -.7 + .2 + 0.1*4, or 70\%*(-1) + 20\% + 10\%*4 if you prefer. Want to avoid all that typing? The answer is -0.1.</item>
<item>Type the letter e in lowercase.</item>
<item>Solve the equation for p and you should find p = 6/11, which, as expected, is slightly larger than 50 percent (i.e. Annie has a slight advantage). If you want a challenge, try arriving at the same answer by summing the infinite series p = 1/6 * (1 + (5/6)^2 + (5/6)^4 + (5/6)^6 + …).</item>
<item>The point is chosen uniformly at random from the square, so the answer is simply the area of the circle divided by the area of the square. The circle has area pi*(D/2)^2, the square has area D^2, so the answer is pi/4. You can type pi directly into your answer.</item>
</string-array>
<string-array name="puzzles_intro">
<item>Hello, welcome to the app! A probability is a number between 0 and 1 measuring the likelihood of some event. An event with probability 1 is certain to happen, while an event with probability 0 will (roughly speaking) never occur. (Look up the phrase \"almost surely\" if you\'d like a more rigorous definition of what probabilities of 0 or 1 actually mean.) If you toss a fair coin, for example, there\'s a 50\% probability it will come up heads.
\n\nLet\'s pretend you\'ve just solved a difficult probability puzzle whose answer is .4, i.e. 40\%. Type that answer below and hit submit. The app uses a math parser that understands most mathematical operations: you could type 2*0.20, .30+.10, or (80\%)/2, and they\'d all be accepted as correct — or you can keep things simple and type .4, 0.4 (the zero before the decimal is optional), or 40\%.</item>
<item>When two events A and B are independent (which means that the outcome of one event does not affect the probability of the other), you can find the probability that both A and B occur by multiplying their probabilities. For example, suppose that babies are born female with probability 0.49 (and male with probability 0.51), and that births are independent. If a couple has two children, the probability that they are both girls is 0.49*0.49, or 0.49^2. The symbol ^ represents exponentiation (i.e. raising a number to a power).
\n\nIf a couple has three children, what\'s the probability that all three are girls? Using the same rule as above, the answer is .49^3. Try typing that below. If you don\'t like the ^ symbol, you could also type .49*.49*.49.</item>
<item>How many ways are there for three friends — Alice, Bob, and Charles — to arrange themselves in a line? There are three possibilities for who goes first (A, B, or C), times two possibilities for who goes second (because there are only two people remaining after we put someone at the front of the line). The answer is 3*2=6.
\n\nHow many ways are there for four friends to arrange themselves in a line? Following similar reasoning, you\'ll see that the answer is 4*3*2. It turns out that this type of number appears often in probability and combinatorics, and you can write it as 4! (read this as \"four factorial\"). The math parser understands factorials: try typing 4! in the answer below (or type 4*3*2, or 24, or whatever else your heart desires).</item>
<item>You\'ll often see the term \"expected value\" in probability problems. An expected value is essentially a probability-weighted average. For example, let X denote the amount you\'ll win next time you gamble at a casino. If X can take only a finite number of values, the expected value of X, denoted E[X], is simply a probability-weighted average of its possible values. (I am describing discrete random variables; expected values for non-discrete random variables are more complicated, but we\'ll leave that aside for now.)
\n\nLet\'s imagine a simple distribution for X: with 70\% probability you\'ll lose a dollar (X=-1); with 20\% probability, you\'ll gain a dollar (X=1); and with the remaining 10\% probability, you\'ll win a massive payoff of four dollars (X=4). The expected value of your gains is E[X] = 0.7*(-1) + 0.2*1 + 0.1*4 — and that\'s the answer to this puzzle! You\'ll find that your expected gains are negative, which means the casino makes money on average.
</item>
<item>The mathematical constant e — Euler\'s number — sometimes shows up in probability problems. There are several ways to express e; one way is the limit as N goes to infinity of (1+1/N)^N. You won\'t see it often in this app, but there are a few harder puzzles whose answer involves e. Fortunately, the parser understands mathematical constants like e and pi. Try typing lowercase e into the answer field below.</item>
<item>Here\'s an example of a trick that simplifies an otherwise difficult puzzle. Suppose Andrew and Annie are playing a game involving a six-sided die: they\'ll take turns rolling the die, and the first person to get a six wins. If Annie goes first, what\'s the probability that she wins? Intuitively, she should have the advantage (since she might get a six on her first roll and win immediately, before poor Andrew even has a chance to play). But what\'s her exact probability of winning?
\n\nThis puzzle can be solved by summing an infinite series, but there\'s an easier way. Let p denote the probability that a player wins the game if it\'s their turn to play. Their probability of winning immediately is 1/6. In addition, if the game is not over two tosses from now (so that it is again their turn), their probability of winning is still p. We therefore have the following equation: p = (1/6) + (5/6)^2 * p, where (5/6)^2 is the probability of two non-sixes in a row. Solve for p to find Annie\'s probability of winning the game.</item>
<item>Here\'s an example that uses the mathematical constant pi. Picture a circle inscribed inside a square: the circle has diameter D, the square\'s edges have length D, and the circle and the square are centered on the same point.
\n\nIf you select a point uniformly at random from the square (picture a poorly-thrown dart, for example), what\'s the probability that the point falls inside the circle?</item>
</string-array>
<string-array name="answers_intro">
<item>0.40</item>
<item>0.49^3</item>
<item>4!</item>
<item>0.7*(-1) + 0.2*1 + 0.1*4</item>
<item>e</item>
<item>6/11</item>
<item>pi/4</item>
</string-array>
<string-array name="images_0">
<item>two_heads_caesar</item>
<item>socks</item>
<item>dice_small</item>
<item>dice_two_six_small</item>
<item>two_girls_small</item>
<item></item>
<item></item>
<item></item>
<item>berries</item>
<item></item>
<item></item>
<item>eight_children_small</item>
<item>monty</item>
<item>roll_7_small</item>
<item>gay_straight</item>
<item>intransitive_dice</item>
<item>life_expectancy_small</item>
<item></item>
<item></item>
<item>backgammon_small</item>
<item>ct_vote_table_small</item>
<item>two_girls_small</item>
<item></item>
<item></item>
<item></item>
<item>random_breakpoint_small</item>
<item>clock_noon</item>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
<item>seven_lines</item>
</string-array>
<string-array name="hints_0">
<item>The answer is (1/2)^2 or 1/4. When events A and B are independent, Pr[A and B] = Pr[A]*Pr[B]. In this case, A denotes a head on the first toss, and B a head on the second; all you have to do is multiply their probabilities. Intuitively, independence means that the outcome of one event does not affect the probability of the other: no matter what happens on the first toss, the second still has a fifty-fifty chance of heads.</item>
<item>No matter what sock you draw first, the chance that the second will be the same color is… some number, which is precisely the answer you\'re looking for. For example, suppose you draw red first: conditional on the first sock being red, the probability that the second sock is also red is 1 out of 5. Notice that this is true no matter which sock you draw first. See https://math.stackexchange.com/questions/2750340/whats-the-probability-of-choosing-two-socks-of-the-same-color-from-three-pairs for a detailed answer.</item>
<item>If A, B and C are mutually exclusive events — like rolling a 2, a 4 or a 6 — you have Pr[A or B or C] = Pr[A]+Pr[B]+Pr[C]. Just add up those three probabilities. Each individual outcome has probability 1/6, and adding three of them together gives…</item>
<item>There are 6*6=36 possible pairs of outcomes, all equally likely. Which ones add up to a total of 12? You\'d have to get a 6 on both the first and second roll. There\'s only one way for that to happen, so the answer is…</item>
<item>As in the first question, independence means that Pr[A and B] = Pr[A]*Pr[B]. This time, A (B) is the event that your first (second) child is a girl. Multiply those probabilities and you have your answer.</item>
<item>Let A (B) denote the event that the first (second) card is an ace. These events are not independent, so you need to calculate Pr[A and B] = Pr[A]*Pr[B|A]. Pr[A] is the probability that your first card is an ace: that\'s 4/52. Pr[B|A] is the probability that your second card is an ace, given that the first was an ace (the vertical bar means \"given that\"). Can you figure out what that is? At that point, conditional on event A, you know there are 51 cards remaining, of which 3 are aces.</item>
<item>Notice that there are two ways to get a single ace: either on the first card, or the second. Those are mutually exclusive events, so you have Pr[A or B] = Pr[A] + Pr[B], where A is the event that the first card is an ace and the second is not (and B is the reverse). Calculating Pr[A] is similar to the previous question: it\'s (4/40)*(36/39). What is Pr[B]?</item>
<item>A little trick here is that, no matter what card you draw first, the probability that the second is of the same suit is…</item>
<item>Of the six possible preferences, only three are compatible with her first choice. For example, given what you know, there\'s zero probability that the monkey prefers blue to yellow to red, but there\'s a 1/3 probability that she prefers yellow to red to blue. This puzzle was inspired by a New York Times article: see https://www.nytimes.com/2008/04/08/science/08tier.html and specifically the discussion following the sentence \"Dr. Chen says that the monkey’s distaste for blue can be completely explained with statistics alone\".</item>
<item>Put all the white marbles in one urn (left), and all the black ones in the other (right). You have a fifty-fifty chance of survival. Now remove one white marble from the left urn and place it to the right. Do your chances improve?</item>
<item>Notice that, of the games that end after one round (i.e. after the first two coin tosses, which must have been either HT or TH), Bob and Alice are each expected to win half. If instead the first two tosses were either HH or TT, we continue to the second round. Conditional on the game ending in the second round, Bob and Alice are again equally likely to win. Do you notice the pattern?</item>
<item>For any event A, Pr[A] = 1 - Pr[!A] where !A means \"not A\", i.e. the complement of A. Sometimes it\'s easier to calculate Pr[!A], which in this case is the probability that all 50 families have at least one child of each gender. Start by figuring out the probability that an 8-person family has at least one child of each gender — call that p. Using the \"not A\" trick will also help you figure out p (look at the bar graph: you need to subtract off the leftmost and rightmost probabilities). Your final answer will be 1 - p^50.</item>
<item>Before Monty does anything, the probability that your initial choice is correct is 1/10. Does that change after he shows you 8 goats?</item>
<item>When tossing two fair dice there are 6*6 = 36 possible outcomes, all equally likely. The image is intended to hint at the solution without giving it away immediately: the circles are brighter when the sum of the two rolls is closer to seven.</item>
<item>If everyone were gay the answer would be 0.9, while if everyone were straight the answer would be 0.1. In the situation we\'re thinking about, the answer is a weighted average of those two numbers. Do you understand why?</item>
<item>A straightforward way to calculate the probability that one die beats another is to condition on the outcome of one of their rolls. For example, if the red die comes up 2, there\'s a 0/3 chance that it will beat blue; but if it comes up 4, it has a 1/3 chance. What if red comes up 9? Do you see how taking an average of those conditional probabilities will give you the correct answer? See https://en.wikipedia.org/wiki/Intransitive_dice and http://singingbanana.com/dice/article.htm for a detailed explanation.</item>
<item>A first hint is to show how life expectancy at birth was calculated: 0.2*(1 + 6 + 20 + 50 + 80) = 31.4. How can you modify that to get the answer we\'re looking for? Conditional on surviving to age 30, the probability of dying before age 30 must be zero. What about the (conditional) probability of dying between age 70 and 90? The numbers in this puzzle are made up, but they are intended to be semi-realistic -- see https://www.bbc.com/future/article/20181002-how-long-did-ancient-people-live-life-span-versus-longevity for a more detailed discussion of life spans in ancient Rome.</item>
<item>An expectation is essentially an average. If you guess $1000, for example, you have a 0.01 chance of being correct, so you\'ll win 0.01 * 1000 + 0.99 * 0 = 10 dollars on average. You\'ll find that the answer is neither the most likely dollar amount (0 dollars), nor the largest (1,000 dollars)!</item>
<item>If p is the probability that female applicants apply to department A, the probability that they apply to department B is necessarily (1 - p), because we\'re assuming that each applicant chooses exactly one department. Can you express women\'s overall acceptance rate as a function of p and their two department-specific acceptance rates (i.e. 0.5 at A and 0.2 ar B)?</item>
<item>As in the earlier two-die problems, there are 36 possible outcomes, all equally likely. All you have to do is count the ones that let black eat white\'s piece, making sure not to double count. The figure shows two possible moves (a jump of 6 steps, or a 4 followed by a 2), but there are many more.</item>
<item>T has a single path to victory: he needs voters 3 and 4 to vote for him. The probability that C wins is therefore one minus the probability that voters 3 and 4 both go for her opponent. The question tells you that Pr[Voters 3 and 4 both choose C] = 0.6*2/3 = 0.4. Can you figure out Pr[Voters 3 and 4 both choose T]? Try filling out the 2-by-2 table of probabilities at the bottom of the puzzle. Each voter has a 60\% probability of choosing C, which means that the C row and C column of the table must each add up to 0.6; similarly, the T row and column must each add up to 0.4. As you\'ve probably guessed, this puzzle was inspired by the 2016 presidential election in the US, and more specifically by https://fivethirtyeight.com/features/election-update-why-our-model-is-more-bullish-than-others-on-trump/ and https://fivethirtyeight.com/features/why-fivethirtyeight-gave-trump-a-better-chance-than-almost-anyone-else/ -- the point about correlation in polling errors among US states is somewhat analogous to the correlation between voters in this simple puzzle.</item>
<item>An earlier puzzle asked for the probability of two girls (out of two children): that probability is 0.49^2. What I\'m looking for here is the probability of two girls conditional on having at least one girl (i.e. not having two boys). Since the probability of having two boys is 0.51^2, the probability of at least one girl is 1-0.51^2. Can you combine those pieces of information to get the answer?</item>
<item>You\'ll go running if you aren\'t chosen to go swimming. The probability you are\'t chosen as the first person is 49/50. Given that you aren\'t chosen as the first person, the probability you aren\'t chosen as the second is 48/49. Notice that Pr[not chosen first and not chosen second] = 48/50, i.e. the 49s cancel out. You\'ll end up with a very intuitive and simple answer.</item>
<item>The answer might be more obvious if you imagine a large population of investment funds. Suppose there are 1000 of them: on average, 400 will beat the market and continue operating, 300 will underperform and continue operating, and the remaining 300 will underperform and exit. Of those that continue operating, what fraction beat the market?</item>
<item>Bayes\' rule for conditional probabilities is Pr[A | B] = Pr[A and B] / Pr[B]. The vertical bar means \"given that\", and Pr[A | B] is the probability of A given that B has happened (i.e. we observe B and wonder how likely A is, given what we know). What can we say about Pr[A | B] and Pr[B | A] under the assumption that Pr[A] = Pr[B]?</item>
<item>The probability that the right piece has length less than L equals the probability that the left piece has length greater than (1 - L), which is simply 1 - (1 - L) = L. By symmetry, then, the average lengths of the left and right pieces must be equal, i.e. E[length of left piece] = E[length of right piece] where E denotes expectation. Moreover, those two expected values must add up to the total length of 1. Do you see how that gives the answer?</item>
<item>In order for the hour hand to point to 2 after 3 hours, it needs to have gotten stuck exactly once (and moved correctly twice). The key is to realize that there are three different ways that could happen: stuck-move-move, move-stuck-move or move-move-stuck. What is the probability of each sequence? Adding up those probabilities gives the answer.</item>
<item>The question asks for the probability that you contact 3 undecided voters, 1 supporter and 1 opponent — regardless of order. To simplify, calculate the probability of contacting people in a specific order (e.g. U-U-U-S-O), and then multiply that probability by the number of possible rearrangements of that sequence (e.g. U-U-U-O-S is another possible order, as is O-U-U-S-U). It turns out there are 20 ways to rearrange the sequence — can you figure out why that is?</item>
<item>Suppose you choose a letter uniformly at random, independently of what your friend does. Your friend will think of some letter, e.g. Z: conditional on her choice, your chance of guessing correctly is 1/26. In fact, this will be true regardless of which letter she picks, and therefore regardless of her policy for choosing letters.</item>
<item>Think of one of the genders as being in a fixed order — for example, let\'s say the girls are ordered (G1, G2, ... , G5). All we have to do to pair each girl with a boy is to come up with an ordering of the 5 boys; we then pair G1 with the first boy in the boys\' list, G2 with the second boy in the boys\' list, et cetera. How many ways are there to reorder (i.e. permute) the 5 boys? The answer is easily expressed using a factorial, i.e. N! for some integer N.</item>
<item>The answer is easily expressed using factorials. One approach is to start with 12! — i.e. the number of ways to order 12 people — and then divide by the number of ways people can be reordered within teams. Another way is to start with C(12, 4), i.e. the number of ways people can be assigned to team A, and then multiply by the number of ways the remaining 8 people can be assigned to teams B and C.</item>
<item>There are 6! ways to arrange 6 people in a line, and there are 10 ways for person A and person B to be next to each other. For each of those 10 configurations where A and B are neighbors, how many ways can you arrange the remaining 4 people?</item>
<item>Coming up with this strategy is tricky, but, now that you know it, it should be easy to find the group\'s probability of winning. Interestingly, the probability is much larger than 50\%. The group will lose if all hats are white (because they will each observe two white hats and guess that their own is black); similarly, the group will lose if all hats are black. The probability that all hats are the same color is 2*(1/2)^3 = 1/4. Does the team guess correctly in all other cases? As a bonus, think about whether there exists any superior strategy (i.e. one with a higher probability of winning).</item>
<item>Since no two lines are parallel (and no three lines intersect at a single point), any choice of three lines will produce a triangle. How many ways are there to choose a subset of three objects from a set of seven? The answer can be expressed as \"N choose K\" or C(N,K). Have a look at https://mathworld.wolfram.com/BinomialCoefficient.html if you haven\'t seen binomial coefficients before, and remember that you can type expressions like C(5,3) and the app\'s math parser will understand them. For a detailed answer to a similar puzzle, see https://www.nytimes.com/2019/08/21/science/math-equation-triangles-pemdas.html -- but try solving this one yourself first!</item>
<item>Interestingly, you can do better than a 1/3 probability of hiring the best candidate. (There are several strategies that would give you a 1/3 probability: for example, you could always hire the first person you interview.) Consider a rule under which you always interview the first two people. Clearly, if the second candidate is worse than the first, you should reject them (since all you care about is hiring the best person). Do you see what strategy this leads to? If you\'d like to read a more detailed solution to a generalized version of this problem, see https://math.stackexchange.com/questions/45266/secretary-problem-why-is-the-optimal-solution-optimal. Keep in mind that the optimal strategy depends on your objective, which in this case has an \"all or nothing\" quality. See puzzle 17 in the Getting Serious section for a related decision problem with a very different payoff function.</item>
</string-array>
<string-array name="puzzles_0">
<item>Julius Caesar tosses two fair coins.
\n\nAssuming the tosses are independent, what\'s his probability of getting two heads?</item>
<item>Six individual socks are sitting in your drawer: two red, two blue, and two purple. It\'s dark — you can\'t see a thing.
\n\nYou pick a first sock uniformly at random, and then a second sock (again at random) from the remaining five.
\n\nWhat\'s the probability you end up with two socks of the same color?</item>
<item>When rolling a fair six-sided die, what\'s the probability of getting an even number?</item>
<item>You roll two fair — and independent — six-sided dice.
\n\nWhat\'s the probability that the sum of the numbers equals its maximum possible value, i.e. 12?</item>
<item>Suppose babies are boys with probability 0.51, girls with probability 0.49, and births are independent.
\n\nIf you have two children, what\'s the probability they\'re both girls? The graph below gives a rough answer, but I\'m looking for the exact number.</item>
<item>A friend places a perfectly shuffled deck of 52 cards in front of you, and kindly reminds you that a standard deck contains four aces.
\n\nIf you draw two cards (without peeking), what\'s the probability they\'re both aces?</item>
<item>This is continuation of the previous question: you\'ve drawn your two cards and, tragically, neither of them is an ace.
\n\nYour friend is feeling generous: she lets you draw ten additional cards. Still no luck. You know there are 40 cards remaining in the deck, of which four are aces.
\n\nIf your friend now draws two cards, what\'s the probability she gets exactly one ace?</item>
<item>Once again you\'re confronted with a perfectly shuffled deck of 52 cards — which contains four suits of 13 cards each, as your friend kindly points out.
\n\nIf you draw two cards, what\'s the probability they\'re of the same suit?</item>
<item>Imagine for a moment that monkeys eat only three types of berries — blue, red, and yellow — and that monkeys have preferences. For example, some believe red berries are best, followed by blue, then yellow (R > B > Y).
\n\nMonkeys\' preferences are strict: there are no ties, leaving us with only six possible orderings of the berries.
\n\nAll preferences are equally likely: one sixth of the monkey population feels that R > B > Y; another sixth believes instead that R > Y > B. I haven\'t told you about the preferences of the remaining four sixths, but you can figure them out by listing the remaining orderings of the berry colors.
\n\nYou meet a random monkey and give her a choice between a red and a blue berry. She picks red. Now you offer red or yellow — given her earlier choice, what\'s the probability she\'ll again choose red?</item>
<item>You\'ve stolen from the king and been thrown in jail. The king is magnanimous, however, and rather than having you drawn and quartered on the spot, he allows you to play a little game.
\n\nYou\'re given 100 marbles — 50 black and 50 white — and you must place them in two urns, in any way you like, as long as you obey the king\'s rules.
\n\nYou must place all the marbles, and neither urn can be left empty. Each urn will be shaken so that the marbles are all jumbled up — the order in which you place them doesn\'t matter.
\n\nThe king will then follow a simple procedure: he will pick an urn uniformly at random (i.e., either one is equally likely to be chosen); and from that urn, he will draw a marble uniformly at random. If it\'s white, you live; but if it\'s black, you\'ll be fed to the lions, or perhaps drawn and quartered — the king hasn\'t yet made up his mind.
\n\nYou could place all the white marbles in one urn, and all the black in the other, in which case your chances are fifty-fifty — but you can do better than that! If you place the marbles in the best way possible, what is your probability of survival?</item>
<item>Two friends, Alice and Bob, have found an unfair coin: it has a 72\% chance of coming up heads. I have no idea what such a coin would look like, but let\'s just pretend it exists.
\n\nAlice proposes a game: she\'ll toss the coin twice; if it comes up heads then tails, she wins; if it\'s the reverse (tails then heads), Bob wins; and if neither of those two things happens, the game restarts, and continues until there is a winner.
\n\nWhat\'s Bob\'s probability of winning?</item>
<item>We\'re thinking about children again — let\'s stick with our assumption that babies are boys with probability 0.51, girls with probability 0.49, and births are independent.
\n\nYou\'re a researcher interested in large families: as part of your latest project, you\'ve decided to interview 50 families in which there are exactly eight children. The graph below illustrates the possible outcomes for a single family. What\'s the probability that you find one or more families in which the children are all of the same gender (i.e. all boys or all girls)?</item>
<item>You\'re a contestant on a game show hosted by Monty Hall. In front of you are 10 closed doors: one hides an expensive car, but behind the other 9 there are only goats.
\n\nYou choose a door. Monty then does something very generous: of the 9 doors you didn\'t pick, he opens 8 goat-doors. Baaa! Notice that Monty can always do this, regardless of whether your initial choice was correct. (If your initial guess was correct, Monty has several ways to choose which doors he\'ll open: assume he picks randomly.)
\n\nAt this point there are only two closed doors: one hides a car, the other a goat. Monty asks whether you prefer to stick to your original choice, or switch.
\n\nIf you switch, what\'s your probability of winning the car?</item>
<item>You roll two fair six-sided dice.
\n\nIf we make the usual assumption that rolls are independent, what\'s the probability that the sum of the numbers equals 7?</item>
<item>Suppose 0.05 of the population is gay, and for simplicity let\'s assume the remaining 0.95 are straight. Susie doesn\'t know the overall numbers, but she can guess peoples\' sexual orientation with 90% accuracy.
\n\nIn other words, if someone is gay, there\'s a 0.9 chance Susie will correctly identify them as gay (and a 0.1 chance she\'ll mistakenly think they\'re straight); a similar statement holds if someone is straight.
\n\nInterestingly, Susie will overestimate the overall percentage of people who are gay, and by quite a large margin. If she meets someone drawn randomly from the population, what\'s the probability she\'ll think they\'re gay?</item>
<item>Consider the three dice below: they each have six faces, but let\'s assume the hidden opposite faces are identical to those shown. That means the red die has a 1/3 probability of rolling a 9, for example.
\n\nThe red die is \"stronger\" than the green, in the sense of having a 5/9 probability of rolling a larger number. (In other words, it wins more than half the time.) Similarly, the green die is stronger than the blue, again with a 5/9 probability of getting the higher roll.
\n\nYou might think that red > green > blue means that red is strongest overall, but, surprisingly, that isn\'t true. When rolling red against blue, what\'s the probability that the red die shows the larger number?</item>
<item>Suppose ancient Romans had a 0.2 chance of dying in each of the following age intervals: [0, 2], [2, 10], [10, 30], [30, 70] and [70, 90].
\n\nTo keep calculations straightforward, let\'s assume that, conditional on dying in any one of those five buckets, age at death was uniformly distributed across the interval. That means that, conditional on dying between age 0 and 2, the average Roman lived to be 1 year old; conditional on dying between age 2 and 10, the average was 6 years; et cetera. Under these (fictitious) numbers, life expectancy at birth was only 31.4 years, due largely to child mortality.
\n\nWhat was the life expectancy (i.e. expected age at death) of an ancient Roman who was still alive at age 30? It\'s much more than 31.4 years — can you figure out why?</item>
<item>A friend of yours proposes a game: if you correctly guess the amount of money in his wallet, the cash is yours; otherwise, you get nothing. You\'re allowed a single guess.
\n\nYou believe there\'s a 50 percent chance your friend has $0 in his wallet, a 25 percent chance of $1, 24 percent of $100 and — excitingly — a one percent chance he has $1,000.
\n\nWhat dollar amount should you guess in order to maximize your expected winnings?</item>
<item>The graduate school at the University of California, Berkeley, is composed of two departments — call them A and B.
\n\nAt department A the acceptance rate is 0.5 for both men and women. At department B, however, the rate is 0.1 for men and 0.2 for women — so, clearly, women are at least as likely to be accepted as men, regardless of where they apply.
\n\nSurprisingly, however, the overall acceptance rate at Berkeley, both departments combined, is 0.3 for men but only 0.25 for women. How can that be?
\n\nLet\'s assume each applicant chooses only one department (they apply to either A or B, but not both). Male applicants must be split equally between A and B; indeed, that implies an overall acceptance rate of (0.5 + 0.1)/2 = 0.3 among men. What fraction of female applicants choose department A?</item>
<item>Backgammon is an ancient two-player game combining strategy and luck. Suppose it\'s the black player\'s turn to move: she controls two pieces, and she\'d like to capture a vulnerable white piece six steps ahead.
\n\nShe will roll two dice, and she\'ll be able to capture white if — and only if — she rolls at least one six, the sum of her two rolls equals six, or she rolls double twos. (In backgammon doubles are played twice, so a player who rolls double twos is allowed to make four moves of distance two.) What\'s the probability that black will be able to capture white on her next move?</item>
<item>Two candidates, a demagogue named T and a woman named C, are competing for the presidency of a small country with a total voting-age population of five people. Voters 1 and 2 are both certain they\'ll vote for C, while voter 5 has chosen T. (Let\'s assume the candiates don\'t vote — or, if you prefer, C is voter 1 and T is voter 5.)
\n\nVoters 3 and 4 are undecided: each has a 40\% probability of voting T (and a 60\% probability of voting C). Interestingly, their votes are correlated (perhaps they discuss politics together — it\'s a small country, after all): conditional on voter 3 choosing C, there is a 2/3 chance that voter 4 will do the same.
\n\nWhat\'s the probability that C wins the election (i.e. that she wins a majority of the country\'s five votes)?</item>
<item>Let\'s return to our favorite assumption regarding babies: they are boys with probability 0.51, girls with probability 0.49, and gender is independent across births.
\n\nYou meet a couple who tell you they have two children, and you ask whether they have any daughers. If they do (i.e. they have one or two girls), what is the probability that both of their children are girls?</item>
<item>You are a twelve year old child in a gym class with 49 other kids (50 including you). The activities for the day are running (which you love) and swimming (which you detest).
\n\nThe coach will select 20 children for a trip to the pool; the remaining 30 will go running. Suppose the coach selects the swimmers in the following way: he picks a first person uniformly at random from the group of 50, then a second uniformly at random from the remaining 49, and keeps going until he has selected 20 swimmers.
\n\nWhat\'s the probability you\'ll go running?</item>
<item>Suppose that, over the course of the next year, a particular investment fund has a 40\% probability of beating the market and a 60\% probability of under-performing (perhaps they are poorly managed, or charge high fees). If the fund outperforms the market it will (certainly) continue operating for another year, but it is in danger if it under-performs: in that case there\'s a 50\% probability that its investors will angrily withdraw their money, so that the fund simply ceases to exist.
\n\nIf the fund still exists at the end of the year, what\'s the probability that it beat the market? You\'ll find that it\'s higher than the prior probability of 40\%.</item>
<item>Imagine a population of women who each have one daughter, and suppose the frequency of blue eyes is identical in the two generations.
\n\nYou survey all of the mothers with blue eyes, and find that 75\% of their daughters also have blue eyes. You wonder what would happen if you did the reverse: if you surveyed all of the daughters with blue eyes, what fraction of their mothers would have blue eyes? In other words, what is the probability that a mother has blue eyes, conditional on her daughter having blue eyes?</item>
<item>You\'re carrying a one meter long piece of wood, when suddenly you trip and drop it on the ground. How clumsy of you! The wood breaks into a left piece and a right piece, with the breakpoint uniformly distributed length-wise: for any L between 0 and 1, the left piece of wood has probability L of having a length less than L. For example, there\'s a 60\% probability that the left piece is less than 0.6 meters long.
\n\nWhat\'s the expected length (i.e. the average length) in meters of the piece to the right?</item>
<item>You have a broken analog clock on your wall: every sixty minutes the hour hand moves forward by one hour with probability 0.95, but remains stuck in place with probability 0.05. Suppose the movements are independent across hours (so that the probability of staying stuck three hours in a row is 0.05^3, for example). Let\'s ignore the minute hand and focus on the erratic hour hand.
\n\nIt is currently noon. Three hours from now, what is the probability that the clock says 2?</item>
<item>You are a volunteer for a political campaign; your assignment is to contact voters and urge them to support your candidate. You connect to an app that will randomly sample 5 phone numbers for you to call, from a database with 20 entries. The sampling is without replacement — it would be silly to call the same person twice.
\n\nSuppose 16 of the numbers in the database belong to undecided voters, 2 to people who support your opponent, and 2 to people who already support your side. (Ideally you\'d contact only undecided voters who might be convinced to join your camp, but the database isn\'t perfect.)
\n\nWhat\'s the probability that, of the 5 people you contact, 3 are undecided, 1 supports your candidate and 1 supports your opponent?</item>
<item>Your friend selects a letter at random from the 26-letter alphabet, and asks you to read her mind and guess which letter she\'s thinking of. Unfortunately, you have no way of knowing how she came up with her choice: perhaps she chose the letter Z with probability 1, or maybe she was equally likely to pick the letters A, B, C or D (each with 25\% probability). There\'s an infinity of ways to choose a random letter, and she could be following any one of them.
\n\nSuppose you decide to always guess A. You have no way of knowing the probability that your guess is correct: it could be anything from 0\% to 100\%, depending on how your friend selects her secret letter.
\n\nIt turns out there is a simple rule you can follow that guarantees a positive probability that your guess is correct, in a way that does not depend at all on what your friend is doing. If you follow that rule, what is your probability of guessing correctly?</item>
<item>A dance instructor is teaching a class of 5 boys and 5 girls, and she\'d like to pair them up into boy-girl pairs. How many different ways can she do that?</item>
<item>How many ways are there to put 12 people into 3 groups of 4 if the groups are distinct? Think of the groups as having names, e.g. group A, group B and group C.</item>
<item>How many ways are there for 6 people to arrange themselves in a line, if two of the people (call them A and B) are mortal enemies, and refuse to stand next to each other?</item>
<item>Three friends are playing a game involving black and white hats. At the beginning of the game, each person is randomly assigned a hat color, black or white, independently from everyone else and with 50-50 probability.
\n\nImagine that people cannot see what\'s on their own head, and only observe the colors of their two friends\' hats. No communication is allowed. The players must simultaneously guess the color of their own hat (or decline to guess). The entire group wins a prize if at least one of them guesses correctly and nobody guesses incorrectly.
\n\nSuppose the team adopts a \"contrarian\" strategy: anyone who observes two white hats will guess that their own hat is black; anyone who observes two black hats will guess that their own hat is white; and anyone who observes anything else will decline to guess. At the beginning of the game (before the hat colors are assigned), what is the probability that the group wins the prize?</item>
<item>How many different triangles can you form from the seven lines below? Note that none of the lines are parallel, and imagine that they extend infinitely far beyond the edges of the image. We assume that no more than two lines cross at the same point.</item>
<item>You are hiring a new CEO and three people have applied for the position. Your goal is to maximize the probability that you hire the best of the three, but you don\'t know ahead of time which candidate is best.
\n\nSuppose you must interview candidates sequentially (for some reason you cannot interview them in parallel), and must make an immediate hire/reject decision at the end of each interview. The only information you can base your decision on is how the current candidate performed relative to the earlier candidates: you know whether they were the best of the people you\'ve interviewed so far, but you don\'t know how they\'ll compare to the people you haven\'t spoken to yet. (For simplicity, assume the candidates never reject your offer.)
\n\nFor example, you might reject the first candidate, and then interview and hire the second candidate, in which case you never get to meet the third person in line.
\n\nUnder the optimal hiring strategy, what is your probability of hiring the best candidate?</item>
</string-array>
<string-array name="answers_0">
<item>1/4</item>
<item>1/5</item>
<item>1/2</item>
<item>1/36</item>
<item>0.49^2</item>
<item>(4/52)*(3/51)</item>
<item>2*(4/40)*36/39</item>
<item>12/51</item>
<item>2/3</item>
<item>1/2 + (1/2)*49/99</item>
<item>1/2</item>
<item>1-(1-0.51^8-0.49^8)^50</item>
<item>9/10</item>
<item>6/36</item>
<item>0.05*0.9 + 0.95*0.1</item>
<item>4/9</item>
<item>65</item>
<item>100</item>
<item>1/6</item>
<item>17/36</item>
<item>1-0.2</item>
<item>0.49^2 / (1 - 0.51^2)</item>
<item>30/50</item>
<item>0.4/(0.4 + 0.6*0.5)</item>
<item>0.75</item>
<item>1/2</item>
<item>3*0.05*0.95^2</item>
<item>140/969</item>
<item>1/26</item>
<item>5!</item>
<item>12!/(4!*4!*4!)</item>
<item>6! - 10*4!</item>
<item>3/4</item>
<item>C(7,3)</item>
<item>1/2</item>
</string-array>
<string-array name="images_1">
<item></item>
<item>birthday_alpha</item>
<item>birthday_alpha</item>
<item>two_heads_caesar</item>
<item></item>
<item>one_girl_out_of_three_small</item>
<item></item>
<item></item>
<item></item>
<item>proba_join_small</item>
<item></item>
<item></item>
<item>dominos</item>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
<item></item>
<item>conditional_correlation</item>
<item></item>
<item></item>
<item>income_small</item>
<item>random_breakpoint_small</item>
<item>clock_noon</item>
<item></item>
<item></item>
<item></item>
<item>vote_counting_easy_small</item>
<item></item>
<item>circle_and_triangle_alpha</item>
</string-array>
<string-array name="hints_1">
<item>One approach is to sum an infinite sequence. Another is to notice that the problem either ends or restarts after the first toss: this lets you express the answer recursively, meaning you can set up an equation where the answer appears on both sides. See https://math.stackexchange.com/questions/605083/calculate-expectation-of-a-geometric-random-variable for a solution to a similar problem.</item>
<item>For any event A, Pr[A] = 1 - Pr[!A] where !A means "not A", i.e. the complement of A. Sometimes it\'s easier to calculate Pr[!A], which in this case is the probability that all three birthdays are different. If we were asking about only two people, the answer would be 1 - 365/365 * 364/365, because the first birthday could be any day, and there are 364 equally likely days that differ from the first birthday. Do you see how to generalize that to three people? If the first two birthdays are different from one another, there are 363 ways the third birthday can differ from both of the first two. For an even more detailed hint, swipe horizontally to the following question and check its hint.</item>
<item>Solve the previous puzzle first, and express the answer as a function of the number of people in the group. You may need a calculator for this one. If you are still stuck, a big hint is that this is a famous puzzle called the birthday paradox (or birthday problem), and it is covered in many intro stats classes and textbooks. You can find many detailed solutions online, including https://stats.stackexchange.com/questions/210360/birthday-problem-difference-between-canonical-solution-and-approximation and https://en.wikipedia.org/wiki/Birthday_problem and many more if you search for birthday paradox solutions.</item>
<item>Try conditioning on the outcome of the first (or first two) tosses. Notice that the problem resets whenever you toss a tail: this allows you to express the answer recursively, i.e. you can set up an equation in which the solution appears on both sides.</item>
<item>This is a classic Bayes\' rule question: Pr[A | B] = Pr[A and B] / Pr[B], where Pr[A | B] is the probability of A given B. Intuitively, you\'re restricting your attention to the cases when B happens (the coin comes up heads), and asking how often A also happens (the coin is fair).</item>
<item>Notice that there are three ways for exactly one of your three children to be a girl: she could be born first, second or third. If you\'re still stuck, try reading up on the binomial distribution.</item>
<item>This is another Bayes\' rule question: Pr[A | B] = Pr[A and B] / Pr[B], where Pr[A | B] is the probability of A given B. Try thinking in terms of population frequencies: how many people (on average) will test positive? Of those, how many will have the disease?</item>
<item>This question combines Bayes\' rule and a simple application of the binomial distribution. You\'ve used both in earlier puzzles! See https://math.stackexchange.com/questions/1255613/probability-of-a-double-headed-coin for the solution to a similar puzzle.</item>
<item>The trick here is to use linearity of expectation: for any random variables X and Y, E[X + Y] = E[X] + E[Y]. The operator E denotes expectation, which is essentially an average. Can you express the answer to this problem (the total waiting time) as a sum? If you\'re still stuck, here is a big hint: this puzzle is the classic coupon collector\'s problem. See http://mat.uab.cat/matmat/PDFv2014/v2014n02.pdf or https://en.wikipedia.org/wiki/Coupon_collector%27s_problem for a detailed explanation.</item>
<item>Here\'s a helpful fact about the binomial distribution: given n independent trials, each with success probability p, the probability of exactly k successes is: (n choose k) * p^k * (1-p)^(n-k). The (n choose k) term is the number of subsets of size k that can be created from a set of size n. If that sounds like complete gibberish, try reading up on the binomial distribution.</item>
<item>Try solving the reduced version of the problem in which it\'s A\'s turn to shoot but B is already dead. Notice that the problem restarts whenever A and C both miss (i.e. whenever it\'s A\'s turn to shoot).</item>
<item>You can express the answer to this problem in terms of subproblems in which the grasshopper has fewer steps to take.</item>
<item>This one will be very easy if you\'ve already solved the previous question. If you haven\'t, try answering the same question for a 2-by-1 board, a 2-by-2, 2-by-3, et cetera, and see whether you notice the pattern.</item>
<item>You\'ll blaze through this problem if you\'ve solved the previous two. For bonus points, try finding the general formula as a function of the string length.</item>
<item>This game ends after three stages, so you can use backward induction: find the optimal third-stage strategy; then the optimal second-stage strategy; et cetera.</item>
<item>Notice that the problem ends — in the sense that you know whether someone will ever sit in the last person\'s seat — as soon as someone sits either in the first or last seat.</item>
<item>If you reject the proposal, the game effectively restarts: that suggests that your acceptance rule should be the same in every period. Moreover, you\'ll follow a simple cutoff rule, i.e. accept if and only if the proposal is above some threshold. You can express the value as a function of the cutoff, which is easy if you use the fact that the game restarts when you reject. Remember to discount the continuation value.</item>
<item>Try solving the puzzle when the initial population is one instead of two. Do you see the connection between that number and the answer we\'re looking for? The population dies out if all branches die out, where "branch" means all of the descendants of a particular bacterium in the initial population. If you need more help, look up branching processes and extinction probabilities (see http://wwwf.imperial.ac.uk/~ejm/M3S4/NOTES2.PDF or https://web.ma.utexas.edu/users/gordanz/notes/lecture7.pdf for example).</item>
<item>Try using the inclusion-exclusion principle: for any two events A and B, Pr[A or B] = Pr[A] + Pr[B] - Pr[A and B]. Can you figure out how to extend the principle to three events?</item>
<item>If you try and calculate the probability of each possible number of blocks, you\'ll probably get stuck. Instead, try defining the answer as a sum and using linearity of expectation.</item>
<item>Follow the same hint as for the previous puzzle: use linearity of expectation. As a bonus, you should check that the weather distribution given in the question is indeed stationary given the transition probabilities.</item>
<item>Remember, we\'re assuming that, initially, there\'s an equal number of red and black marbles in the urn. For the question to even make sense, we need four or more marbles in total. Can you set up an equation in one unknown that gives you the answer?</item>
<item>Conditional on attending university, math ability is no longer uniformly distributed — you\'ll see that its mass shifts rightward. Try figuring out the probability of having math ability below x, conditional on attending college.</item>
<item>The question asks for the probability that a child chosen uniformly at random — across all children in the population — is female. That is not the same as the expected fraction of girls in a family, with the expectation taken uniformly across families. A helpful approach is to think of first generating an ordered list of random genders, e.g. B B B G G B G G… and then assigning them to families. Notice that the assignment does not affect the fraction of Gs in the population.</item>
<item>If we were interested in the number of children born to a given couple, the answer would come from a geometric distribution with success probability 0.49. Can you figure out how to modify that distribution to account for the fact that we are sampling children and not families?</item>
<item>Percentile ranks are, by definition, uniformly distributed on [0, 100], and their expected value is therefore 50. Do you see how that pins down the slope? Interestingly, the slope also equals the correlation between parent and child percentile ranks.</item>
<item>Try calculating the expected length of the left piece, conditional on the left piece being longer than the right. That means the breakpoint is uniform on [0.5, 1.0]. Notice that, by symmetry, E[length of left piece | left is longer] = E[length of right piece | right is longer].</item>
<item>The clock\'s hour hand follows a first-order Markov process whose states are the integers from 1 to 12. What does its distribution converge to? Notice that the uniform distribution is stationary: if each hour has probability 1/12 at time N, the same will be true at time N+1. What does that tell us about the limiting distribution when the hour hand is initially pointing at noon?</item>
<item>The number of people in room A follows a first-order Markov process on the integers from 0 to 10. What is its stationary distribution? Check whether a binomial distribution would work. The chain is periodic with period 2 — it alternates between odd and even states — but notice that the initial distribution puts equal probability on even and odd states, i.e. the initial number of people in room A is either 10 or 9, each with probability ½. Search for Ehrenfest chains online for more detailed explanations.</item>
<item>Remember Bayes\' rule: Pr[A | B] = Pr[A and B] / Pr[B]. In this case A is the stock going up and B is the event that N+1 signals point up (and the remaining N point down). Conditional on the price movement (which is up or down with equal probability), the number of signals pointing up follows a binomial distribution. Write out the conditional probability we are interested in, and try to cancel out as many terms as possible. You\'ll end up with a simple solution.</item>
<item>Focus on the probability that the first object in the original collection ends up in the sample. The easiest approach is to use Pr[A] = 1 - Pr[!A], where !A denotes the complement of A, i.e. the probability that the object is never sampled. You\'ll find that the limit the question is asking for involves the mathematical constant e (the base of the natural logarithm). You can type lowercase e in your answer.</item>
<item>The image shows a few possible paths for C\'s net vote count (i.e. the running count of votes for C minus votes for T). We\'re interested in the probability that the path never hits zero after the first vote is counted. It turns out there is a very elegant but slightly tricky way to solve this problem — scroll through the difficult puzzles if you\'re interested. Let\'s take a brute force approach for now: the path will hit zero if and only if it starts with T, C-T, C-C-T-T-, C-C-C-T-T-T or C-C-T-C-T-T. Write one minus the sum of those probabilities, cancel as many terms as you can and you\'ll end up with a simple solution.</item>
<item>Any (original message, scrambled message) pair implies a unique pad. For example, (1111, 1110) implies that the pad must have been ___X. The question is asking about Pr[original message | scrambled message]. The first part of the hint tells you that Pr[scrambled message | original message] = (1/2)^4, i.e. the probability that a particular pad was chosen, for any (scrambled message, original message) pair. You\'ll find that this implies that Eve\'s posterior beliefs (after observing the scrambled message) are identical to her prior beliefs (before observing the scrambled message).</item>
<item>Start by assuming that you know the position of the first two points (call them A and B, for example), and calculate the probability that the triangle ABC contains the center of the circle conditional on points A and B. If you can express that probability as a function of the locations A and B (or of the distance between A and B), you can then calculate the answer to the puzzle by integrating over the possible locations of A and B (or of B relative to A, if all that matters is the distance between them). If you\'d like to see a detailed answer to this question, have a look at either https://math.stackexchange.com/questions/268635/what-is-the-probability-that-the-center-of-the-circle-is-contained-within-the-tr or https://math.stackexchange.com/questions/172296/probabilty-of-random-points-on-perimeter-containing-center.</item>
</string-array>
<string-array name="puzzles_1">
<item>You\'re stuck on a desert island — and to pass the time, you\'ve decided to repeatedly toss a fair six-sided die. Let\'s make the reasonable assumption that tosses are independent.
\n\nOn average, how many tosses does it take until you see a number larger than four?</item>
<item>Three friends are hanging out. To keep things simple, assume their birthdays are uniformly and independently distributed across the 365-day year.
\n\nWhat\'s the probability that some (i.e. either two or three) of the people in this group have a birthday in common?</item>
<item>Using the previous problem\'s setup, what is the smallest group size such that the probability of a birthday in common is larger than ½?
\n\nThis is the birthday problem, also known as the birthday paradox: the answer is smaller than most people would expect.</item>
<item>Once again you\'re marooned on an island. You have a lot of free time on your hands, and you decide to repeatedly toss a fair coin; as usual, assume tosses are independent.
\n\nOn average, how many tosses does it take to get two heads in a row?</item>
<item>You\'ve placed three coins in a jar: one normal, one double-headed, and one double-tailed.
\n\nSomeone selects a coin uniformly at random from the jar and tosses it. If it comes up heads, what\'s the probability the coin is fair?</item>
<item>Suppose babies are boys with probability 0.51, girls with probability 0.49, and births are independent.
\n\nIf you have three children, what\'s the probability of having two boys and one girl?</item>
<item>A certain unpleasant disease affects 150 people, on average, out of every 100,000.
\n\nScientists have developed a test with an amazing accuracy of 99\%. In other words, if a person has the disease, the test will be positive with probability 0.99; if they don\'t, it\'ll be positive with probability 0.01.
\n\nIf a person chosen uniformly at random from the population tests positive, what\'s the probability they have the disease?</item>
<item>You\'re again confronted by a coin-filled jar. There are ten coins this time: one has two heads; the other nine are normal. All are equally likely to come up on either side when tossed.
\n\nSomeone picks a coin uniformly at random from the jar and tosses it three times. If it comes up heads on all three tosses, what\'s the probability you\'re dealing with the double-headed coin?</item>
<item>You\'re five years old and are an avid consumer of cereal. Each time you finish a box, the manufacturer sends you a little toy.
\n\nLet\'s bring in some probability: there are four different types of toys, and each time the company sends them out they pick the type uniformly at random.
\n\nOn average, how many boxes of cereal must you to eat in order to get a complete collection, i.e. one of each type of toy?</item>
<item>You\'re trying out for a basketball team, and the coach gives you two options: you can take six shots, or you can take four. In both cases you have to make at least half of the shots, or you\'ll be cut from the team.
\n\nThe number of shots you make follows a binomial distribution: you have some fixed probability of making any individual shot — we\'ll call that your skill — and successive shots are independent.
\n\nIf your skill is one, you\'re indifferent: either way, you\'re certain to make the team. A similar statement applies if you have no skill whatsoever.
\n\nInterestingly, there\'s a third skill level at which you\'re indifferent between taking six shots or four. To the left of this skill threshold, you\'d prefer to take fewer shots; and to the right, you\'d prefer to take more.
\n\nWhat\'s the threshold skill level?</item>
<item>Three men — conveniently named A, B, and C — are fighting a duel with pistols. It\'s A\'s turn to shoot.
\n\nThe rules of this duel are rather peculiar: the duelists do not all shoot simultaneously, but instead take turns. A fires at B, B fires at C, and C fires at A; the cycle repeats until there is a single survivor. If you hit your target, you\'ll fire at the next person on your next turn.
\n\nFor example, A might shoot and hit B. With B out of the picture, it would be C\'s turn to shoot — suppose he misses. Now it\'s A\'s turn again, and he fires at C; if he hits, the duel is over, with A the sole survivor.
\n\nTo bring in a little probability, suppose A and C each hit their targets with probability 0.5, but that B is a better shot, and hits with probability 0.75 — all shots are independent.
\n\nWhat\'s the probability that A wins the duel?</item>
<item>A grasshopper is sitting on a little stone, which we\'ll call stone zero. Ahead of him, arranged in a line, are stones one, two, three, et cetera, all the way up to nine.
\n\nThe grasshopper would like to reach that ninth stone, for reasons unknown. What we do know is that he\'ll get there by combining little grasshopper jumps, each of which will take our friend forward by either one or two steps. To be clear, this means the grasshopper has exactly two ways to reach stone two: he could take one big jump, or two little ones.
\n\nHow many different paths can the grasshopper take to reach his destination?</item>
<item>How many ways are there to tile a 2-by-10 board with 2-by-1 dominoes?
\n\nThe rules are simple: your tiling must cover the board perfectly; no dominoes can stick out; and they can\'t overlap.</item>
<item>For the purposes of this puzzle, a \"string\" means a sequences of zeros and ones, e.g. 1011.
\n\nConsider all the different strings of length eight — a good first step would be to figure out how many of these exist.
\n\nIf you pick a length-eight string uniformly at random, what\'s the probability that it contains two (or more) consecutive 1s?</item>
<item>You\'re playing a three-stage game. At each stage, your friend tosses a six-sided die: it lands on some number, let\'s say 2 for example.
\n\nAt this point, you can either take $2 (i.e. the amount shown on the die), in which case the game ends; or, if there\'s another stage remaining, you can choose to wait, in the hope of obtaining a higher number in the future.
\n\nThe amount you make depends both on the outcomes of the tosses and on your strategy. Let\'s assume you choose the strategy that maximizes your expected payoff.
\n\nWhat\'s the value of the game? In other words, before playing the first stage, what is your expected payoff?</item>
<item>Four hundred and forty passengers are waiting to board a large plane containing exactly that many seats. The first passenger has misplaced his boarding pass — but he\'s feeling lucky, and chooses a seat uniformly at random.
\n\nThe remaining passengers all have their boarding passes. If their assigned seat is not yet taken, they sit there; otherwise, they choose an available seat uniformly at random.
\n\nWhen the last passenger finally gets to his assigned spot, what\'s the probability that he finds someone else sitting there?</item>
<item>In front of you is an infinitely-lived machine that proposes amounts of money, which you can either accept or reject. If you accept, the machine hands over the proposed amount, but shuts down and will never give you anything else. If you reject, it\'ll show you a new proposal next period.
\n\nEach period\'s proposal is an independent draw from a uniform distribution on [0, 100]. The time between periods is long — several months, say — and you are impatient: a dollar next period is worth only 0.9 to you today; similarly, a dollar two periods from now is worth 0.9*0.9 = 0.81 today, et cetera.
\n\nIf your strategy were to always accept, you\'d expect to make $50, i.e. the mean of the first draw. If instead you decided to accept any first proposal above 50, and — in case you reject the first — any second proposal whatsoever, your expected discounted payoff would be $60. But you can do better!
\n\nIf you follow the strategy that maximizes your expected discounted payoff, what is the threshold above which you should accept the machine\'s first proposal?</item>
<item>You\'re a biologist studying a population of bacteria: there are initially two of them, swimming happily in their petri dish.
\n\nEach period, each bacterium will either die (with probability 0.25), or it will divide into two happy bacteria. Assume deaths are independent across time and individuals, and that this process continues forever. We\'ll keep things simple and ignore the possibility that the colony fills the petri dish or runs out of nutrients.
\n\nOver an infinite time horizon, what\'s the probability that the entire population dies out?</item>
<item>You pick a single number uniformly at random from the set \{1, 2, … , 1000\}.
\n\nWhat\'s the probability that it\'s a multiple of one (or more) of the numbers 7, 11 or 13?</item>
<item>Imagine that, on a given day, the weather can be either sunny (with probability 0.4), cloudy (ditto), or rainy (with probability 0.2). Let\'s make the heroic assumption that weather is independent across days.
\n\nDefine "blocks" or "runs" of weather to be (the largest possible) groups of consecutive days in which the weather is the same. For example, if it rained for eight days, followed by a day of sun, then a day of rain, we\'d have three blocks.
\n\nAcross a ten-day period, what\'s the expected number of blocks of identical weather?</item>
<item>Let\'s ask the same question as in the previous puzzle, but in a more realistic setting: we still have 0.4 probability of sun, ditto for clouds, and 0.2 probability of rain, but we\'ll abandon the assumption that weather is independent across days.
\n\nInstead, the weather follows a first-order Markov process: if it\'s either sunny or cloudy today, the probabilities for tomorrow\'s weather are: 0.5 chance of sun, 0.25 clouds and 0.25 rain; if it\'s raining today, we\'ll have clouds tomorrow with probability 1 — it\'ll never rain twice in a row.
\n\nNow, again across a ten-day period, what\'s the expected number of blocks of identical weather?</item>
<item>A wise man presents you with an urn containing an equal number of red and black marbles.
\n\nIf you reach in and draw two marbles (uniformly and independently) at random from the urn, the probability that they\'re of matching color is necessarily less than ½. Here\'s the tricky part: if the colors of those first two marbles do match, and you reach in to grab two more, the probability of those next two being of matching color is exactly ½.
\n\nHow can that be? What is the total number of balls in the urn — red plus black — before you take any out?</item>
<item>Suppose that, in the general population, mathematical and writing ability are independently and uniformly distributed on [0, 1].
\n\nPeople attend university if and only if the sum of their writing and math abilities is larger than one. Among people who\'ve attended university, what fraction have math ability above 0.9, i.e. in the top 10\% of the general population?</item>
<item>Let\'s stick with our usual assumptions regarding babies: they\'re girls with probability 0.49, boys with probability 0.51, and gender is independent across births.
\n\nIf a large number of parents keep having children until they have a girl — at which point they stop, regardless of whether she\'s an only child or has lots of brothers — what will be the fraction of female children in the overall population?</item>
<item>Let\'s maintain the assumptions of the previous question: parents keep having children until they have one girl, at which point they stop; and babies are girls with probability 0.49.
\n\nIf we select a child uniformly at random (from the entire population of children), what\'s the probability he or she has exactly one sibling?</item>
<item>Income percentile ranks are numbers from 0 to 100 that indicate where you sit in the income distribution — for example, 75 would mean you earn more income than three quarters of people, but less than the top quarter.
\n\nLet\'s assume a child\'s expected income percentile is a linear function of their parents\' income percentile. It turns out the intercept is enough to pin down the slope. Do you see why? If the intercept is 20 — which means the lowest-income parents have children who end up at the 20th percentile, on average — what is the slope?</item>
<item>You\'re carrying a one meter long piece of wood, when suddenly you trip and drop it on the ground. How clumsy of you! The wood breaks into a left piece and a right piece, with the breakpoint uniformly distributed length-wise: for any L between 0 and 1, the left piece of wood has probability L of having a length less than L. For example, there\'s a 60\% probability that the left piece is less than 0.6 meters long.
\n\nWhat\'s the expected length (i.e. the average length) in meters of the longer piece?</item>
<item>You have a broken 12-hour analog clock on your wall: every sixty minutes the hour hand moves forward by one hour with probability 0.99, but remains stuck in place with probability 0.01. The movements are independent across hours: the probability of move-stuck-move is 0.99*0.01*0.99, for example.
\n\nIt is currently noon. We\'re interested in the probability that the hour hand points toward 3, N hours from now. What does that probability converge to as N goes to infinity?</item>
<item>Ten people are attending a party in a two-room apartment and, initially, it is equally likely that all ten are in room A or that nine are in room A and one in room B. This is no ordinary party: every minute, one person is chosen uniformly at random (independently of whatever happened in the past), and they must move into the other room (i.e. if they were in room A they move to B, and vice-versa).
\n\nFor example, suppose we\'re in the 50\% of cases where everyone is initially in room A. At the end of the first minute someone will be chosen and will walk into room B, leaving nine people in room A. At the end of the second minute, with probability 9/10 someone in room A will be selected (in which case they\'d go join the person in room B), or, with probability 1/10, the person in room B will return to room A, restoring the initial configuration.
\n\nWe\'re interested in the probability that the group is evenly split between rooms A and B (i.e. 5 people in each) after N minutes. What does that probability converge to as N goes to infinity?</item>
<item>You are a trader considering a stock whose next price movement will be up or down with equal probability. Fortunately, you have access to a binary signal that is predictive of the price change (and observable ahead of time). The signal is 60\% accurate: conditional on the stock going up, there\'s a 0.6 probability that the signal says up (and 0.4 probability that it says down); the reverse is true if the stock goes down.
\n\nYou have access to many such signals, all with the same accuracy. Assume they are conditionally independent given the price movement (e.g. conditional on the stock going up, there\'s a 0.6^2 probability that signals one and two both point up). Suppose you observe N+1 signals pointing up and N pointing down (out of a total of 2N+1 signals, i.e. the total number must be odd). What\'s the probability that the stock will go up?</item>
<item>You are given a collection of N distinct objects from which you draw a random sample of size N with replacement — that means objects are allowed to be sampled multiple times. Generating a sample in this way is related to the statistical technique called bootstrapping.
\n\nWe\'re interested in the expected fraction of the original collection that ends up in the sample (i.e. the probability that a given object in the original collection appears at least once in the sample). What does this probability converge to as N goes to infinity?</item>
<item>Imagine a country in which 10 people have voted in an election opposing a woman named C and a demagogue named T. Suppose C received 7 votes, while 3 voted for candidate T — but the public doesn\'t know that yet because the votes have not been counted.
\n\nThe voters\' ballots are placed in a large urn. Before it is opened, the urn is shaken in a way that randomly shuffles the ballots, with all orderings equally likely. The urn is then opened and the ballots taken out one by one and tallied. Given that 7 people voted for C (and 3 for T), we know she\'ll end up with a net advantage of 4 votes at the end of the count. There\'s randomness in how we get there, however.
\n\nWhat\'s the probability that C is strictly ahead of T at every point in the counting process?</item>
<item>Alice would like to send Bob a secret four-digit binary message, e.g. 0000 or 0011, via the post office, but she\'s worried that her letter will be intercepted by a third party. Fortunately, Alice and Bob have a way of encrypting their messages: last time they met, they generated a secret "one-time pad", which is a four-character sequence of Xs and underscores, e.g. XX_X. They\'ll use the pad to encrypt their message.
\n\nThere are 2^4 possible pads: Alice chose one of them uniformly at random and shared it with Bob before they parted ways. They agreed on the following protocol: when Alice needs to send Bob a four-digit binary message, she\'ll encrypt it using the pad. Wherever the pad says X, she will flip the corresponding bit in the message (i.e. 1 is flipped to 0 and 0 is flipped to 1); she leaves the remainder of the message unchanged (i.e. in the places where the pad says _). She\'ll send the scrambled message in the mail, and Bob will use his copy of the pad to decipher it.
\n\nEve is the spy reading Alice and Bob\'s mail. She knows the methodology behind the one-time pad, and she knows that Alice chose a pad uniformly at random. Furthermore, Eve believes there\'s a 30\% chance that Alice\'s true (unscrambled) message will be 0000, a 60\% chance that it will be 1111, and a 10\% chance it\'ll be 0011.
\n\nEve intercepts Alice\'s letter to Bob and finds the (scrambled) message 1110. Given what Eve has observed, what\'s the probability that Alice\'s true message to Bob is 1111?</item>
<item>If you select three points uniformly at random from the perimeter of a circle, what\'s the probability that the resulting triangle contains the center of the circle?</item>
</string-array>
<string-array name="answers_1">
<item>3</item>
<item>1 - 364*363/365^2</item>
<item>23</item>
<item>6</item>
<item>1/3</item>
<item>3 * 0.51^2 * 0.49</item>
<item>148.5/(148.5 + 998.5)</item>
<item>0.1/(0.1 + 0.9*0.5^3)</item>
<item>4*(1/4 + 1/3 + 1/2 + 1)</item>
<item>3/5</item>
<item>128/315</item>
<item>55</item>
<item>89</item>
<item>201/256</item>
<item>14/3</item>
<item>1/2</item>
<item>100*(1-0.19^0.5)/0.9</item>
<item>1/9</item>
<item>280/1000</item>
<item>1+9*0.8^2</item>
<item>1+9*0.7</item>
<item>6</item>
<item>1-0.9^2</item>
<item>0.49</item>
<item>2*0.51*0.49^2</item>
<item>0.6</item>
<item>3/4</item>
<item>1/12</item>
<item>252*0.5^10</item>
<item>0.6</item>
<item>1 - e^(-1)</item>
<item>4/10</item>
<item>0.6</item>
<item>1/4</item>
</string-array>
<string-array name="images_2">
<item>hound</item>
<item>mouse_grid_horizontal</item>
<item>mouse_grid_horizontal_with_trap</item>
<item></item>
<item></item>
<item></item>
<item>conditional_correlation</item>
<item>hats</item>
<item>gambling_small</item>
<item></item>
<item>particle_v2</item>
<item>table_small</item>
<item>ant_and_spider</item>
<item></item>
<item></item>
<item></item>
<item>gambler_broke_11_bets_small</item>
<item>vote_counting_small</item>
</string-array>
<string-array name="hints_2">
<item>Linearity of expectation will help: name the foxes 1, 2, …, 5, and let X_i be an indicator for whether fox i is followed by a hound. The answer is E[X_1 + … + X_5] = E[X_1] + … + E[X_5]. Since the probability of being followed by a hound is the same for each of the foxes, the answer simplifies to 5*E[X_1], i.e. all you have to do is calculate the probability that a specific fox is followed by a hound and multiply it by five.</item>
<item>Notice that all paths have the same number of total steps — and moreover, the same number of eastward steps. You can therefore represent any path as a sequence of N words, K of which say \"east\" and the remainder of which say \"north.\" How many ways are there to rearrange such a sequence?</item>
<item>Try counting the number of paths that go through the trap. A useful first step is to count the number of paths from the starting position to the trap — which you already know how to do if you solved the previous puzzle.</item>
<item>You can use the fact that E[X] = E[E[X|Y]]. In this case, let X denote the answer to the puzzle. A good choice of Y is an indicator for whether the A train arrives before or after the three-minute mark: if it arrives after, you know you\'ll be taking the B train (since it will arrive in at most three minutes). If you want to forget the train story, the puzzle is asking for E[min(X_1, X_2)] where X_1 ~ Uniform([0, 5]), X_2 ~ Uniform([0, 3]) and the Xs are independent.</item>
<item>This one is very similar to the fox problem: the answer is simple if you use linearity of expectation. If you focus on the women, for example, the answer is 8*E[X_1], where X_1 is the number of men sitting next to woman number one, i.e. X_1 is either 0, 1 or 2.</item>
<item>Try solving the previous puzzle first (read its hint if you are stuck). The only difference here is accounting for the probability of sitting at the ends of the table, in which case you have only one neighbor. Intuitively, this should lead to a smaller number than in the previous puzzle. See https://stats.stackexchange.com/a/509919/9330 for a detailed solution.</item>
<item>The definition of correlation is Corr[X, Y] = Cov[X, Y] / (Var[X]*Var[Y])^0.5, and you can reach the answer by following the definitions and integrating. A trick is to think of a regression of writing ability on math ability conditional on attending college — the slope of that regression line will give the correlation. Make sure you understand why that works!</item>
<item>Use the inclusion-exclusion principle. The two-event version is Pr[A or B] = Pr[A] + Pr[B] - Pr[A and B]; you need to use the n-event version where n is the number of people (and also the number of hats).</item>
<item>Starting at any positive initial wealth x, think about the probability of ever reaching state (x - 1). The answer you\'re looking for is just the square of that probability: to go broke you have to at some point reach a wealth of $1, and then, having gotten there, at some point reach a wealth of $0.</item>
<item>Suppose I were asking about a resample of size five from a collection of five objects. Picture five dots and four bars laid out in a line, like this: oo|o||oo|. That particular sequence represents a resample in which the first object is sampled twice, the second once, the third never, the fourth twice, and the fifth never. How many distinct sequences can be generated using the same number of circles and bars?</item>
<item>Start by calculating the expected number of total visits to the origin. What is the connection between that number and the probability of ever returning?</item>
<item>If the host starts by passing right, you know you\'ve lost. Focus on the set of people who have not yet held the coin, and think about people leaving that set. The winner is the last one left. As long as there\'s more than one person in the set, the next person to leave must be one of the two people at the ends (in the illustration, that would be you or person D, for example).</item>
<item>The cube has eight corners (vertices), but you can simplify the problem by focusing on the spider\'s distance from the ant — initially 3, and in general a number in \{0, 1, 2, 3\} — which conveniently follows a first-order Markov process.</item>
<item>The answer is necessarily larger than 4. A trick for solving it easily by hand is to use martingales. Suppose that at each time N a person arrives and bets 1 dollar on the Nth toss being H. If they win, they then bet 2 on T; if they win again, 4 on T; and if they win again, 8 on H. They stop betting as soon as they either lose once or win four bets in a row. The cumulative amount won by these betters is a mean-zero martingale, and you can use that fact to solve for the expected amount of time until the first H T T H.</item>
<item>Try solving the previous puzzle first — if you figured out the martingale trick, this one will be easy. The interesting question is to think about why one pattern happens sooner, on average, than the other.</item>
<item>This puzzle is straightforward if you know the power series for the exponential function, i.e. that e^x equals the sum from N=0 to infinity of (x^N)/(N!). Try playing around with (e^x + e^(-x)) and (e^x - e^(-x)).</item>
<item>For any even number N, let F(N) denote the number of paths of length N (i.e. wealth trajectories over the course of N bets) that start at a wealth of one, end at a wealth of one, and never hit zero. For example, F(0)=1, F(2)=1 and F(4)=2; the two paths for F(4) are up-up-down-down and up-down-up-down. The solution is related to F(10). Can you express F recursively? Look up the Catalan numbers if you are stuck.</item>
<item>The graph illustrates several sample paths for C\'s net vote count. We\'re looking for the probability that the path never hits zero after the first vote. Several facts will be helpful: first, the probability that the first vote out of the ballot box is for C is 70/100. Second, suppose the path hits zero (e.g. at the orange circle in the illustration): at that point, when the path first hits zero, we\'ve counted an equal number of votes for T and C. We can therefore \"reflect\" the left side of the path — the portion from the origin to the orange circle — around the horizontal axis, giving us an alternate path which necessarily has the same probability as the original path. Therefore, conditional on the path hitting zero (e.g. at the orange circle), the first vote removed from the ballot box is equally likely to have been for C as for T. Combine those facts to get the answer.</item>
</string-array>
<string-array name="puzzles_2">
<item>Five foxes and seven hounds run into a foxhole. While they\'re inside they get all jumbled up, so that all orderings are equally likely.
\n\nThe foxes and hounds run out of the hole in a neat line. On average, how many foxes are immediately followed by a hound?</item>
<item>A hungry mouse is sitting at the SW corner of a four-by-seven tile surface, beautifully illustrated below. The mouse sniffs around and detects a delectable piece of cheese at the NE corner.
\n\nSuppose the mouse moves only along the edges of tiles, and chooses to travel only northward or eastward, as it would like to reach its meal rapidly. For example, the mouse might reach the cheese by moving north three times, east seven times, and then north once.
\n\nHow many different paths can the mouse take to reach the cheese?</item>
<item>This is a continuation of the previous puzzle: the same rules apply regarding the mouse\'s movements.
\n\nThere is now a trap — big, red and circular — between the mouse and its dinner. The mouse begins its journey at position (0, 0); the trap awaits at (5, 2); the delicious cheese is located at (7, 4).
\n\nIf the mouse chooses a mouse-to-cheese path uniformly at random, what\'s the probability that it survives the trip?</item>
<item>You enter a metro station in a big hurry, and decide to take the first train that arrives.
\n\nThere are two lines running through this station: one runs every five minutes (line A), the other every three (line B). To be precise, suppose the next arrival of the A train is uniformly distributed on the interval [0, 5], and similarly for the B train on [0, 3]. The two arrivals are independent.
\n\nThe trains run like clockwork: there\'s no uncertainty other than the next arrival time. For example, given that the next B train arrives at time 0.87, you can be absolutely certain that there will be another at time 3.87.
\n\nHow many minutes will you wait on average until you get on a train?</item>
<item>Five men and eight women will be seated at random around a circular table, in such a way that all orderings are equally likely.
\n\nLet\'s assume everyone is heterosexual (and single), so that there is a "potential couple" any time a man and a woman are sitting next to each other. Note that a person can be part of (up to) two potential couples: one with the person sitting to their left, another with the person sitting to their right.
\n\nOn average, how many potential couples will be seated at the table?</item>
<item>This is a variation on the previous puzzle: we still have five men and eight women, but we\'ve lost the circular table and our guests are now seated in a line. As before, they are placed randomly such that all orderings are equally likely.
\n\nWhat\'s the expected number of potential couples?</item>
<item>Suppose mathematical and writing ability are independent — and therefore uncorrelated — in the general population.
\n\nTo keep things tractable, imagine math and writing ability are independently uniformly distributed on the interval [0, 1], and that students attend college if and only if the sum of their mathematical and writing abilities is larger than one.
\n\nEach point below is a simulated person; the color indicates whether they attend college. Among the population of college students, what is the correlation between writing and math ability?</item>
<item>You invite some friends to a hat-themed party. As the night progresses, you decide to play a game: everyone will line up and place their hat on the ground in front of them. The guests will then be reordered randomly, with all orderings equally likely. Afterward, each guest will grab the hat in front of them.
\n\nWe\'re interested in the probability that at least one guest is wearing their own hat at the end of the game. What does that probability converge to as the number of guests grows infinitely large?</item>
<item>You find $2 in your pocket and decide to go gambling. Fortunately, the game you\'re playing has very favorable odds: each time you play, you gain $1 with probability 3/4 and lose $1 with probability 1/4.
\n\nSuppose you continue playing so long as you have money in your pocket. If you lose your first two bets, you go broke and go home after only two rounds; but if you win forever, you\'ll play forever.
\n\nWhat\'s the probability you\'ll eventually go broke?</item>
<item>Start with a collection of ten distinct objects, and define a "resample" to be a sample of size ten, with replacement, drawn from your original collection. If the original collection is {1, 2, … , 10}, for example, there is a resample in which the number 2 appears ten times, another in which each of the original numbers appears once, and another in which the numbers 1 and 2 each appear five times. There are many more.
\n\nWhat\'s the number of distinct resamples?</item>
<item>A particle lives on a two-dimensional grid and begins its journey at the origin, (0, 0). Each second it will jump either to the NW, NE, SW or SE with equal probability, as in the diagram below. After jumping once, the particle has a 0.25 probability of being at position (1, 1), for example.
\n\nWhat\'s the probability that the particle ever returns to the origin?</item>
<item>A host and 9 guests are seated at a circular table. Your host is feeling generous: she places a gold coin in front of her, and announces that one of you will be taking it home.
\n\nWhoever has the coin — beginning with the host — will flip it: if heads, they pass left; tails, they pass right. This continues until everyone has held the coin at least once — at that instant, the game ends, and the person holding the coin takes it home. In other words, the winner is last person to hold the coin for the first time.
\n\nIn the example below, the coin goes from the host to A to B, then circles between A and B for a while, then goes from B to C. In that hypothetical scenario, it would be impossible for the host, A, B or C to win (but you would still have a chance).
\n\nYou\'re sitting immediately to the host\'s right and the game is about to begin. What\'s your probability of winning?</item>
<item>Picture a large room — or, more abstractly, a cube — populated by two little creatures: a hungry spider, at one corner; and, at the very opposite corner, a terrified ant.
\n\nTo be precise, suppose the spider is initially at the NE corner of the ceiling, while the ant is doing its best to hide at the SW corner of the floor, as in the picture below.
\n\nThe ant is petrified by fear and never moves. Meanwhile, the spider follows a random walk: each time it reaches a corner, it picks an edge uniformly at random (independently of its past choices), and follows it to the next corner.
\n\nOn average, how many edge-lengths will the spider walk before it reaches the ant?</item>
<item>When considering an infinite sequence of tosses of a fair coin, how long will it take on average until the pattern H T T H appears?</item>
<item>Jack and Jill are playing a game built on infinite fair coin tossing. Jack is betting on the pattern H H H H occurring first, while Jill has her money on H T T H.
\n\nLet T_a denote the number of tosses until Jack\'s pattern first appears, while T_i denotes the same for Jill\'s. If Jack promises to pay Jill (T_a - T_i), which could be either positive or negative, how much will she receive on average?</item>
<item>Consider a Poisson random variable with expected value 1, i.e. Pr[X = k] = e^(-1) / (k!) for non-negative integers k (and zero otherwise), where k! is the factorial of k. What is the probability that X is even?</item>
<item>Consider a gambler whose initial fortune is one dollar, and who repeatedly makes fair bets in which his fortune either increases or decreases by one dollar (i.e. each outcome has probability ½). He keeps betting until he runs out of money. Conditional on the gambler going broke on his eleventh bet, what is the probability that his wealth trajectory went straight up to $6 and then crashed straight down to $0?</item>
<item>Imagine a country in which 100 people have voted in an election opposing a woman named C and a demagogue named T. Suppose C received 70 votes, while 30 voted for candidate T — but the public doesn\'t know that yet because the votes have not been counted.
\n\nThe voters\' ballots are placed in a large urn. Before it is opened, the urn is shaken in such a way as to randomly shuffle the ballots, with all orderings equally likely. The urn is then opened and the ballots taken out one by one and tallied.
\n\nGiven that 70 people voted for C (and 30 for T), we know she\'ll end up with a net advantage of 40 votes at the end of the count. There\'s randomness in how we get there, however.
\n\nWhat\'s the probability that C is strictly ahead of T at every point in the counting process?</item>
</string-array>
<string-array name="answers_2">
<item>5*7/12</item>
<item>C(11,7)</item>
<item>1 - C(7,2)*C(4,2)/C(11,7)</item>
<item>1.2</item>
<item>5*4/3</item>
<item>5*48/39</item>
<item>-1/2</item>
<item>1-1/e</item>
<item>1/9</item>
<item>92378</item>
<item>1</item>
<item>1/9</item>
<item>10</item>
<item>18</item>
<item>30-18</item>
<item>0.5*(1 + e^(-2))</item>
<item>1/42</item>
<item>40/100</item>
</string-array>
<string name="gemini_prompt_template">Can you give me a hint for this puzzle, without giving away the answer? Here\'s the puzzle: </string>
<string name="gemini_expand_hint">Here\'s the current hint, please expand on it:</string>
</resources>