Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Yon have already seen a model for random walks in class. Here we give you another demonstration of random walks, different from your lecture notes.

image text in transcribedimage text in transcribed

Yon have already seen a model for random walks in class. Here we give you another demonstration of random walks, different from your lecture notes. Imagine you are playing a game with a friend. You are playing a very simple game where you each start with two coins. On each turn, a dice is rolled. If it comes up even your friend gives you one coin. If the dice comes up odd you must give your friend a coin. Once one player has collected all the coins, that player is the winner of the game. This is probably a very boring game (and we certainly do not wish to encourage gambling), but it will hopefully help illustrate what is meant by a "random walk". We say that the game has five possible ''states". You have zero coins, or one coin, or two coins, or three or four. No matter how many coins you have, your friend has all the remaining coins. At the start of the game (turn zero) you will have two coins with 100% probability. After one turn, you could have either one coin, or three coins, 50% probability each. After two turns, you could have zero coins, or four coins, or two coins., with probabilities 25%, 25% and 50% (can you figure out why?). After three turns... okay who really wants to calculate that. Seriously, there really ought to be a better way to calculate this - some kind of method that would work if we changed the rules of the game- or even if we weren't talking about any sort of game at all. So, what do we have? What are the ultra basics that are being described here? There are a bunch of different "states" we could be in. Each turn, we change which state we are in. The state we are in next turn depends on chance, and on what state we are in this turn. If we are in the state "one coin" we have a 0.5 probability of changing to the state "two coins" in the next turn. We have zero chance of changing to the state "four coins" in the next turn, because it is too far away. For every pair of states, we have some chance of starting in state A and moving to state B. Often this chance will be zero, but that's okay. So we have a pile of numbers now. More specifically, we have a GRID of numbers, which we could write as a matrix: P = (p_1, 1, p_1, 2 p_1, m p_2, 1 p_2, 2 p_2, m p_m, 1 p_2, m p_m, m) (a) Suppose you are playing the coin game described previously, except this time you and your friend start the game with a TOTAL of twenty coins spread between you (So. your system has more states). Write the MATLAB code to construct this matrix using a for loop. (b) If you and your friend both start with ten coins, what is the probability for you to have exactly 4 coins on turn twelve? (There is a slight technical difficulty here. You may ask. what if someone has won before the twelfth turn? To get over that conceptual problem, we can assume that once somebody wins or loses, the state remains unchanged and you can view the turns to "continue". That's what the 1's in the transition matrix mean.) (c) What is the probability of someone winning the twenty coin game after eighteen turns?. (d) Suppose you start the game with 8 coins, and your friend has twelve. What is your probability of winning the game eventually (after so many turns that the game is almost surely over)? Describe the procedure how you can get this result using MATLAB. (Explain in words. You can use MATLAB codes as illustration.) (e) Suppose that you get a coin whenever the dice comes up even. What happens if you are playing with a loaded dice? For example one that comes up even 53% of the time? Write the MATLAB code to construct the transition matrix for your probability distribution. (f) Given that there are a total of twenty coins, and you are playing with the loaded dice above, how many coins should you start with in order to make the game as fair as possible? Being fair means each of you two eventually has approximately the same probability of winning (close to 50%). Yon have already seen a model for random walks in class. Here we give you another demonstration of random walks, different from your lecture notes. Imagine you are playing a game with a friend. You are playing a very simple game where you each start with two coins. On each turn, a dice is rolled. If it comes up even your friend gives you one coin. If the dice comes up odd you must give your friend a coin. Once one player has collected all the coins, that player is the winner of the game. This is probably a very boring game (and we certainly do not wish to encourage gambling), but it will hopefully help illustrate what is meant by a "random walk". We say that the game has five possible ''states". You have zero coins, or one coin, or two coins, or three or four. No matter how many coins you have, your friend has all the remaining coins. At the start of the game (turn zero) you will have two coins with 100% probability. After one turn, you could have either one coin, or three coins, 50% probability each. After two turns, you could have zero coins, or four coins, or two coins., with probabilities 25%, 25% and 50% (can you figure out why?). After three turns... okay who really wants to calculate that. Seriously, there really ought to be a better way to calculate this - some kind of method that would work if we changed the rules of the game- or even if we weren't talking about any sort of game at all. So, what do we have? What are the ultra basics that are being described here? There are a bunch of different "states" we could be in. Each turn, we change which state we are in. The state we are in next turn depends on chance, and on what state we are in this turn. If we are in the state "one coin" we have a 0.5 probability of changing to the state "two coins" in the next turn. We have zero chance of changing to the state "four coins" in the next turn, because it is too far away. For every pair of states, we have some chance of starting in state A and moving to state B. Often this chance will be zero, but that's okay. So we have a pile of numbers now. More specifically, we have a GRID of numbers, which we could write as a matrix: P = (p_1, 1, p_1, 2 p_1, m p_2, 1 p_2, 2 p_2, m p_m, 1 p_2, m p_m, m) (a) Suppose you are playing the coin game described previously, except this time you and your friend start the game with a TOTAL of twenty coins spread between you (So. your system has more states). Write the MATLAB code to construct this matrix using a for loop. (b) If you and your friend both start with ten coins, what is the probability for you to have exactly 4 coins on turn twelve? (There is a slight technical difficulty here. You may ask. what if someone has won before the twelfth turn? To get over that conceptual problem, we can assume that once somebody wins or loses, the state remains unchanged and you can view the turns to "continue". That's what the 1's in the transition matrix mean.) (c) What is the probability of someone winning the twenty coin game after eighteen turns?. (d) Suppose you start the game with 8 coins, and your friend has twelve. What is your probability of winning the game eventually (after so many turns that the game is almost surely over)? Describe the procedure how you can get this result using MATLAB. (Explain in words. You can use MATLAB codes as illustration.) (e) Suppose that you get a coin whenever the dice comes up even. What happens if you are playing with a loaded dice? For example one that comes up even 53% of the time? Write the MATLAB code to construct the transition matrix for your probability distribution. (f) Given that there are a total of twenty coins, and you are playing with the loaded dice above, how many coins should you start with in order to make the game as fair as possible? Being fair means each of you two eventually has approximately the same probability of winning (close to 50%)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential Data Protection For Estate Agencies In Singapore 2024

Authors: Yang Yen Thaw Yt

1st Edition

B0CQK79WD3, 979-8872095392

More Books

Students also viewed these Databases questions