## Archive for the ‘**probability-problems**’ Category

## PROB: Rules of Probability

**Trivial cases**:

**E or F**(general case):- If E and F are mutually exclusive (or E and F are disjoint sets), then

- If E and F are mutually exclusive (or E and F are disjoint sets), then
**Complement**:**Conditional Probability**:If E and F are independent events, then

**E and F**(General Case)- If E and F are
*independent events*, then

- If E and F are
**Important formula**

Given a pairwise disjoint subsets (B’s) of the sample space, i.e., , , then**Baye’s formula****Random Variable**– a function from Sample Space set to the set of Real NumbersTypes:

*Discrete Random Variables*– can take only discrete values from a set of real numbers . The set of discrete values may be finite or countably infinite.*Continuous Random Variables*

**Distribution Function**– the probability that random variable will have value less than*x*

and

Easy to see and

Distribution Functions for Discrete and Continuous variables

- Discrete, let be the probability that X is x_i
- Continuous, let be the probability density function

Note:

and at a single specific point, x

- Discrete, let be the probability that X is x_i
**Indicator Function**of a set A

**Stieltjes Notation**

Discrete Random Variables:

Continuous Random Variables:**Expected Value**

and

Linear function of random variables a+bX

Expected value of Indicator function

**Variance**Linear function of random variable

**Skewness**– measure of symmetryLinear function of random variable

**Kurtosis**– measure of spreadLinear function of random variable

For a normal distribution, kurtosis is 3.

**Moment Generating Function**Properties of MGF

- Unique distribution

Identical MGF for 2 different random variables implies they have the identical/same distribution function. - Linear function of random variables
- Derivative of MGF
- First order Derivative at t=0
- Higher order Derivative at t=0

- Unique distribution
**Laplace Transform****Characteristic Function****Change of variable**

Given Y = y(X), X = y^{-1}(X) = x(Y). y(X) is a continuous, monotonic and differentiable function, then it’s inverse x(Y) exists and is also continuously differentiable.Let f

_{X}(x) be density function of random variable X.Hint: If y'(x) > 0, F

_{Y}(y) = P(Y ≤ y) = P(X ≤ x(y)) = F_{X}(x(y)).Otherwise y'(x) < 0, then F

_{Y}(y) = P(Y < y) = P(X > x(y)) = 1-P(X ≤ x(y)) = 1-F_{X}(x(y)).Now evaluate f

_{Y}(y) = d F_{Y}(y)/dy.**Conditional Distributions**

Goal: What is the distribution of “X conditioned that X ∈ A”? Example: X|X>a, loss conditioned on loss is bigger than a.-
F

_{X|X>a}(x) = P(X≤x|X>a) = P(a < X ≤ x)/P(X > a) = (F(x)-F(a))/(1-F(a))

Density is**Quantiles**

q-quantile of distribution function F is Π_{q}(F)That value of x, say Π

_{q}for which F(x) = F(Π_{q}) = q**Inverse distribution functions**

We define a generalized inverse distribution function asThis holds even when F may not be continuous and strictly increasing.

## PROB: Rare disease

A disease effects 1 out of every 10,000 people.

A pharmaceutical company comes out with a test that gives positive 99% of the times, if somebody has a disease (and misses 1% of the times).

It also gives false positives, 2.5% of the time. When a person does not have a disease, the test might still come out positive by error.

What are the chances of a person having the disease if that person tested positive?

**Solution**:

*A – The event that somebody contracts the disease*

*B – The event that the test turns out positive*

Given

P(A) = 1/10000 = 0.0001, P (not A) = 1 - P(A) = 0.9999

P(B | A) = 0.99 : given a person has the disease (A), the probability that the test will be positive (B)

P(B | not A) = 0.025 : given a person does not have the disease (not A), the probability that the test will be positive (false positive) B

A | not A | sum | |
---|---|---|---|

B | P(A and B) = P(B|A)P(A) | P(not A and B) = P(B|not A)P(not A) | P(B) |

not B | P(A and not B) | p(not A and not B) | P(not B) |

total | P(A) = 0.0001 | P(not A) = 0.9999 | 1 |

**Goal**: To find P(A | B) : given that the test is positive (B), the probability that somebody will have the disease (A)

P(A | B) = P (A and B)/P(B) = P(B | A) P(A)/P(B)

We do not know P(B). How can we calculate it? Note: B = (B and A) or (B and not A)

P(B) = P(B and A) + P(B and not A) = P(B|A)P(A) + P(B|not A)P(not A)

P(B) = 0.99 x 0.0001 + 0.025 x 0.9999 =0 .0250965

therefore P(A|B) = 0.99 x 0.0001/P(B) = 0.0039447731

## PROB: At least 1 double six in 24 rolls of a `pair’ of dice

What is the probability of rolling 1 or more double sixes in 24 throws of a pair of dice, ?

Probability of not throwing a double six in a single throw of a pair of dice,

Probability of not throwing any double six in 24 throws of a pair of dice, P(NOT A) =

Probability of rolling 1 or more double sixes in 24 throws of a pair of dice, P(A) = 1 – P(NOT A)

## PROB: At least 1 six in 4 throws of a dice

What is the probability of getting at least 1 six in 4 rolls of a dice?

Let us define event A as

A | Rolling 1 or more sixes in 4 rolls of a dice |

NOT A | Rolling no sixes in 4 rolls of dice |

B | No six in a single roll of a dice |

P(B) | 1/6 |

## PROB: Game of dice

Let’s consider a game of rolling a standard, fair, six-sided die at most five times. You may stop whenever you want and receive as a reward the number of dollars corresponding to the number of dots shown on the die at the time you stop. The values at each roll will be 1, 2, 3, 4, 5, or 6, and the probability of each number on each roll is one-sixth. The objective is to find the stopping rule that will maximize the number of dollars you can expect to win on average.

If you always stop with the first roll, for example, the winnable amount is simply the expected value of a random variable that takes the values 1, 2, 3, 4, 5, and 6 with probability 1/6 each. That is, one-sixth of the time you will win 1, one-sixth of the time you will win 2, and so on, which yields the expected value 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6) = 7/2. Thus if you always quit on the first roll, you expect to win 3.5 dollars on the average.

But clearly it is not optimal to stop on the first roll if it is a 1, and it is always optimal to stop with a 6, so already you know part of the optimal stopping rule. Should you stop with a 5 on the first roll?

Clearly it is optimal to stop on the first roll if the value seen on the first roll is greater than the amount expected if you do not stop—that is, if you continue to roll after rejecting the first roll. That would put you in a new game where you are only allowed four rolls, the expected value of which is also unknown at the outset. The optimal strategy in a four-roll problem, in turn, is to stop at the first roll if that value is greater than the amount you expect to win if you continue in a three-roll problem, and so on. Working down, you arrive at one strategy that you do know. In a one-roll problem there is only one strategy, namely to stop, and the expected reward is the expected value of one roll of a fair die, which we saw is 3.5. That information now yields the optimal strategy in a two-roll problem—stop on the first roll if the value is more than you expect to win if you continue, that is, more than 3.5. So now we know the optimal strategy for a two-roll problem—stop at the first roll if it is a 4, 5, or 6, and otherwise continue—and that allows us to calculate the expected reward of the strategy.

In a two-roll problem, you win 4, 5, or 6 on the very first roll, with probability 1/6 each, and stop. Otherwise (the half the time that the first roll was a 1, 2 or 3) you continue, in which case you expect to win 3.5 on the average. Thus the expected reward for the two-roll problem is 4(1/6) + 5(1/6) + 6(1/6) + (1/2)(3.5) = 4.25. This now gives you the optimal strategy for a three-roll problem—namely, stop if the first roll is a 5 or 6 (that is, more than 4.25), otherwise continue and stop only if the second roll is a 4, 5, or 6, and otherwise proceed with the final third roll. Knowing this expected reward for three rolls in turn yields the optimal strategy for a four-roll problem, and so forth. Working backwards, this yields the optimal strategy in the original five-roll problem: Stop on the first roll only if it is a 5 or 6, stop on the second roll if it is a 5 or 6, on the third roll if it is a 5 or 6, the fourth roll if it is a 4, 5 or 6, and otherwise continue to the last roll. This strategy guarantees that you will win about 5.12 Dollars on average, and no other strategy is better. (So, in a six-roll game you should stop with the initial roll only if it is a 6.)

Total number of rolls | Stop if initial roll is | Average optimal expected reward |
---|---|---|

1 | {1,2,3,4,5,6} | 3.5 |

2 | {4,5,6} | (4+5+6)/6+3.5/2 = 4.25 |

3 | {5,6} | (5+6)/6+4.25*4/6 = 4.67 |

4 | {5,6} | (5+6)/6+4.67*4/6 = 4.94 |

5 | {5,6} | (5+6)/6+4.94*4/6 = 5.13 |