A walker decides to move up or down using unfair coin. The coin tells the walker
ID: 3298844 • Letter: A
Question
A walker decides to move up or down using unfair coin. The coin tells the walker to move up 1 step with probability 0.6 and down 1 step with probability 0.4. The walker tosses the coin prior each step. The walk stops when the walker reaches 5 step line or -2 step line.
Answer the following questions:
Question1(C) What is the probability that the walker will stop after the step 1?
Question2(C) What is the probability that the walker will stop after the step 2?
Question3(C) What is the probability that the walker will stop after the step 3?
Question4(C) What is the probability that the walker will stop after the step 4?
Question5(C) What is the probability that the walker will stop after the step 5?
Question6(B) What is the probability that the walker will stop after the step 6?
Question7(B) What is the probability that the walker will stop after the step 7?
Question8(B) What is the probability that the walker will stop after the step 8?
Question9(B) What is the probability that the walker will stop after the step 9?
Question10(B) What is the probability that the walker will stop after the step 10?
Question11(A) What is the probability that the walker will stop after the step 11?
Question 12(A) Using information from the previous 11 questions determine which stopping step is the most probable and what is the expected number of steps needed to stop?
Explanation / Answer
The transition probability matrix of this drunkard's walk is given below:
We will have to assume that the drunkard starts at state 0. Now, to obtain the answer for Questions 1-12, we need to obtain the m-step TPM. Towards this, we will calculate the m-step TPMs using the msteptpm function from the ACSWR package of R software.
Question1(C) What is the probability that the walker will stop after the step 1?
The probability that the walker will stop after step 1 is 0 as seen from the TPM above.
> library(ACSWR)
> tt <- read.csv("clipboard",header=T,sep=" ")
Warning message:
In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on 'clipboard'
> tt <- read.csv("clipboard",header=T,sep=" ")
> names(tt) = -2:5
> rownames(tt) = -2:5
> tt <- as.matrix(tt)
> tt
-2 -1 0 1 2 3 4 5
-2 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
-1 0.4 0.0 0.6 0.0 0.0 0.0 0.0 0.0
0 0.0 0.4 0.0 0.6 0.0 0.0 0.0 0.0
1 0.0 0.0 0.4 0.0 0.6 0.0 0.0 0.0
2 0.0 0.0 0.0 0.4 0.0 0.6 0.0 0.0
3 0.0 0.0 0.0 0.0 0.4 0.0 0.6 0.0
4 0.0 0.0 0.0 0.0 0.0 0.4 0.0 0.6
5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0
Question2(C) What is the probability that the walker will stop after the step 2?
The 2-step TPM is calculated as
> msteptpm(tt,2)
-2 -1 0 1 2 3 4 5
-2 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
-1 0.40 0.24 0.00 0.36 0.00 0.00 0.00 0.00
0 0.16 0.00 0.48 0.00 0.36 0.00 0.00 0.00
1 0.00 0.16 0.00 0.48 0.00 0.36 0.00 0.00
2 0.00 0.00 0.16 0.00 0.48 0.00 0.36 0.00
3 0.00 0.00 0.00 0.16 0.00 0.48 0.00 0.36
4 0.00 0.00 0.00 0.00 0.16 0.00 0.24 0.60
5 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1.00
Hence, the probability of stopping is 0.16, and it is at state -2.
Question3(C) What is the probability that the walker will stop after the step 3?
The 3-step TPM is given by
> msteptpm(tt,3)
-2 -1 0 1 2 3 4 5
-2 1.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
-1 0.496 0.000 0.288 0.000 0.216 0.000 0.000 0.000
0 0.160 0.192 0.000 0.432 0.000 0.216 0.000 0.000
1 0.064 0.000 0.288 0.000 0.432 0.000 0.216 0.000
2 0.000 0.064 0.000 0.288 0.000 0.432 0.000 0.216
3 0.000 0.000 0.064 0.000 0.288 0.000 0.288 0.360
4 0.000 0.000 0.000 0.064 0.000 0.192 0.000 0.744
5 0.000 0.000 0.000 0.000 0.000 0.000 0.000 1.000
which shows that the probability of stopping is again 0.16.
Question4(C) What is the probability that the walker will stop after the step 4?
The 4-step TPM is
> msteptpm(tt,4)
-2 -1 0 1 2 3 4 5
-2 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
-1 0.4960 0.1152 0.0000 0.2592 0.0000 0.1296 0.0000 0.0000
0 0.2368 0.0000 0.2880 0.0000 0.3456 0.0000 0.1296 0.0000
1 0.0640 0.1152 0.0000 0.3456 0.0000 0.3456 0.0000 0.1296
2 0.0256 0.0000 0.1536 0.0000 0.3456 0.0000 0.2592 0.2160
3 0.0000 0.0256 0.0000 0.1536 0.0000 0.2880 0.0000 0.5328
4 0.0000 0.0000 0.0256 0.0000 0.1152 0.0000 0.1152 0.7440
5 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.0000
which means that the probability of stopping in State -2 is 0.2368.
Question5(C) What is the probability that the walker will stop after the step 5?
The 5-step TPM is
> msteptpm(tt,5)
-2 -1 0 1 2 3 4 5
-2 1.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
-1 0.54208 0.00000 0.17280 0.00000 0.20736 0.00000 0.07776 0.00000
0 0.23680 0.11520 0.00000 0.31104 0.00000 0.25920 0.00000 0.07776
1 0.11008 0.00000 0.20736 0.00000 0.34560 0.00000 0.20736 0.12960
2 0.02560 0.06144 0.00000 0.23040 0.00000 0.31104 0.00000 0.37152
3 0.01024 0.00000 0.07680 0.00000 0.20736 0.00000 0.17280 0.53280
4 0.00000 0.01024 0.00000 0.06144 0.00000 0.11520 0.00000 0.81312
5 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000
which means that the probability stopping in state -2 is 0.2368 and in state 5 is 0.07776.
Question6(B) What is the probability that the walker will stop after the step 6?
The 6-step TPM is
> msteptpm(tt,6)
-2 -1 0 1 2 3 4 5
-2 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
-1 0.542080 0.069120 0.000000 0.186624 0.000000 0.155520 0.000000 0.046656
0 0.282880 0.000000 0.193536 0.000000 0.290304 0.000000 0.155520 0.077760
1 0.110080 0.082944 0.000000 0.262656 0.000000 0.290304 0.000000 0.254016
2 0.050176 0.000000 0.129024 0.000000 0.262656 0.000000 0.186624 0.371520
3 0.010240 0.030720 0.000000 0.129024 0.000000 0.193536 0.000000 0.636480
4 0.004096 0.000000 0.030720 0.000000 0.082944 0.000000 0.069120 0.813120
5 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000
which shows that the probability stopping in state -2 is 0.282880 and in state 5 is
0.077760.
Question7(B) What is the probability that the walker will stop after the step 7?
The 7-step TPM is
> round(msteptpm(tt,7),4)
-2 -1 0 1 2 3 4 5
-2 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
-1 0.5697 0.0000 0.1161 0.0000 0.1742 0.0000 0.0933 0.0467
0 0.2829 0.0774 0.0000 0.2322 0.0000 0.2364 0.0000 0.1711
1 0.1433 0.0000 0.1548 0.0000 0.2737 0.0000 0.1742 0.2540
2 0.0502 0.0516 0.0000 0.1825 0.0000 0.2322 0.0000 0.4835
3 0.0225 0.0000 0.0700 0.0000 0.1548 0.0000 0.1161 0.6365
4 0.0041 0.0123 0.0000 0.0516 0.0000 0.0774 0.0000 0.8546
5 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.0000
which implies that the probability of stopping in State -2 is 0.2829 and in State 5 is 0.1711.
Question8(B) What is the probability that the walker will stop after the step 8?
The 8-step TPM is
> round(msteptpm(tt,8),4)
-2 -1 0 1 2 3 4 5
-2 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
-1 0.5697 0.0464 0.0000 0.1393 0.0000 0.1418 0.0000 0.1026
0 0.3138 0.0000 0.1393 0.0000 0.2339 0.0000 0.1418 0.1711
1 0.1433 0.0619 0.0000 0.2024 0.0000 0.2339 0.0000 0.3585
2 0.0708 0.0000 0.1040 0.0000 0.2024 0.0000 0.1393 0.4835
3 0.0225 0.0280 0.0000 0.1040 0.0000 0.1393 0.0000 0.7062
4 0.0090 0.0000 0.0280 0.0000 0.0619 0.0000 0.0464 0.8546
5 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.0000
which gives the probability of stopping in State -2 as 0.3138 and in State 5 as 0.1711.
Question9(B) What is the probability that the walker will stop after the step 9?
The 9-step TPM is
> round(msteptpm(tt,9),4)
-2 -1 0 1 2 3 4 5
-2 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
-1 0.5883 0.0000 0.0836 0.0000 0.1403 0.0000 0.0851 0.1026
0 0.3138 0.0557 0.0000 0.1772 0.0000 0.1971 0.0000 0.2562
1 0.1680 0.0000 0.1181 0.0000 0.2150 0.0000 0.1403 0.3585
2 0.0708 0.0416 0.0000 0.1433 0.0000 0.1772 0.0000 0.5671
3 0.0337 0.0000 0.0584 0.0000 0.1181 0.0000 0.0836 0.7062
4 0.0090 0.0112 0.0000 0.0416 0.0000 0.0557 0.0000 0.8825
5 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.0000
gives the probability stopping in State -2 at 0.3138 and in state 5 at 0.2562.
Question10(B) What is the probability that the walker will stop after the step 10?
The 10-step TPM is
> round(msteptpm(tt,10),4)
-2 -1 0 1 2 3 4 5
-2 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
-1 0.5883 0.0334 0.0000 0.1063 0.0000 0.1182 0.0000 0.1537
0 0.3361 0.0000 0.1043 0.0000 0.1851 0.0000 0.1182 0.2562
1 0.1680 0.0472 0.0000 0.1569 0.0000 0.1851 0.0000 0.4427
2 0.0875 0.0000 0.0823 0.0000 0.1569 0.0000 0.1063 0.5671
3 0.0337 0.0234 0.0000 0.0823 0.0000 0.1043 0.0000 0.7563
4 0.0135 0.0000 0.0234 0.0000 0.0472 0.0000 0.0334 0.8825
5 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.0000
and that means the probability of stopping in State -2 is 0.3361 and in State 5 is 0.2562.
Question11(A) What is the probability that the walker will stop after the step 11?
After step 11, the TPM is
> round(msteptpm(tt,11),4)
-2 -1 0 1 2 3 4 5
-2 1.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
-1 0.6017 0.0000 0.0626 0.0000 0.1111 0.0000 0.0709 0.1537
0 0.3361 0.0417 0.0000 0.1366 0.0000 0.1584 0.0000 0.3271
1 0.1869 0.0000 0.0911 0.0000 0.1682 0.0000 0.1111 0.4427
2 0.0875 0.0329 0.0000 0.1121 0.0000 0.1366 0.0000 0.6309
3 0.0431 0.0000 0.0469 0.0000 0.0911 0.0000 0.0626 0.7563
4 0.0135 0.0093 0.0000 0.0329 0.0000 0.0417 0.0000 0.9025
5 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 1.0000
giving the probability of stopping in state -2 at 0.3361 and state 5 at 0.3271.
Question 12(A) Using information from the previous 11 questions determine which stopping step is the most probable and what is the expected number of steps needed to stop?
The stopping state -2 is most probable than the state 5.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.