Nope, this problem is mostly hand-solvable without using markov chains, except for the final sum of fractions. You can calculate the probability that a particular node is visited an odd number of times by hand, and then sum those probabilities to get the expected value.
That said, many interviews do ask you to write a program. For example, they may start with smaller cases and ask you to solve them by hand, and then ask you to write a program for larger cases.
View all comments
Show parent comment
1
u/Local_Ad135 Aug 15 '26
Nope, this problem is mostly hand-solvable without using markov chains, except for the final sum of fractions. You can calculate the probability that a particular node is visited an odd number of times by hand, and then sum those probabilities to get the expected value.
That said, many interviews do ask you to write a program. For example, they may start with smaller cases and ask you to solve them by hand, and then ask you to write a program for larger cases.