Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@dewittpe's solution and write up for @standupmaths's frog_problem #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dewittpe
Copy link

No description provided.

@illustromancer
Copy link

Something in your final calculation isn't correct, as a direct calculation of the probability of being in the final state using each of the P^n intermediate transition matrices yields a final answer of 2.92896825. The same is true if (I-Q)^-1 is calculated directly in google sheets/excel for n=10.

See this google sheet for two separate methods of calculating the expected number of steps, one from first principles, and the second using the same method in your solution.

https://docs.google.com/spreadsheets/d/1HzawT8I5YjbughzTNrJ_v3MBvNMAylTHwS2-dtKFSQI/edit?usp=sharing

@illustromancer
Copy link

Having looked into it a bit more, you are adding 1/11 to your answer for the n=10 case, which you shouldn't be as no jump has a 1/11 probability.

@dewittpe
Copy link
Author

Having looked into it a bit more, you are adding 1/11 to your answer for the n=10 case, which you shouldn't be as no jump has a 1/11 probability.

@illustromancer, thank you for looking over the solution I posted. It is always good to have some review. I'm wondering if our interpretation of the problem is slightly different. for the n = 10 case I look at that as there are 10 pads between the frog and the opposite bank. The bank would be the p + 1 pad. With equal probability of jumping to any pad or the bank each transition probability would be 1/11 as there are eleven possible next states.

The full transition probability matrix T should have dimension (p +2) x (p + 2), for the p pads the and the two banks. The matrix Q would then have dimension (p + 1) x (p + 1) for the transitions from the starting bank of the pond to each of the pads; omitting the transition to the final bank. In the google sheet you shared it appears that there are only 10 columns in the Q matrix, which, for the way I interpreted the problem, would be the case of n = 9 pads between the two banks.

@illustromancer
Copy link

No worries at all.

Thats the difference then. The problem as stated in the video is that the river is of width 10 (9 lilypads and the opposite bank, or 10 possible landing places), which is stated in the video description, whereas your writeup has 11 possible landing places for n=10 (10 lilypads between the two banks).

It would be worth clarifying that in your writeup.

@dewittpe
Copy link
Author

Would you mind looking at the first page of the .pdf file where I defined the problem? Is there any detain there which you like to see added? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants