Modern Statistical MethodsAssessed Coursework 2011-2012
Problem 1 – Simulation from pdf (12marks)
Consider the continuous distribution with pdf f given by
(0 = x = a)
where a is a positive parameter.
a) Explain how you would simulate a sequence of independent observations from this distribution using inversion. Implement the procedure using R.
b) Explain how you would simulate a sequence of independent observations from this distribution using an acceptance-rejection method with a uniform distribution used to construct the envelope. State as a function of a how many pseudorandom numbers have to be generated on average for every observation simulated. For which values of a is the method most efficient? Implement the procedure using R.
c) Find the theoretical median of the distribution. Obtain estimates of the median with 10000 observations using each of the methods of a) and b) when a = 2. Do you think these methods of approximation are appropriate? Which of the two methods do you prefer?
Problem 2 – Roulette (12 marks)
The gambling game roulette (a French word meaning little wheel) is played by rolling a ball around a tilted circular track containing 37 slots (some versions, which we do not consider, contain 38 slots). The ball is assumed to land at random in one of the slots. Gamblers place bets in advance on which slot the ball will land in. There are 18 slots coloured black, 18 coloured red, and one slot coloured green. Innumerable websites describe the game, its history, tips and strategies. Most are intended, directly or indirectly, to tempt you to take part. Here are two: http://www.rouletterules.org and http://www.online-casinos.com/roulette/ (the links worked on 17
thMarch 2012).
It is possible to play a great many ‘systems’ in roulette with the objective of increasing the odds of winning. Four of these are:
At each roll of the ball, bet a constant amount, $10, on red. If the ball lands on red, there is a gain of $10. Otherwise, the stake is lost.
- System B: Betting on a Number
At each roll of the ball, bet a constant amount, $10, on a particular number, say 27. If that number comes up, there is a gain of $350. Otherwise, the stake is lost.
- System C: James Bond Strategy
Based on the system employed by the famous MI6 agent, and used in particular in Casino Royale. Assume a bet of $10 (in practice the system would only be employed for much larger stakes) and that the casino permits small bets. Bet $7 on high numbers (19-36), $2.50 on numbers
13-18 and $0.50 on the green slot. If a high number appears, the net profit is $4; if one of numbers 12-18 appears, the profit is $5; if the green slot, the profit is $8; on other numbers the stake is lost. Repeat for each roll.
- System D: d’Alembert Strategy
The above three systems assume the same strategy at each roll of the ball. In practice, most strategies are adaptive; they depend on earlier outcomes. The d’Alembert system (named after the French mathematician, born in 1717) is one of the simpler ones. The idea is to increase the bet by one unit after a loss and to decrease it by one unit after a win. Apply it in the simplest case of betting on red. At the first roll, bet $10 on red in the usual way. If there is a win, bet $9 on red next time; if a loss, bet $11 on red, and repeat indefinitely. It is essential to have a stopping rule. For example, one can stop after a fixed number of games or following a win when $1 is staked; or when $10 is gained or $100 lost, whichever comes first.
Different strategies offer different playing experiences. Some allow you to win more often than you lose; some let you play longer; some have higher expected profits (or smaller expected losses) than others; and the level of risk varies. The aim of this work is to compare the four strategies under these criteria. Clearly, the methodology, once developed, can be extended.
- Provide R code to simulate n rolls of the ball. The green slot is usually described as zero – you may find it more convenient to treat it as numbered 37.
- For each of system A, B and C, simulate a single roll and output the amount won or lost. Then for A, B, C and D, simulate 100 rolls (or following termination of D after a gain of $10 or a loss of $100) and find the gain or loss. What is the maximum possible gain and the maximum possible loss for each of the four systems?
- Call a sequence of 100 rolls a game. Repeat A, B, C and D for 1000
games. Hence find the expectation and variance of the gain or loss for each
system.
- Consider the following argument. Bet $10 on red. If red appears, take
your profit of $10 and quit. If you lose the bet, bet $20 on red on the second roll. If red appears take your profit of $10 overall and quit. Continue this way, doubling your bet each time. The probability that red comes up at some point is ½ + (½)
2
+ (½)
3+ … = 1. You can be certain that red will appear eventually. When it does, you will have a profit of $10. You are certain to win. Discuss!
- Based on your results, write a short report (maximum length 500
words) giving advice on choice of strategy to prospective gamblers as to which system to adopt, based on their objectives. You may, optionally, extend your report by considering (for example) other strategies, but the main emphasis should be on the interpretation of the simulation output.