# Category Archives: Sequence of independent trials

## Magic Die (or is it rigged?)

A magician claims to have a magic die. If the die is rolled and lands on an even number, then the next time the die is rolled it will land on an odd number (and vice versa). So, as the die is rolled it will alternate perfectly between even and odd numbers (or so the magician claims).

You, being skeptical, figure there’s a 1 percent chance that the die is magical and a 99 percent chance that it’s just an ordinary fair die. You then ask the magician to “prove” the die is magical by rolling it some number of times.

How many successfully alternating rolls will it take for you to think there’s a 99 percent chance the die is magical (or, more likely, that it’s rigged in some way so it always alternates)?

## Point of increase

Suppose $$U_1,U_2, …$$ are independent uniform $$(0,1)$$ random variables. Let $$N$$ be the first point of increase. That is to say the first $$n \geq 2$$ such that $$U_n > U_{n-1}$$. Show that for $$u \in (0,1)$$:

1. $\mathbf{P}(U_1 \leq u \ { and } \ N=n)= \frac{u^{n-1}}{(n-1)!}-\frac{u^{n}}{n!} \quad;\quad n \geq 2$
2. $$\mathbf{E}(N)=e$$

Some useful observations:

• $\mathbf{P}(U_1 \leq u \ { and } \ N=n) = \mathbf{P}(U_1 \leq u \ { and } \ N \geq n) -\mathbf{P}(U_1 \leq u \ { and } \ N \geq n+1)$
• The following events are equal
$\{U_1 \leq u \quad{ and } \quad N \geq n\} = \{U_{n-1}\leq U_{n-2} \leq \cdots \leq U_2\leq U_{1} \leq u \}$
• $\mathbf{P}\{U_2 \leq U_1 \leq u \}= \int_0^u \int_0^{u_1} du_2 du_1$

A new elevator in a large hotel is designed to carry about 30 people, with a total weight of up to 5000 lbs. More that 5000 lbs. overloads the elevator. The average weight of guests at the hotel is 150 lbs., with a standard deviation of  55 lbs. Suppose 30 of the hotel’s guests get into the elevator . Assuming the weights of the guests are independent random variables, what is the chance of overloading the elevator  ? Give your approximate answer as a decimal.

