Question

Fraction of tails Now lets look at the fraction of tails in n trials. Fraction of tails in a small number of coin flips Tail
Fraction of tails in a large number of coin flips The expected fraction of tails is 0.5. Lets repeat the experiment with a l
0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER:

  • The difference between the observed fraction of tails and 0.5 does not changed with the number of trails as probablity of getting tail will not change on which trial you are tossing the coin.
  • I have provided the properly commented code in both text and image format so you can easily copy the code as well as check for correct indentation.
  • I have provided the output image of the code so you can easily cross-check for the correct output of the code.
  • Have a nice and healthy day!!

CODE TEXT

n = 10000
trials = 6
# defining empty list to store +ve difference and -ve difference in abs form
differences = c()
for (i in 1:trials){
# difference from expected
difference = sum(sample(c(0,1),n,replace=TRUE))/n-0.5
# appending abs(difference) in differences list
differences = append(differences,abs(difference))
print(difference)
}
# finding mean difference in differences list, to get approx +- difference
app_difference = mean(differences)
# displaying
print(paste ("+- difference is: ",app_difference, sep = " "))

CODE IMAGE

1 n = 10000 2 trials = 6 3 # defining empty list to store +ve difference and -ve difference in abs form 4 differences = c() 5

OUTPUT IMAGE

  • trials = 6

[1] +- difference is: 0.00346666666666665

  • trials = 600

[1] +- difference is: 0.00393233333333333

  • trials = 6000

[1] +- difference is: 0.00394683333333333

Add a comment
Know the answer?
Add Answer to:
Fraction of tails Now let's look at the fraction of tails in n trials. Fraction of...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Fraction of tails Now let's look at the fraction of tails in n trials. Fraction of...

    Fraction of tails Now let's look at the fraction of tails in n trials. Fraction of tails in a small number of coin flips Heads) Suppose we flip 10 coins and compute the fraction of tails (with 1 = Tails and 0 = = 10 trials = 6 for (i in 1: trials) { print (sum(sample(c(0, 1), n, replace-TRUE)) /n) ## [1] 0.1 ## [1] 0.4 ## [1] 0.4 ## (1) 0.5 ## [1] 0.7 *# (1) 0.6 The expected...

  • Flipping Coins For a fair coin, the chance of getting tails is 1/2. Counting the number...

    Flipping Coins For a fair coin, the chance of getting tails is 1/2. Counting the number of tails Let's experiment with the total number of tails in n trials. Total number of tails in a small number of coin flips ם Suppose we flip 10 coins (with 1 = Tails and 0 = Heads). Here are six samples of size 10. = 10 trials = 6 for (i in 1: trials) { print (sample(c(0, 1), 1, replace=TRUE)) مه ## [1]...

  • Flipping Coins For a fair coin, the chance of getting tails is 1/2. Counting the number...

    Flipping Coins For a fair coin, the chance of getting tails is 1/2. Counting the number of tails Let's experiment with the total number of tails in n trials. Total number of tails in a small number of coin flips n Suppose we flip 10 coins (with 1 = Tails and 0 = Heads). Here are six samples of size 10. - 10 trials = 6 for (i in 1: trials) { print (sample(c(0, 1), n, replace=TRUE)) ## [1] 0...

  • 2. . Write the function below per the docstring. A tuple is simply comma separated data....

    2. . Write the function below per the docstring. A tuple is simply comma separated data. In the function below, the tuple returned are 2 ints. def Htcounts (flips): "Given a list, flips, of H's and T's, returns a tuple of the number of H's and the number of T's, in that order. Uses 2 sum accumulators, one for number of heads, the other of the number of tails. Traverses the list, flips, with a for loop and uses booleans...

  • MATLAB problem Imagine we have three types of coins in a bag: Fair Coin (FC) with...

    MATLAB problem Imagine we have three types of coins in a bag: Fair Coin (FC) with Pr(Head) = Pr(Tail) = 0.5; Head-heavy Coin (HC) with Pr(Head) = 0.4; and Tail-heavy Coin (TC) with Pr(Head) = 0.6. A coin is randomly picked out of the bag. Write a MATLAB code that can estimate the type of this coin The result graph should look like this: Flipping a Fair Coin for 400 Times Fiping a Coin (1 for Head and 0 for...

  • Do the following in MATLAB: trials = 100; flip = rand(trials,1); heads = (flip >= 0.5);...

    Do the following in MATLAB: trials = 100; flip = rand(trials,1); heads = (flip >= 0.5); percentheads = sum(heads)/trials a.We can use a random number generator to estimate probabilities that might otherwise be difficult to evaluate. Consider the probability of obtaining four heads on four flips. Generate four separate random experiments of 0s and 1s representing N trials each. (You can do this by generating an Nx4 random array rather than an Nx1 array as in #1.) Now look at...

  • 1. Which of the following is a probability mass function for some probability distribution p with...

    1. Which of the following is a probability mass function for some probability distribution p with domain {1,2,3,4}? P(1)=0.1,P(2)=0.2,P(3)=0.3,P(4)=0.4 P(1)=0.1,P(2)=0.1,P(3)=0.3,P(4)=0.4 P(1)=0.2,P(2)=0.4,P(3)=0.3,P(4)=0.4 P(1)=-0.5,P(2)=0.8,P(3)=0.5,P(4)=0.2 2. Let X be the random variable where X is the number of heads after flipping a fair coin 50 times. What is the mean of X? 3. Suppose that one flips a fair coin 6 times. What is the probability of getting at most 2 heads? 4. Which of the following is a discrete probability distribution and...

  • 1. For a given binomial distribution with n fixed trials and p, which is the probability...

    1. For a given binomial distribution with n fixed trials and p, which is the probability of success of each trial, the binomial distribution is skewed left if p=0.50 Select one: True or False 2. Consider a graph of a normal distribution with the mean μμ and standard deviation σσ. The graph will never cross the horizontal axis. This happens because the normal distribution is an exponential function. Select one: True or False 3. Suppose you flip a fair a...

  • 1. Multiple choice. Circle all the correct answers a) You flip a coin 100,000 times and...

    1. Multiple choice. Circle all the correct answers a) You flip a coin 100,000 times and record the outcome in a Xi 1 if the toss is "Heads" and 0 if its "Tails. The Law of Large Numbers says that: i. ii. It is impossible for the first n flips to all be "Heads" if n is large. With high probability, the share of coin flips that are "Heads" will approximate 50%. The sample mean of X is always 0.5...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT