Question: I need help coding with R please. There are two problems to solve R. Here is the prompt: Here are the two questions: Here are

I need help coding with R please. There are two problems to solve R.

Here is the prompt:

I need help coding with R please. There are two problems to

Here are the two questions:

solve R. Here is the prompt: Here are the two questions: Here

Here are my solutions by hand:

Ch 15 Rev 4: (6!/3!3!) (3/11)^3 x (8/11)^3 = 0.1561= 15.61%

Ch 15 Rev 8: P(X=2)= 5!/ 2!(5-2)! x (1/2)^2 (1-(1/2))^(5-2) = 0.3125 31.25%

Here is the code from 2/11 my teacher wrote us:

are my solutions by hand: Ch 15 Rev 4: (6!/3!3!) (3/11)^3 x

For Ch 15 Rev 4 and Ch 15 Rev 8, solve in R in two ways: 1) using the choose() function and binomial formula, and 2) using the dbinom() function (see code from 2/11). Based on Ch 15 Rev 4: A box has 8 red marbles and 3 green. Six draws are made at random with replacement. Find the chance that three green marbles are drawn. Ch 15 Rev 8: A coin will be tossed 10 times. Find the chance that there will be exactly 2 heads in the first 5 tosses, and exactly 4 heads in the last 5 tosses. # number of ways of mixing up k successes and n-k failures in n trials # = n!/(k! (n-k)!) 5*4*3*2*1/(2*1*3*2*1) #same as choose(5,2) # PC2 sixes in 5 die rolls) choose(5,2)*(1/6)^2 * (5/6)^3 # OR # dbinom (from our formula, x=k # successes, size=n # trials, prob=p) dbinom(x=2, size -5, prob=1/6) # PC5 H in 10 tosses) choose(10,5) * (1/2)45 * (1-1/2)^(10-5) # choose() function dbinom(x-5, size-10, prob=.5) mean(rbinom(n=100000, size=10, prob-.5) -- 5) # random binomial, n repetitions # simulated proportion should be about the same as chance

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!