Question

Simulate a code through matlab the following problem. A random walk with P(X_n = i+1 |...

Simulate a code through matlab the following problem. A random walk with P(X_n = i+1 | X_{n-1} = i) = .4, and P(X_n = i-1 | X_{n-1} = i) = .6. Find the mean and variance of the number of transitions needed to get from state 5 to state 0. Find the probability you reach 10 before you reach 0 starting from 5. Check this with the formula from the gambler's ruin problem.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: iVen: Matlab code: P1-6; P2 4 nSteps 100: mc = 10000; for count-1:mc a=0 ; for i 1:nsteps r- rand (1, 1) if r <-pl a

Add a comment
Know the answer?
Add Answer to:
Simulate a code through matlab the following problem. A random walk with P(X_n = i+1 |...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Suppose in the gambler's ruin problem that the probability of winning a bet de- pends on the gambler's present fortune. Specifically, suppose that ai is the prob- ability that the gambler win...

    Suppose in the gambler's ruin problem that the probability of winning a bet de- pends on the gambler's present fortune. Specifically, suppose that ai is the prob- ability that the gambler wins a bet when his or her fortune is i. Given that the gambler's initial fortune is i, let P(i) denote the probability that the gambler's fortune reaches N before 0. (a) Derive a formula that relates Pi) to Pi -1 and Pi 1) (b) Using the same approach...

  • Use Matlab. I want a html. 3. (5) For a random walk on the set = {0,1, 2,... , a}, with probability that p 0.51 of ta...

    Use Matlab. I want a html. 3. (5) For a random walk on the set = {0,1, 2,... , a}, with probability that p 0.51 of taking a step to the right, let ha denote the probability that the walk will reach a before reaching 0. (a) Calculate ha by Markov chain methods. (b) Use simulation to estimate h 3. (5) For a random walk on the set = {0,1, 2,... , a}, with probability that p 0.51 of taking...

  • 1.5, Consider a gambler's ruin chain with N 4. That is, if 1 i 3, p(i,i...

    1.5, Consider a gambler's ruin chain with N 4. That is, if 1 i 3, p(i,i + - 0.4, and p(i,i -1) 0.6, but the endpoints are absorbing states: p(0, 0)1 and p(4 , 4-1 Compute p3 (1, 4) and p3 (1,0)

  • Matlab While loop help I'm doing a random walk problem and i need to make it...

    Matlab While loop help I'm doing a random walk problem and i need to make it so that when the walker goes over a certain position it gets reflected back onto the center (position=0). For this I'm trying to use while loops but they seem to get stuck. The program works fine until it reaches one of its limits (-10 or 10) then the while loops are supposed to prevent the position from going further and instead send the position...

  • 2. Problem 2.5. Consider a random walk on 10..... which movies left and right with respective...

    2. Problem 2.5. Consider a random walk on 10..... which movies left and right with respective probabilities a and p. If the walk is at 0 it transitions to 1 on the next step. If the walk is at k it transitions to k-1 on the next step. This is called random walk with reflecting boundaries. Assume that k 3, =1/4, p = 3/4, and the initial distribution is uniform. For the following, use technology if needed. (a) (10.1.X2 }...

  • Problem 1: Random Walk A random walk is a stochastic process. A stochastic process is a series of...

    python / visual studio Problem 1: Random Walk A random walk is a stochastic process. A stochastic process is a series of values that are not determined functionally, but probabilistically. The random walk is supposed to describe an inebriated person who, starting from the bar, intends to walk home, but because of intoxication instead randomly takes single steps either forward or backward, left or right. The person has no memory of any steps taken, so theoretically, the person shouldn't move...

  • python / visual studio Problem 1: Random Walk A random walk is a stochastic process. A...

    python / visual studio Problem 1: Random Walk A random walk is a stochastic process. A stochastic process is a series of values that are not determined functionally, but probabilistically. The random walk is supposed to describe an inebriated person who, starting from the bar, intends to walk home, but because of intoxication instead randomly takes single steps either forward or backward, left or right. The person has no memory of any steps taken, so theoretically, the person shouldn't move...

  • Exercise 7.1 (Gamblers ruin). Let (Xt) 120 be the Gambler's chain on state space Ω =...

    Exercise 7.1 (Gamblers ruin). Let (Xt) 120 be the Gambler's chain on state space Ω = {0, 1,2, , N} (i) Show that any distribution r-[a,0,0, ,0, bl on 2 is stationary with respect to the gambler?s (ii) Clearly the gambler's chain eventually visits state 0 or N, and stays at that boundary state introduced in Example 1.1. chain. Also show that any stationary distribution of this chain should be of this form. thereafter. This is called absorbtion. Let Ti...

  • MATLAB WORK PLEASE Interest is accrued according to the following formula: A=P i(1 + i)" (1...

    MATLAB WORK PLEASE Interest is accrued according to the following formula: A=P i(1 + i)" (1 + i)" – 1 where A is the annual payment, P is the present worth, i is the interest rate (not in percent), and n is the number of years. You decide to buy a $35,000 vehicle (P), but because you don't currently have the money to finance the entirety of the vehicle, you agree to pay $8,500 per year (A) for 7 years...

  • Code in Python Problem 1 (2 Points) 1. Write a function randomWalk(.. .) which simulates one path (or trajectory) of a s...

    Code in Python Problem 1 (2 Points) 1. Write a function randomWalk(.. .) which simulates one path (or trajectory) of a simple symmetric random walk with 2N time steps (i.e. from 0,1,2,...,2N) starting at So-0 nput: lengthofRandomWalk2N Output: samplePath: Array of length 2N+1 with the entire path of the random walk on 0,1,2,..,2N In def randomwalk(lengthofRandomwalk): ## WRITE YOUR OWN CODE HERE # HINT: USE np. random . choice ( ) TO SIMULATE THE INCREMENTS return samplePath In [ ]:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT