Friday, February 13, 2015

Unizor - Probability - Binomial Distribution - Problems 1





Problem A
What are the expected value and the standard deviation of a Binomial random variable that is the number of successes in N=100 Bernoulli trials with probability of success p=0.1?

Solution
As we determined in the lecture about Binomial distribution, the expectation of the number of successes in our case is
E = N·p = 100·0.1 = 10
Standard deviation of our random variable is
σ = √(N·p·(1−p)) = √(100·0.1·0.9) = 3
Therefore, from each randomly chosen 100 parts we can reasonable expect 10 to be defective on average with average deviations from this number to be equal to 3.

Problem B
A machine produces parts for car engines. The probability to produce a defective part equals to p.
How many randomly chosen parts produced by this machine you have to take to expect, on average, D defective parts?

Solution
If N is the number of parts we randomly choose, the expected number of defective parts is N·p, as was explained in the lecture on Binomial distribution. This is the expectation of a random variable that is equal to a number of occurrences of a certain event in a series of Bernoulli trials, if the probability of occurrence in one trial is p.
Therefore, the condition we have to meet is
N·p = D
From this we can determine the number of parts to randomly choose to expect, on average, D defective among them:
N = D/p

Problem C
A machine produces parts for car engines. The measure of the quality of production is the probability to produce a defective part p, which is unknown.
A very large group of N parts is randomly chosen and it contains D defective parts. What would be an estimate of the probability to produce a defective part?

Solution
Notice the words "very large group" and "estimate" in the problem. We cannot exactly tell what is the value of the probability to produce a defective part. However, a good estimate would be a value p that satisfies the equation N·p=D, that is
p ≅ D/N

Problem D
Two dice are rolled and the resulting numbers are added together. If the sum is 7, it's a failure. Otherwise, this is a success.
Assume a game when you roll this pair of dice ten times and, if you fail two or more times (that is, the sum of two numbers equals to 7 in two or more cases out of ten), you lose the game. Otherwise (the sum equals to 7 zero or one time out of ten) you win.
The bet is 1 bitcoin. The payback is also 1 bitcoin.
Is it a good game for the house?

Solution
Clearly we deal here with Binomial distribution.
Let's determine the probability of hitting a sum of 7 (failure) in one roll of a pair of dice.
There are 36 different elementary events when rolling a pair of dice.
The combinations when the sum of two numbers equals to 7 are:
1+6; 2+5; 3+4; 4+3; 5+2; 6+1.
So, we have 6 combinations out of 36 possible, so the probability of hitting 7 (failure) in one roll of a pair of dice equals to 1/6. The probability of hitting non-7 (success), therefore, equals to 5/6
Now we win the game if zero or one out of ten rolls end up in a sum of 7, that is if no more than one failure occurs in ten rolls.

The probability of hitting 7 zero times out of ten equals to 10 times non-7 sums in a row. The probability of this event to happen one time equals to 5/6. Events are independent. So, the probability of 10 such events in a row equals to
P(10 non-7)=(5/6)^10,
which is, approximately, 0.1615.

The probability of hitting 7 exactly one time out of ten is a sum of probabilities to hit 7 on the first roll while having non-7 on all subsequent rolls, to hit 7 on the second roll while having non-7 on a previous and all subsequent rolls,..., to hit 7 on the tenth roll while having non-7 on all previous rolls. Obviously, the total probability equals to
P(9 non-7)=10·(5/6)^9·(1/6),
which is approximately 0.3230.

So, the probability to hit 7 in zero or one case out of ten (when you win the game and the house pays you back) equals to
P(win)=P(0 or 1 failure)≅0.1615+0.3230=0.4815.
As we see, it's slightly less than 0.5. Therefore, in a long run, the house has chances slightly better (probability to win the game for the house is 1-0.4815=0.5185), as it usually has in all games.
Exact calculations of the expected return for the house are:
R = 0.4815·(−1)+0.5185·1 = 0.037
It means that, on average, from each game of ten rolls, when a client bets 1 bitcoin to hit 7 no more than once, the house wins 0.037 bitcoins. Good game for the house.

No comments: