Question

In: Statistics and Probability

1. Three players, A,B, and C, each flip their coins until one person has a different...

1. Three players, A,B, and C, each flip their coins until one person has a different result from the others. The person having the different result wins.

(a) Using R, simulate this experiment 10000 times and give the resulting estimate of P(A wins).

Solutions

Expert Solution

# The possible outcomes when three coins are simultaneously flipped by A, B,C are :

Heads/Tails HHH HHT HTH HTT THH THT TTH TTT
1/0 111 110 101 100 011 010 001 000

# Let 1=Head=H and 0=Tail=T
#If anyone flips a coin, the probability that head(or tail) shows up is half(1/2).
#Therefore, it is like Bernoulli trial for each individual; with probability of success p=1/2.
# Also, each individual independently flips the coin.
# Bernoulli(p) is equivalent to Binomial(1,p)

p=1/2
A=rbinom(10000,1,p)
B=rbinom(10000,1,p)
C=rbinom(10000,1,p)

#data.frame(A,B,C)
M=cbind(A,B,C)
head(M)
A B C
[1,] 0 1 0
[2,] 1 0 1
[3,] 0 0 0
[4,] 1 1 1
[5,] 1 1 1
[6,] 1 0 1

M[which(A==B & B==C),] ## This will give positions(row number) where elements are '000' or '111'.
head(M[which(A==B & B==C),])
# A B C
#[1,] 0 0 0
#[2,] 1 1 1
#[3,] 1 1 1
#[4,] 1 1 1
#[5,] 0 0 0
#[6,] 0 0 0
length(which(A==B & B==C)) ## This total number of outcomes where nobody wins
#[1] 2505

# which(A!=B & B==C)
M[which(A!=B & B==C),] ## This will give positions(row number) where elements are '011' or '100'. i.e. Position when A wins.
unique(M[which(A!=B & B==C),])
# A B C
#[1,] 0 1 1
#[2,] 1 0 0
head(M[which(A!=B & B==C),])
# A B C
#[1,] 0 1 1
#[2,] 1 0 0
#[3,] 0 1 1
#[4,] 1 0 0
#[5,] 0 1 1
#[6,] 1 0 0
length(which(A!=B & B==C))
[1] 2542

# Estimate of Probability that A wins:
# Using fundamental definition of probability
# Probabilty= (number of favourable outcomes in an event) / (Total number of outcomes)
# Total outcomes=10000

PA=length(which(A!=B & B==C))/10000
PA
#[1] 0.2542

PB=length(which(B!=A & A==C))/10000
PB
#[1] 0.2504
PC=length(which(C!=A & A==B))/10000
PC
#[1] 0.2449
lenNO=length(which(A==B & B==C))
lenNO
#[1] 2505
#P(Nobody wins)
lenNO/10000
#[1] 0.2505
1-(PA+PB+PC)
#[1] 0.2505


Related Solutions

Consider three players (1, 2, 3) and three alternatives (A, B, C). Players vote simultaneously for...
Consider three players (1, 2, 3) and three alternatives (A, B, C). Players vote simultaneously for an alternative and abstention is not allowed.The alternative with more votes wins. If no alternative receives a majority, alternative A is chosen. U1 (A) = U2 (B) = U3 (C) = 2 U1 (B) = U2 (C) = U3 (A) = 1 U1 (C) = U2 (A) = U3 (B) = 0 Obtain all Nash equilibria in pure strategies.
Thermodynamics Question: Suppose that you flip 50 "honest" coins and answer a, b and c again...
Thermodynamics Question: Suppose that you flip 50 "honest" coins and answer a, b and c again for 100 of them. a). How many microstates are there? Give your answer as a factor of the order of unity times an integral power of 10. b.) How man microstates are there corresponding to the most probable macrostate? c.) What is the true probability of achieving the most probable macrostate? Note: Use a calculator that gives you n! or a table of gamma...
Two players, A and B alternately and independently flip a coin and the first one who...
Two players, A and B alternately and independently flip a coin and the first one who flip a head on top will win. Assume player A flips first. If the coin is fair, what is the probability that A wins?If A tossed N+1 times, B tossed N times, what’s the probability that A gets more heads than B?If A and B each tosses a fair coin N times. Find the probability that they get the same number of heads.
Define the following events: A-> person had flip flops on B-> Person had blonde hair C->...
Define the following events: A-> person had flip flops on B-> Person had blonde hair C-> Person had red hair D-> Person had black hair E-> Person had brown her a. What is P(B')? b. What is P(C U E)? c. What is P(A U C)? d. What is P(A intersection C)? e. What is P(A' intersection (B U D))? Define the following events: A-> coin lands on heads B-> die lands on a "1" a. How many unique outcomes...
1)Design the sample space for an experiment where you will flip three coins into the air,...
1)Design the sample space for an experiment where you will flip three coins into the air, first one, then the second, and finally the third to examine the faces landing upwards. Use the sample space to answer the questions that follow. Probabilities should be expressed as decimals. A) Please identify the sample space for this experiment. B) What is the probability of at least one head showing? C) What is the probability of exactly one tail showing? D) What is...
Flip all 3 coins 10 times. Each flip place a tally mark next to the number...
Flip all 3 coins 10 times. Each flip place a tally mark next to the number of heads in the following table Experiment 1 Number of Heads TallyMark 0 1 1 4 2 5 3 0 Total Tosses 10 Experiment 2 Number of Heads TallyMark 0 7 1 17 2 16 3 10 Total Tosses 50 Experiment 3 Number of Heads TallyMark 0 16 1 41 2 27 3 16 Total Tosses 100 For each of the tables on the...
Each of persons A, B and C has a gun containing a single bullet. Each person,...
Each of persons A, B and C has a gun containing a single bullet. Each person, as long as she is alive, may shoot at any surviving person. First A can shoot, then B (if still alive), then C (if still alive). Denote by pi ∈ (0, 1) the probability that player i hits her intended target. Assume that each player wishes to maximize her probability of survival; among outcomes in which her survival probability is the same, she wants...
Light from three different lasers (A, B, and C), each with a different wavelength, was shined...
Light from three different lasers (A, B, and C), each with a different wavelength, was shined onto the same metal surface. Laser A produced no photoelectrons. Lasers C and B both produced photoelectrons, but the photoelectrons produced by laser C had a greater velocity than those produced by laser B. Arrange the lasers in order of increasing wavelength.
Light from three different lasers (A, B, and C), each with a different wavelength, was shined...
Light from three different lasers (A, B, and C), each with a different wavelength, was shined on the same metal surface. Laser A produced no photoelectrons. Lasers B and C both produced photoelectrons, but those produced by B had a greater velocity than those produced by C. Arrange the lasers in order of increasing wavelength. If A didn't produce any photoelectrons, Wouldn't it just be a straight line with the highest frequency? And to have a greater velocity would that...
An experiment consists of repeatedly tossing 2 fair coins until the toss results in one each...
An experiment consists of repeatedly tossing 2 fair coins until the toss results in one each of a Head and a Tail. What is the mathematical expectation of the number of times you will need to toss the 3 coins to achieve this?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT