Please use R-Studio/any R compiler
Suppose we wanted to simulate the number of heads that came up in 10 flips of a coin that had probability 2/3 of coming up heads, and we wanted to repeat that simulation 5 times. Type the correct R command and the output.
Please use R-Studio/any R compiler Suppose we wanted to simulate the number of heads that came...
Please, answer the questions 5,6,7,8,9,10. Add explanations if
possible.
Use the following simulation to answer the questions. Assume you are flipping an unfair coin 20 times and calculating the proportion of times the 20 flips turn up heads. You repeat this 100 times and the simulation output is as follows. The probability of this unfair coin to come up heads is 0.40 Probability of success (TT): 0.4 Summary Stats Sample size (n): 20 Mean .0400 Number of samples: 100 SD...
Using R-studio 2. Consider an experiment where we flip a fair coin six times in a row, and i is the number of heads tossed: a. Calculate the probability mass function for i = 0. . . 6 using the equation from Ross section 2.8 for Binomial Random Variables b. Conduct a simulation of this experiment in R, with T trials of the experiment – pick several values of T from 10 to 10,000. c. Create a plot of the...
Suppose we flip a fair coin n times. We say that the sequence is balanced when there are equal number of heads and tails. For example, if we flip the coin 10 times and the results are HT HHT HT T HH, then this sequence balanced 2 times, i.e. at position 2 and position 8 (after the second and eighth flips). In terms of n, what is the expected number of times the sequence is balanced within n flips?
Solve the following problems in R studio or R. please help with
this question in writing codes in R.
1. Suppose you toss a fair coin 10 times, let X denote the number of heads. (a) What is the probability that X=5? (b) What is the probability that X greater or equal than 5? (c) If I want to make sure that the P(X<a) > 0.8, what is the minimum value of a? (a is an integer)
Please show ALL STEPS. NEAT HANDWRITING ONLY PLEASE Thank You Suppose we flip a fair coin n times. We say that the sequence is balanced when there are equal number of heads and tails. For example, if we flip the coin 10 times and the results areHTHHTHTTHH, then this sequence balanced 2 times, i.e. at position 2 and position 8 (after the second and eighth flips). In terms of n, what is the expected number of times the sequence is...
R CODE PROGRAM 1. Suppose we want to simulate an experiment that can take outcomes 1; : : : ; n with probabilies p1; : : : ; pn. To be specic, suppose the R-vector p=c(.1,.2,.3,.35, .02, .03) gives the desired probabilities. Write R code that produces a number from 1 to 6 with the given probabilities, without using if statements. I recommend using the R command cumsum to do this, though there many possible approaches. 2. Suppose we are...
LeBron James of the Miami Heat hit 765 of his 1354 field goal attempts in the 2012/2013 season for a shooting percentage of 56.5%. Over the lifetime of LeBron's career, can we say he is more likely than not to make a field goal? Describe the parameter of interest. the proportion of all shots made by NBA players in LeBron's career LeBron's long-run proportion of making a field goal the number of shots LeBron made in the 2012/2013 season the...
6. [R Programming| In order to complete this question, we will need to use a fundamen- tal theorem in probabilty theory known as the (Weak) Law of Large Numbers (WLLN) The WLLN will be covered in greater detail in Chapter 8, however we will use this key result throughout the course to approximate probabilities that are otherwise difficult to calculate theoretically. A simplified version of the theorem goes as follows. Assume we are interested in com- puting the probability of...
1a) Suppose you flip a weighted coin 19 times with probability of heads 0.55. Let X equal the number of heads. What is the mean number of heads (to two decimal places)? 1b) Suppose we have weighted coin with probability of heads being 0.30. What is the probability of getting four heads in five flips, to 2 decimal places? 2) Suppose a particular stock follows the "random walk" model where on any given day there is a 0.02 chance that...
In order to test whether a certain coin is fair, it is tossed ten times and the number of heads (X) is counted. Let p be the "head probability". We wish to test the null hypothesis: p = 0.5 against the alternative hypothesis: p > 0.5 at a significance level of 5%. (a) Suppose we will reject the null hypothesis when X is smaller than h. Find the value of h. (b) What is the probability of committing a type...