Find $P(\sum_{i=1}^{10} X_i>50)$ if $X_i\sim U\{\pm 1,\dots,\pm 6\}$.

337 Views Asked by At

A stock is currently worth \$$100$. each day a coin is flipped and a dice rolled. If the coin lands heads the stock price increases by the rolled value of the dice in $. If the coin lands tails, the stock price decreases by rolled value of the dice. What is probability that after 10 days the stock is worth more than 150?

What I've tried is that 50 is such a large number that if you don't roll a 6, you have to roll 5*5 for the dice every day. And then to discuss case by case of rolling one 6,two 6 and so on.But that's a lot of work and seems tedious for 10 cases.

Anyone can give me some insights on this?

2

There are 2 best solutions below

1
On BEST ANSWER

We can exactly solve this using the methodology of probability generating functions, together with a computer to help us crunch the numbers.

Let $f(x)$ be the probability generating function for the price increase of a single day. This increase is equally likely to be any number in $\{-6,-5,\dots,-1,1,2,\dots,6\}$, so $$ f(x)= \tfrac1{12}x^{-6}+\tfrac1{12}x^{-5}+\dots+\tfrac1{12}x^{-1}+ \tfrac1{12}x^{1}+\tfrac1{12}x^{2}+\dots+\tfrac1{12}x^{6} $$ I have not defined what a probability generating function is, but hopefully the above makes it somewhat clear. The probability generating function (pgf) encodes a probability distribution, with the coefficient of $x^n$ giving the probability of the value $n$.

It follows that the probability generating for the sum of the increases over ten days is $(f(x))^{10}$. This is the magic of probability generating functions; adding independent random variables corresponds to multiplication of pgf's. Therefore, we just need to compute $(f(x))^{10}$, and add up the coefficients of $x^n$, as $n$ ranges from $51$ to $60$. You can either do this with a computer-algebra-system, or you can directly write a program which multiplies pgf's, via the lists of their coefficients. I did the latter, and I found that the probability of the price increasing by more than $50$ over ten days is $$\frac{90\,178}{12^{10}}=\frac{45\,089}{30\,958\,682\,112}\approx 1.4564\times 10^{-6}.$$

Here is the Python program I used to compute this answer:

from fractions import Fraction    
    
def poly_multiply(P, Q):    
    """    
    P and Q are lists of numbers.     
    P represents a polynomial, where the coefficient    
    of x^k in P is P[k]. Same for Q.    
    Returns a list, representing the polynomial product P * Q.    
    """    
    
    # Initialize a list long enough to store largest coefficient of P * Q.    
    ret = [0] * (len(P) + len(Q) - 1)     
    # The coefficient of x^k in P * Q is the sum of    
    # P[i] * Q[j] over all i,j for which i + j = k.      
    for i in range(len(P)):    
        for j in range(len(Q)):    
            ret[i + j] += P[i] * Q[j]    
    return ret    
    
def poly_power(P, n):    
    ret = [1] # Initially, ret is the constant polynomial 1.    
    for _ in range(n):    
        ret = poly_multiply(P, ret) # Repeatedly multiply by P.    
    return ret     

# Initialize the pgf for the random gain over one day. 
# Instead of using the exact PGF, which has powers of x from -6 to 6,    
# we will instead multiply this by x^6, giviing a polynomial with degree 12.     
# This introduces an offset of 6 between the indices and coefficients.    
# That is, one_day_pgf[k] is the probabily that the gain is k - 6.    
one_day_pgf = [Fraction(1,12)] * 6 + [0] + [Fraction(1,12)] * 6    
    
# The ten-day gain is the tenth power of the one-day gain.    
# The offset from before is multiplied, so ten_day_pgf[k]    
# is the probability that the ten-day gain is k - 60.    
ten_day_pgf = poly_power(one_day_pgf, 10)    
    
# Find the probability that the gain is above 50.    
# The +60 in the index accounts for the offset. 
P_above_50 = sum(ten_day_pgf[gain + 60] for gain in range(51, 61))    
    
print('Exact probability:', P_above_50)    
print('Approximate probability:', float(P_above_50))
6
On

I have programmed the code, after $100000$ simulations I found that probability is $0.0000$; Moreover, I found that if dice always show $6$ even then probability to get more than $150$ is $0.0010$.

import random

def simulate_stock_price(days, current_price):
    if days == 0:
        return current_price > 150

    coin_flip = random.choice(['Heads', 'Tails'])
    dice_roll = random.randint(1, 6)
    
    if coin_flip == 'Heads':
        current_price += dice_roll
    else:
        current_price -= dice_roll

    return simulate_stock_price(days - 1, current_price)

def calculate_probability(num_simulations, days):
    num_successful_simulations = 0
    for _ in range(num_simulations):
        if simulate_stock_price(days, 100):
            num_successful_simulations += 1

    return num_successful_simulations / num_simulations

num_simulations = 100000
days = 10

probability = calculate_probability(num_simulations, days)
print(f"Estimated probability after {days} days: {probability:.4f}")