In: Statistics and Probability
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)
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