If you want to minimize the mean travel time, the answer is either to always take the bus or always walk (unless you see the bus at the stop immediately, in which case you should take it—this violates the assumption that the bus’s arrival time is unknown.) With the numbers you’ve given, walking is better.
If you want to minimize the chance that you’ll have regret, where regret is defined as “if I had chosen the other method, I would have gotten there first”, the solution is the same as in the average case.
(Both of these cases are complicated by the fact that since you see the bus at the stop some percentage of the time, the bus arrival times are not actually evenly distributed from 0 to 30 minutes, but that just makes choosing the bus worse and it’s already worse.)
To the question “should I wait X length of time for the bus and start walking if the bus hasn’t arrived in that time”, generally, you should never do that; if walking after X minutes is better than continuing to wait after X minutes, then walking after X’ minutes (where X’ < X) is better than continuing to wait after X’ minutes (since the bus will arrive sooner if there has been no bus for X minutes, than if there has been no bus for X’ minutes), so you should walk immediately.
It is of course possible to come up with more detailed requirements that could demand you wait X length of time and then start walking. For instance, “I never want to take more than 20 minutes, but as long as it is less than 20 minutes, I want it to be as short as possible”, it takes 15 minutes to walk, and the bus takes 0-20 minutes to arrive—you should wait for the bus for 5 minutes, and then start walking.
If you want to minimize the mean travel time, the answer is either to always take the bus or always walk (unless you see the bus at the stop immediately, in which case you should take it—this violates the assumption that the bus’s arrival time is unknown.) With the numbers you’ve given, walking is better.
If you want to minimize the chance that you’ll have regret, where regret is defined as “if I had chosen the other method, I would have gotten there first”, the solution is the same as in the average case.
(Both of these cases are complicated by the fact that since you see the bus at the stop some percentage of the time, the bus arrival times are not actually evenly distributed from 0 to 30 minutes, but that just makes choosing the bus worse and it’s already worse.)
To the question “should I wait X length of time for the bus and start walking if the bus hasn’t arrived in that time”, generally, you should never do that; if walking after X minutes is better than continuing to wait after X minutes, then walking after X’ minutes (where X’ < X) is better than continuing to wait after X’ minutes (since the bus will arrive sooner if there has been no bus for X minutes, than if there has been no bus for X’ minutes), so you should walk immediately.
It is of course possible to come up with more detailed requirements that could demand you wait X length of time and then start walking. For instance, “I never want to take more than 20 minutes, but as long as it is less than 20 minutes, I want it to be as short as possible”, it takes 15 minutes to walk, and the bus takes 0-20 minutes to arrive—you should wait for the bus for 5 minutes, and then start walking.