HW9
Homework 9
Read Walliman Ch 6, 7, 8, 9
Consider the three probability problems below:
1. Red Vibes
A net poker site has introduced a new game: Red Vibes. The objective is to guess when the next card is
red. The stake is 100 SEK and the return is 200 SEK if your guess is correct. This is how it goes: A shuffled
face-down deck of cards is on the screen. Every second, the top card is turned face-up and then discarded.
At any time during the fifty-three seconds that one game takes you may click on the face-down top card and
if it turns out to be red, you win. If you don’t click at all, your choice is taken to be the last card. The deck
contains 26 reds, 26 blacks and one joker. Obviously, clicking the first card will make you lose money on
average, but possibly there exists a better strategy, something like ”await a situation where more blacks
than reds have been turned up, then click!” If you can program a bot who plays a winning strategy, the
millions will start rolling in effortlessly. Worth trying?
2. Cerebral Cereal
In each box of Cerebral Cereal there is a plastic figurine portraying a well-known philosopher. If there are
66 different philosophers, how many boxes would you have to buy on average to get a complete set? As
this is an old maths problem, mathematicians Johan and Henrik both believe that they remember the
solution. According to Johan, the average is approximately n ln n but according to Henrik it is n · e.
3. First or secound hour
The 222 students in a course attend either the first or the second hour of a seminar. When the choice
was left to each student, only 99 students turned up the first hour and 123 the second hour. May we draw
the conclusion that the second hour is more popular? Is the difference significant on the 95 % level? On the
99 % level?
Suggest a solution for each of these three problems. Write programs to complement your reasoning:
- Red Vibes: Program a strategy and test it.
- Cerebral Cereal: Let your simulation determine who is right.
- First or second hour: Formulate the null hypothesis and test it in a simulation program.
Analyse the output from each of your programs and explain the results.
Append the programs and the corresponding output to your hand-in.
Handing in your solution
Please save your solution as a pdf file and hand it in on the peergrade page.
Do not write your name in the pdf file.
Peer grading
You will be asked to review the homework of three other students. Your own solution will also be checked in this way.
Your teacher will read your submission and report the result in Canvas.