I am Racheal W. I am a Probability Assignment Expert at statisticsassignmenthelp.com. I hold a Masters in Statistics from, Massachusetts Institute of Technology, USA.
I have been helping students with their homework for the past 7 years. I solve assignments related to probability.
Visit statisticsassignmenthelp.com or email info@statisticsassignmenthelp.com.
You can also call on +1 678 648 4277 for any assistance with probability assignments.
1. Introduction to Probability and Statistics
For any Statistics related queries, Call us at - +1 678 648 4277
You can mail us at - info@statisticsassignmenthelp.com, or
reach us at - https://www.statisticsassignmenthelp.com/
Statistics Assignment Help
2. Problem 1. âBoy or girlâ paradox.
The following pair of questions appeared in a column by Martin Gardner in ScientiďŹc
American in 1959.
(a) Mr. Jones has two children. The older child is a girl. What is the probability that both
children are girls?
(b) Mr. Smith has two children. At least one of them is a boy. What is the probability that
both children are boys?
Be sure to carefully justify your answers.
Solutions:
(a) Listing the gender of older child first, our sample space is {BB,BG,GB,GG} . The event
âthe older child is a girlâ is {GB,GG} and the event âboth children are girlsâ is
{GG} . Thus the probability that both children are girls given the older child is a girl is 1/2 .
(b) The event âat least one child is a boyâ is {BB,BG,GB} so the probability that both
children are boys is 1/3
.
Statistics Assignment Help
3. Problem 2. The blue taxi.
In a city with one hundred taxis, 1 is blue and 99 are green. A witness observes a hit-and-
run by a taxi at night and recalls that the taxi was blue, so the police arrest the blue taxi
driver who was on duty that night. The driver proclaims his innocence and hires you to
defend him in court. You hire a scientist to test the witnessâ ability to distinguish blue and
green taxis under conditions similar to the night of accident. The data suggests that the
witness sees blue cars as blue 99% of the time and green cars as blue 2% of the time.
Write a speech for the jury to give them reasonable doubt about your clientâs guilt. Your
speech need not be longer than the statement of this question. Keep in mind that most
jurors have not taken this course, so an illustrative table may be easier for them to
understand than fancy formulas.
Statistics Assignment Help
4. Solutions:
The defense will try to make the case that this is likely to be a case of random mis-
identification. So we look for the probability a random taxi the witness sees as blue is
actually blue.
This is a question of âinvertingâ conditional probability. We know
P(the witness sees blue|the car is blue)
but weâd like to know
P(the car is blue|the witness sees blue).
Our first job is to translate this to symbols.
Let Wb = âwitness sees a blue taxiâ and let Wg = âwitness sees a green carâ. Further, let Tb =
âtaxi is blueâ and let Tg = âtaxi is greenâ. With this notation we want to find P(Tb|Wb). We
will compute this using Bayesâ formula
Statistics Assignment Help
5. All the pieces are represented in the following diagram.
We can determine each factor in the right side of Bayesâ formula:
We are given P(Tb) = .01 (and P(Tg) = .99).
We are given, P(Wb|Tb) = .99 and P(Wb|Tg) = .02.
We compute P(Wb) using the law of total probability:
P(Wb) = P(Wb|Tb)P(Tb) + P(Wb|Tg)P(Tg) = .99 Ă .01 + .02 Ă .99 = .99 Ă .03.
Putting all this in Bayesâ formula we get
Statistics Assignment Help
6. Ladies and gentlemen of the jury. The prosecutor tells you that the witness is nearly
flawless in his ability to distinguish whether a taxi is green or blue. He claims that this
implies that beyond a reasonable doubt the taxi involved in the hit and run was blue.
However probability theory shows without any doubt that the probability a random taxi
seen by the witness as blue is actually blue is only 1/3. This is considerably more than a
reasonable doubt. In fact it is more probable than not that the taxi involved in the accident
was green. If the probability doesnât fit you must acquit!
Statistics Assignment Help
7. Problem 3. Trees of cards.
There are 8 cards in a hat:
{1âĽ, 1â , 1âŚ, 1âŁ, 2âĽ, 2â , 2âŚ, 2âŁ}
You draw one card at random. If its rank is 1 you draw one more card; if its rank is two you
draw two more cards. Let X be the sum of the ranks on the 2 or 3 cards drawn. Find E(X).
Statistics Assignment Help
8. Solution:
The following tree shows all the possible values for X (note, below each edge in the
tree is the conditional probability that edge).
At this point we have enough information to compute expectation.
Statistics Assignment Help
9. We can also give the probability distribution of X
Statistics Assignment Help
10. Problem 4. Dice.
There are four dice in a drawer: one tetrahedron (4 sides), one hexahedron (i.e., cube, 6-
sides), and two octahedra (8 sides). Your friend secretly grabs one of the four dice at
random. Let S be the number of sides on the chosen die.
(a)What is the pmf of S?
Now your friend rolls the chosen die and without showing it to you rolls it.. Let R be the
result of the roll.
(b)Use Bayesâ rule to ďŹnd P (S = k | R = 3) for k = 4, 6, 8. Which die is most likely if
R = 3?
Terminology: You are computing the pmf of âS given R = 3â.
(c)Which die is most likely if R = 6? Hint: You can either repeat the computation in (b), or
you can reason based on your result in (b).
(d)Which die is most likely if R = 7?
No computations are needed!
Statistics Assignment Help
11. Solution:
(a)
(b) Bayesâ rule says
We summarize what we know in a tree. In the tree the notation S4 means the 4-sided die
(S = 4), likewise R3 means a 3 was rolled (R = 3). Because we only care about the case R =
3 the tree does not include other possible rolls.
We have the following probabilities (you should identify them in the tree):
P(R =3|S = 4) = 1/4,P(R =3|S = 6) = 1/6,P(R =3|S = 8) = 1/8.
The law of total probability gives (again, see how the tree tells us this):
P(R =3) = P(R =3|S = 4)P(S = 4)+ P(R =3|S = 6)P(S = 6)+ P(R =3|S = 8)P(S = 8)
Statistics Assignment Help
12. Hence,
(c) In a similar vein, we have
P(R =6|S = 4) = 0,P(R =6|S = 6) = 1/6,P(R =6|S = 8) = 1/8.
and
So,
Statistics Assignment Help
13. The eight-sided die is more likely. Note, the denominator is the same in each probability,
i.e. the total probability P(R = 6), so all we had to check was the numerator.
(d) The only way to get R = 7 is if we picked an octahedral die.
Statistics Assignment Help
14. Problem 5. Seating arrangement and relative height
A total of n people randomly take their seats around a circular table with n chairs. No two
people have the same height. What is the expected number of people who are shorter
than both of their immediate neighbors?
Solution:Label the seats 1 to n going clockwise around the table. Let Xi be the Bernoulli
random variable with value 1 if the person in seat i is shorter than his or her neighbors.
Then represents the total number of people who are shorter than both of their
neighbors, and
by linearity of expected value. Recall that this property of expected values holds even
when the Xi are dependent, as is the case here!
Among 3 random people the probability that the middle one is the shortest is 1/3.
Therefore Xi âź Bernoulli(1/3), which implies E(Xi)=1/3. Therefore the expected number
of people shorter than both their neighbors is
Statistics Assignment Help
15. Alternate (and more complicated) solution
Suppose we number the n people based on their height, from shortest to tallest (so person
1 is the shortest and person n is the tallest). For person k, there are n â k people who are
taller. In order for person kâs neighbors to be taller than person k, we can pick two
neighbors from these n â k in nâkn ways. Moreover, there are total ways to pick the
neighbor of person k. Thus, the probability that person k is seated between two people
taller than him/her is
This formula is valid for k =1, 2,...,n â 2 and for k = n â 1 and k = n, we let pk =0 (since there
is no way for the tallest person or the second tallest person to be sitting next to two
people taller than themselves).
We can define n Bernoulli random variables, X1,...,Xn, as follows:
Thus, E(Xk)= pk for k =1, 2, . . . , n. The total number of people who are seated next to
people taller than them is X = X1 +¡¡¡+Xnâ2, (again we ignore Xnâ1 and Xn since they
have to be 0). So, we get, by linearity of expectation
Statistics Assignment Help
16. One can show (after a bit of algebra) that this sum is equal to n/3.
Had we ordered the people from tallest to shortest, then we would have
Statistics Assignment Help
17. Problem 6.
(a) Write down a random sequence of 50 ďŹips (0 and 1).
(b) A run is a sequence of all 1âs or 0âs. How long is the longest run in your answer to part
(a)?
(c) Weâll use R to simulate 50 tosses of a fair coin. Weâll estimate the average length of
the longest run. The code below simulates one trial. You will need to use a âfor loopâ to
run 10000 trials. In Friday Studio we will go over âfor loopsâ. We will also post a tutorial
on both loops and the rle() function used in the code.
# R code to run one trial of 50 flips of a fair coin and find the longest run nflips = 50
trial = rbinom(nflips, 1, .5) # binomial(1,.5) = bernoulli(.5)
# rle stands for ârun length encodingâ. rle(trial)$lengths is a vector of the lengths of all
the different runs in trial.
maxRun = max(rle(trial)$lengths)
(d)A small modiďŹcation of your code will let you estimate the probability of a run of 8 or
more in 50 ďŹips. Do this with 10000 trials and report the result.
Statistics Assignment Help
18. Solutions:
(a) Any sequence of 50 0âs and 1âs is valid. However, most people do not put in any long
runs that parts (c) and (d) will show happen frequently.
(c) Here is my code with comments
nflips = 50 ntrials = 10000 total = 0 # Weâll keep a running total of all the trialsâ longest runs
for (j in 1:ntrials)
{
# One trial consists of 50 flips trial = rbinom(nflips, 1, .5) # binomial(1,.5) = bernoulli(.5) #
rle() finds the lengths of all the runs in trials. We add the max to total
total = total + max(rle(trial)$lengths)
}
# The average maximum run is the total/ntrials
aveMax = total/ntrials print(aveMax)
My run of this code produced aveMax = 5.9645
(d) Instead of keeping a total we keep a count of the number of trials with a run of 8 or
more
nflips = 50 ntrials = 10000
# Weâll keep a running count of all the trials with a run of 8 or more
Statistics Assignment Help
19. count = 0 for (j in 1:ntrials)
{
trial = rbinom(nflips, 1, .5) # binomial(1,.5) = bernoulli(.5) count = count +
(max(rle(trial)$lengths) >= 8)
}
# The probability of a run of 8 or more is count/ntrials
prob8 = count/ntrials print(prob8)
My run of this code produced prob8 = 0.1618
Statistics Assignment Help