Question

In: Statistics and Probability

use r programming, details on the codes please. Consider an urn with 10 balls inside, 7...

use r programming, details on the codes please.

Consider an urn with 10 balls inside, 7 of which are red and 3 of which are green. Select 3 balls successively from the urn. Let A = {1 st ball is red}, B = {2 nd ball is red}, and C = {3 rd ball is red}. Then P(all 3 balls are red) = P(A ∩ B ∩ C)


     a) Calculate the Probability with R? (1)

     b) Also, what is the probability of observing red, then green, then red? (1)

Let us roll a 4-sided die three times. a)Let us define the random variable U = X1 − X2 + X3. What is the probability that U > 6. (1) b) Also, if A = X1+X2+X3, What is the probability of A > 9.(1)


3. Randomized Controlled Trials are a type of medical experiment, where the eligible participants are randomly assigned (allocated) to one of the two (or more) branches of the study. A randomized controlled trial is considered the gold standard of clinical trials. In these studies, randomization helps to control for confounding factors, and evenly distribute prognostic factors across groups. This is somewhat like a loaded dice experiment.

            Let’s create an “unfair” dice that has a 0.35 probability of resulting in a 6, and a    probability of 0.13 for each of the other outcome.

Hint: Use the sample command.

a) Simulate a sample of 10 trials of throwing the dice. (1)

b) How many 6’s do you get count using R. (1)

Write a function cancerservival where the probability of cure, recurrence, metastasis and death are (0.3, 0.3, 0.25 and 0.15 respectively). (2)
a) Use the function to simulate the results of 100 cancer occurrences. (1)

b) Report the number of patients cured. (1)

Solutions

Expert Solution

Here there are three urns each containing 7 red, 5 green and 3 white balls.

Two old urns containing 5 red, 3 green and 7 white balls.

Probability of selecting a old urn = 2/5

Probability of selecting a new urn = 3/5

The urns are identical except for an old or new date stamped beneath the base.

If a single red ball is randomly drawn from one of these urns.

Pr(a single red ball is drawn from a old urn) = 5/(5 + 3 + 7) = 1/3

Pr(a single red ball is drawn from a new urn) = 7/(7 + 5 + 3) = 7/15

Probability of selecting a red ball = Pr(a single red ball is drawn from a old urn) * Pr(a old urn is selected) + Pr(a single red ball is drawn from a new urn) * Pr(a new urn is selected)

= 5/15 * 2/5 + 7/15 * 3/5 = 31/75

Pr(the red ball is drawn from old urn) = Pr(a single red ball is drawn from a old urn) * Pr(a old urn is selected) / Probability of selecting a red ball

= (2/5 * 1/3)/(31/75) = (2/15)/(31/75) = 10/31

Pr(The red ball is drawn from new urn) = 1 - 10/31 = 21/31


Related Solutions

Urn 1 contains 10 red balls, 5 green balls and 12 orange. Inside Urn 2 there...
Urn 1 contains 10 red balls, 5 green balls and 12 orange. Inside Urn 2 there are 7 red, 13 green, and 20 orange balls. Flip a coin to choose the urn, so there is a 55% chance to heads, you pick urn 1. If you pick tails, you pick urn 2. Then pick a ball from one of the urns after you flip. If you choose an orange ball, pick again but do this only once. a) Draw a...
Urn 1 contains 8 green balls and 10 red balls. Urn 2 contains 7 green balls...
Urn 1 contains 8 green balls and 10 red balls. Urn 2 contains 7 green balls and 5 red balls. A die is rolled, if a 1 or 2 is rolled, a ball is chosen from urn 1, if a 3, 4, 5, or 6 is rolled, a balls is chosen from urn 2. What is the probability of selecting a green ball? Please show all work.
An urn contains 7 red and 10 blue balls. If 4 balls are to be randomly...
An urn contains 7 red and 10 blue balls. If 4 balls are to be randomly selected without replacement, what is the probability that the first 2 selected are red and the last 2 selected are blue? Explain each step ?
Consider an urn containing 3 red balls, 5 yellow balls, 7 blue balls, and 6 violet...
Consider an urn containing 3 red balls, 5 yellow balls, 7 blue balls, and 6 violet balls. If 4 balls are drawn at random, what is the probability of drawing one of each color? Suppose we draw 8 balls from the urn above. What is the conditional probability that 4 of them are blue with respect to the event that none of them are yellow?
Use R programming to resolve this; can you please provide details on the code? A) Create...
Use R programming to resolve this; can you please provide details on the code? A) Create a dataframe – comparativeGenomeSize with the following vectors: > organism<-c("Human","Mouse","Fruit Fly", "Roundworm","Yeast") > genomeSizeBP<-c(3000000000,3000000000,135600000,97000000,12100000) > estGeneCount<-c(30000,30000,13061,19099,6034) B) Print the organism and estGeneCount for Human and fruitfly.(1) C) Add a column to this data frame calculating base pairs per gene. To do this, write a function “genedensity” that takes as arguments the genomesizeBP and estimatedGeneCount information, and calculates from this the estimated bp per gene....
1. Consider the following game: An urn contains 20 white balls and 10 black balls. If...
1. Consider the following game: An urn contains 20 white balls and 10 black balls. If you draw a white ball, you get $1, but if you draw a black ball, you loose $2. (a) You draw 6 balls out of the urn. What is the probability that you will win money? (b) How many balls should you draw in order to maximize the probability of winning? Hint: Use a computer.
An urn contains 4 white balls and 6 red balls. A second urn contains 7 white...
An urn contains 4 white balls and 6 red balls. A second urn contains 7 white balls and 3 red balls. An urn is selected, and the probability of selecting the first urn is 0.1. A ball is drawn from the selected urn and replaced. Then another ball is drawn and replaced from the same urn. If both balls are white, what are the following probabilities? (Round your answers to three decimal places.) - (a) the probability that the urn...
An urn contains 6 red balls and 4 green balls. A sample of 7 balls is...
An urn contains 6 red balls and 4 green balls. A sample of 7 balls is selected at random. a. How many different samples are possible? b. How many samples contain 5 red and 2 green balls? c. How many sample contain all red balls? d. How many samples contain at least 4 red balls? e. What is the probability in a draw of 7 balls there is 3 red and 4 green?
An urn contains 6 red balls, 7 white balls, and 8 blue balls. a) If three...
An urn contains 6 red balls, 7 white balls, and 8 blue balls. a) If three balls are sampled without replacement, find probability that all are different colors b) If three balls are sampled with replacement, find the probability that are different colors. c) i n balls sampled with replacement, find probability that all are red. d) If nballs sampled with replacement, find the probability that all are the same color.
An urn contains 10 balls numbered 1 through 10. Five balls are drawn at random and...
An urn contains 10 balls numbered 1 through 10. Five balls are drawn at random and without replacement. Let A be the event that “Exactly two odd-numbered balls are drawn and they occur on odd-numbered draws from the urn.” What is the probability of event A? Please explain Thank you
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT