Question

Using R, simulate tossing 4 coins as above, and compute the random variable X(the outcome of...

Using R, simulate tossing 4 coins as above, and compute the random variable X(the outcome of tossing a fair coin 4 times & X = num of heads - num of tails.). Estimate the probability mass function you computed by simulating 1000 times and averaging.

Homework Answers

Answer #1

The outcome of tossing a fair coin 4 times will be 24 = 16 which are HHHH HHHT HHTH HTHH HHTT HTHT HTTT THHH TTHH THHT TTHT HTTH THTH TTTH THTT TTTT.

Let X be the difference between number of heads and number of tails

So, the value of X can be (4-0), (3-1), (2-2), (3-1), (4-0) = 0, 2 ,4

The probability mass function

P(X=x)=

where x is the outcome and n is the number of coin tossed.

R code

#taking 0 =Tail 1=Head
n=4 #no of coin
FlipCoin = function(n) sample(0:1,n,rep=T)
e1=FlipCoin(16)
e1 # sample space

flips<-rbinom(1000, 4, .5)
pbinom(flips,n,.5) #probability mass function

OP:

> e1
 [1] 0 0 0 1 1 1 1 1 1 0 0 1 1 0 1 1
pbinom(flips,n,.5)
   [1] 0.6875 0.3125 0.9375 0.6875 0.6875 0.3125 0.3125 0.3125 0.9375....
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
You select a coin at random: 2/3 of the coins are unfair, 1/3 of the coins...
You select a coin at random: 2/3 of the coins are unfair, 1/3 of the coins are fair. The fair coins are equally likely to flip heads or tails. The unfair coins flip heads 3/4 of the times, and tails 1/4 of the times. You flip the selected coin and get heads or tails. Find (1) the probability that the selected coin is fair given the flip is heads, (2) the probability that the selected coin is fair given the...
The random variable X is the number of tails obtained after tossing 4 coins. A) List...
The random variable X is the number of tails obtained after tossing 4 coins. A) List the all possible outcomes. How many possible outcomes? ARe they equally likely outcomes? B) Using a table, display the probability distribution of the number of tails. C) Calculate the probability of one tail or two tails. D) Calculate the probability of at least of one tail.
Consider an experiment of tossing two coins three times. Coin A is fair but coin B...
Consider an experiment of tossing two coins three times. Coin A is fair but coin B is not with P(H)= 1/4 and P(T)= 3/4. Consider a bivariate random variable (X,Y) where X denotes the number of heads resulting from coin A and Y denotes the number of heads resulting from coin B. (a) Find the range of (X,Y) (b) Find the joint probability mass function of (X,Y). (c) Find P(X=Y), P(X>Y), P(X+Y<=4). (d) Find the marginal distributions of X and...
An experiment consists of tossing a coin 6 times. Let X be the random variable that...
An experiment consists of tossing a coin 6 times. Let X be the random variable that is the number of heads in the outcome. Find the mean and variance of X.
Use a random-number table to simulate the outcomes of tossing a quarter 12 times beginning at...
Use a random-number table to simulate the outcomes of tossing a quarter 12 times beginning at row 1, block 4. Assume that the quarter is balanced (i.e., fair) and an even digit is assigned to the outcome heads (H) and an odd digit to the outcome tails (T). 65321 85623 10204 50218 20321 22315 98532 91972 39800 45670 20510 10451 92012 59826 35456 79289 91483 29754 45652 98653 45863 36963 15326 78952 45678 10100 91251 37041 13712 14672
The probability with which a coin shows heads upon tossing is p. The random variable X1...
The probability with which a coin shows heads upon tossing is p. The random variable X1 takes the values 1 and 0 if the outcome of the "first toss is heads or tails respectively; another random variable X2 is defined in the same way based on the second toss. (a) Is X1-X2 a sufficient statistic for p? Show the work. (b) Is X1+X2 a sufficient estimator for p? Show the work.
Conducting a Simulation For example, say we want to simulate the probability of getting “heads” exactly...
Conducting a Simulation For example, say we want to simulate the probability of getting “heads” exactly 4 times in 10 flips of a fair coin. One way to generate a flip of the coin is to create a vector in R with all of the possible outcomes and then randomly select one of those outcomes. The sample function takes a vector of elements (in this case heads or tails) and chooses a random sample of size elements. coin <- c("heads","tails")...
In this problem, a fair coin is flipped three times. Assume that a random variable X...
In this problem, a fair coin is flipped three times. Assume that a random variable X is defined to be 7 times the number of heads plus 4 times the number of tails. How many different values are possible for the random variable X?
1. In this problem, a fair coin is flipped three times. Assume that a random variable...
1. In this problem, a fair coin is flipped three times. Assume that a random variable X is defined to be 7 times the number of heads plus 4 times the number of tails. How many different values are possible for the random variable X? 2. Fill in the table below to complete the probability density function. Be certain to list the values of X in ascending order. Value of X | Probability   
Let X be the random variable representing the difference between the number of headsand the number...
Let X be the random variable representing the difference between the number of headsand the number of tails obtained when a fair coin is tossed 4 times. a) What are the possible values of X? b) Compute all the probability distribution of X? c) Draw the cumulative distribution function F(x) of the random variable X.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT