Otto holds out a large sack that contains k ripe, delicious oranges plus one green, unripe orange that fell off the tree too soon. You and Otto will take turns grabbing an orange out of the sack and whoever gets the green orange loses the game. Should you go first or should you let Otto go first?
Does it matter how big or small k might be? The goal of this exercise is to use R to make a graphical or tabular representation of the chances of losing the game given various values of k. Here are a few ingredients you might find helpful: runif(k, , ) – Generates k random numbers between min (default = 0) and max (default = 1) in a uniform distribution round(x, ) – Rounds the number x to digits significant digits (default is no digits after the decimal point) replicate(n, expr) – Evaluates expr over n trials, producing a list of the results hist(list) – Creates a histogram of the contents of list using sensible breakpoints table(list) – Tabulates the contents of list by value (i.e., frequencies) %% – The modulo operator, for example x%%2 provides the remainder after dividing x by 2 For example, let’s say that k = 9 ripe oranges, so the total number of oranges in the sack was 10.
We could run one simulated trial and find out which orange was green like this: > round(runif(1, .5, .5)) [1] 4 In the final line above that begins with the annotation “[1],” R indicates that the green orange was the fourth one picked from the sack. So if you picked first and Otto picked second, then you would pick third, and Otto would pick fourth and lose the game. You can verify that everything turns out as you expect by tabulating 1000 trials of this: > table(replicate(1000,round(runif(1,.5,.5)))) 1 2 3 4 5 6 7 8 9 10 105 93 95 96 114 73 105 108 114 97 the laws of chance dictate that it is very unlikely to find exactly the same number in each of the ten categories, but it is reasonably close. Anyway, now you know enough to try to figure out the problem. Should you pick first or should Otto pick first? If you go first, are you more likely to win if k is small or if k is large? What about odd and even?
[meteor_slideshow slideshow="slide3"]Are you looking for a similar paper or any other quality academic essay? Then look no further. Our research paper writing service is what you require. Our team of experienced writers is on standby to deliver to you an original paper as per your specified instructions with zero plagiarism guaranteed. This is the perfect way you can prepare your own unique academic paper and score the grades you deserve.
[meteor_slideshow slideshow="slide2"]Use the order calculator below and get ordering with idealtermpapers.com now! Contact our live support team for any assistance or inquiry.
[order_calculator]