Can anyone help with R Programming A student of mine was as

Can anyone help with R Programming ?

A student of mine was asked this question in an interview. “Consider the following game: A cup is filled with 100 pennies. The cup is shaken, and the pennies are poured onto a table. If at least 60 of the pennies are Heads, you win $20. Otherwise, you lose $1. Is this a good game to play?” (That is does it have a positive expected value?).

Answer this using simulation in R.

a) Determine how much you would win or lose.

b) Does it appear to be a fair game?

Solution

Solution :

Here, we let =n*p = 100 * 0.5 = 50 (the expected number of pennies to end up heads)

and = (n*p*q) = (100 * 0.5 * 0.5) = 5

then we can find a Z score, noting that above 60 heads is what peaks our interest.

Z = (60 - 50)/5 = 2

Nothing on our Z-score chart that the area to the right of Z = 2 is 0.0228, this means we have a probability of 2.28% to land 60 or more heads.

Thus, the expected earnings from the game is 0.0228 * ($20) - 0.9772 *($1) = - 0.5212 .. which means this is a bad game to be playing

Can anyone help with R Programming ? A student of mine was asked this question in an interview. “Consider the following game: A cup is filled with 100 pennies.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site