[Pitman p 204, # 19]

## Coin tosses: independence and sums

A fair coin is tossed three times. Let $$X$$ be the number of heads on the first two tosses, $$Y$$ the number of heads on the last two tosses.

1. Make a table showing the joint distribution of $$X$$ and $$Y$$.
2. Are $$X$$ and $$Y$$  independent ?
3. Find the distribution of $$X+Y$$ ?

## Sums of Poisson

Agambler bets ten times on events of probability $$1/10$$, then twenty times on events with probability $$1/20$$, then thirty times on events with probability $$1/30$$, then forty times on events with probability $$1/40$$. Assuming the vents are independent, what is the approximate distribution of the number of times the gambler wins ? (use Poisson approx. of binomial)

[Pitman 2.5, pg 227]

## Random Digit

Let $$D_i$$ be a random digit chosen uniformly from $$\{0,1,2,3,4,5,6,7,8,9\}$$. Assume that each of the $$D_i$$ are independent.

Let $$X_i$$ be the last digit of $$D_i^2$$. So if $$D_i=9$$ then $$D_i^2=81$$ and $$X_i=1$$. Define $$\bar X_n$$ by

$\bar X_n = \frac{X_1 + \cdots+X_n}{n}$

1. Predict the value of $$\bar X_n$$ when $$n$$ is large.
2. Find the number $$\epsilon$$ such that for $$n=10,000$$ the chance that you prediction is off by more than $$\epsilon$$ is about 1/200.
3. Find approximately the least value of $$n$$ such that your prediction of $$\bar X_n$$ is correct to within 0.01 with probability at least 0.99 .
4. If you just had to predict the first digit of  $$\bar X_{100}$$, what digit should you choose to maximize your chance of being correct, and what is that chance ?

[Pitman p206, #30]

## Blocks of Bernoulli Trials

In $$n+m$$ independent $$\text{Bernoulli}(p)$$ trials, let $$S_n$$ be the number of successes in the first $$n$$ trials and $$T_m$$ number of successes in the last $$m$$ trials.

1.  What is the distribution of $$S_n$$ ? Why ?
2. What is the distribution of  $$T_m$$ ? Why ?
3. What is the distribution of $$S_n+T_m$$ ? Why ?
4. Are $$S_n$$ and $$T_m$$ independent ? Why ?

[Pitman p. 159, # 10]

## Subsequence problem

Scoring subsequences or lengths of similar matches or runs is common to a variety of problems from matches in genetic codes to similar runs in bits.

Consider the following question about two sequences of letters. Set both sequences to have length $$k$$. At each location of the sequences the probability of a match in letters is $$.7$$ and the probability of a mismatch is $$.3$$. At each location a match is assigned a score of $$4$$ and a mismatch is assigned a score of $$-1$$. The total score of the sequence is the sum of the scores at each location, there are $$k$$ locations.

1. What is the PMF of the total score if $$k=5$$.
2. What is the PMF of the total score for a general $$k$$ ?

## Airline Overbooking

An airline knows that over the long run, 90% of passengers who reserve seats for a flight show up. On a particular flight with 300 seats, the airline sold 324 reservations.

1. Assuming that passengers show up independently of each other, what is the chance that the flight will be overbooked ?
2. Suppose that people tend to travel in groups. Would that increase of decrease the probability of overbooking ? Explain your answer.
3. Redo the  the calculation in the first question assuming that passengers always travel in pairs. Are your answers to all three questions consistent ?

[Pitman p. 109, #9]

## Biased coins

Given a random variable $$x = \{ 0,1\}$$ where $$0$$ corresponds to heads and $$1$$ corresponds to tails.

For a single coin flip: $$\mathbf{P}(x \mid p) = p^x(1-p)^{1-x}$$.

For a sequence of $$n$$ coin flips: $$\mathbf{P}(x_1,…,x_n \mid p) = \prod_{i=1}^n p^{x_i}(1-p)^{1-x_{i}}$$.

I have a bag with three types of coins with the following probabilities of drawing each type:

$$\mathbf{P}(p=.5) = .7$$,  $$\mathbf{P}(p=.1) = .2$$, $$\mathbf{P}(p=.9) = .1$$.

I draw a coin from the bag. I flip it $$n$$ times resulting in a sequence $$X_1,…,X_n$$.

1. Using Bayes rule provide the formula for
$\mathbf{P}(p = .1 \mid x_1,…,x_n),\quad \mathbf{P}(p = .5 \mid x_1,…,x_n), \quad\text{and}\quad \mathbf{P}(p = .9 \mid x_1,…,x_n)$.
2. If  $$x_1,x_2,x_3,x_4,x_5,x_6,x_7,x_8)=(1,1,0,1,1,0,0,1)$$ what is the most likely value  probability $$p$$ of the coin the was used ?

## Chance of an Accident.

An insurance company has 50% urban and 50% rural customers. If every year each urban customer has an accident with probability $$\mu$$ and each rural customer has an accident with probability $$\lambda$$. Assume that the chance of an accident is independent from year to year and from customer to costumer. This is another way to say, conditioned on being and urban or rural the chance of having an accident each year is independent.

A costumer is randomly chosen. Let $$A_n$$ be the chance this customer has an accident in year $$n$$.  Let $$U$$ denote the event that this costumer is urban and $$R$$ the event that the customer is rural.

1. Find $$\mathbf{P}(A_2|A_1)$$.
2. Are $$A_1$$ and $$A_2$$ independent in general ? Are there any conditions when it is true  if not in general ?
3. Show that $$\mathbf{P}(A_2|A_1) \geq \mathbf{P}(A_2)$$.
To answer this question it is useful to know that for any positive $$a$$ and $$b$$, one has $$(a+b)^2 < 2(a^2 +b^2)$$ as long as $$a \neq b$$. In the case $$a = b$$, one has of course $$(a+b)^2 = 2(a^2 +b^2)$$. To prove this inequality, first show that $$(a+b)^2 +(a-b)^2= 2(a^2 +b^2)$$ and then use that fact that $$(a-b)^2 >0$$.
4. Find the probability that a driver  has an accident in the 3nd year given that they had one in the 1st and 2nd year.
5. Find the probability that a driver  has an accident in the $$n$$-th year given that they had one in all of the previous years. What is the limit as $$n \rightarrow \infty$$ ?
6. Find the probability that a diver is a urban diver given that they had an accident in two successive years.

## Duels

Mathematicians and politicians throughout history have dueled.

Alexander Hamilton and Aaron Burr dueled.

The French mathematician Evariste Galois died in a duel.

Consider two individuals (H) and (B) for example dueling.

In each round they simultaneously shoot the other and the probability

of a fatal shot is $$0 < p < 1$$.

1) What is the probability they are fatally injured in the same round ?

2) What is the probability that (B) will be fatally injured before (H) ?

## Two die

Two dice are rolled. Find the probabilities of the following events.

a) the maximum of the two numbers rolled is less than or equal to 2;

b) the maxinum of the two numbers rolled is less than or equal to 3;

c) the maximum of the two numbers rolled is exactly equal to 3;

d) Repeat b) and c) with  3 replaced by $$x=1,…,6$$;

e) Denote $$\mathbf{P}(x)$$ as the probability that the maximum number is exactly $$x$$.

Compute  $$\sum_{x=1}^6\mathbf{P}(x)$$.

[Pitman Page 10, #7]

## Blocks of Bernoulli Trials

In $$n+m$$ independent  Bernoulli $$(p)$$ trials, let $$S_n$$ be the number of successes in the first $$n$$ trials, $$T_n$$ the number of successes in the last $$m$$ trials.

1. What is the distribution of $$S_n$$ ? Why ?
2. What is the distribution of $$T_m$$ ? Why ?
3. What is the distribution of $$S_n+T_m$$ ? Why ?
4. Are $$S_n$$ and $$T_m$$ independent ? Why ?
5. Are $$S_n$$ and $$T_{m+1}$$ independent ? Why ?
6. Are $$S_{n+1}$$ and $$T_{m}$$ independent ? Why ?

Based on [Pitman, p. 159, #10]