North: +y (increase t)
But here, A_s is north-south, so moving along A_s is changing t:
From (s, t) to (s, t+1) is north on A_s
From (s, t) to (s, t-1) is south on A_s
Similarly for B_t:
From (s, t) to (s+1, t) is east on B_t
From (s, t) to (s-1, t) is west on B_t
But initial direction is "north", which is along A_{-1} from (-1, 0) to (-1, 1).
So at (-1, 0), direction is north (t increases).
At next step, at (-1, 1), possible directions are:
East: (s increases) to (0, 1)
South: (t decreases) to (-1, 0)
West: (s decreases) to (-2, 1)
North: (t increases) to (-1, 2)
But cannot go back to (-1, 0) because cannot turn around (cannot go south if just came from north? Wait, the rule is "不能调头", which means cannot reverse direction immediately. So if current direction is north, cannot go south next.
So at (-1, 1), coming from (-1, 0) with direction north, cannot go south. So possible directions are east, west, north.
Similarly, at any point, if current direction is d, cannot choose direction opposite to d next.
3. 甲方案的运动规则
At each intersection, given current direction d, possible directions to turn to are those not opposite to d.
If two options, turn probability p each (so straight is 1 - 2p).
If one option, turn probability p (so straight is 1 - p).
Initial direction is north.
Let's model the movement:
From (-1, 0), direction north, move to (-1, 1).
At (-1, 1), came from north, so cannot go south. Possible directions: east, west, north.
Number of non-opposite directions: 3 (E, W, N). But "可以转弯的方向" are E, W, N (all except opposite S). So turn probability p for each, straight is 1 - 2p? Wait, no: "有 p 的概率向可以转弯的方向转弯", which seems to imply that among possible directions (not opposite), choose one with p, but if multiple, how?
Wait, original Chinese: "有 p 的概率向可以转弯的方向转弯,若可以向两个方向转弯,则直行的概率为 1-2p,否则为 1-p".
So:
If two possible directions (not opposite), then:
turn left or right: each p
straight: 1 - 2p
If one possible direction (not opposite), then:
must turn that way: p
but cannot go opposite, so straight is 1 - p? Wait no, if only one direction, then must take it? Or is "可以转弯的方向" meaning "possible directions to turn", which is all non-opposite, and if only one, then must take it (probability 1), but the wording is unclear.
Wait, perhaps it's better to think that at each step, you can choose to continue straight (if not opposite), or turn left/right.
But the wording is: "有 p 的概率向可以转弯的方向转弯", meaning with probability p, choose a direction to turn (among possible), and "若可以向两个方向转弯,则直行的概率为 1-2p", meaning if two possible directions, then straight is 1 - 2p (so turn left or right each p), otherwise (one possible direction), straight is 1 - p (but then how is turn probability p? Maybe then must turn, so p = 1? Unclear.)
Alternative interpretation: at each step, with probability p, choose to turn (among possible directions), and if two possible, choose one uniformly (each p/2), else if one possible, choose it (p=1). Then straight is 1 - p if two options (then straight is 1 - 2p? No, seems conflicting.
Perhaps better to assume that "可以转弯的方向" are all non-opposite directions, and with probability p, choose one of them (uniformly if multiple), else (if only one), choose it with probability 1. Then "直行" is choosing the original direction, which is allowed only if not opposite (i.e., if original direction is not in the opposite sense).
But initial direction is north, at (-1,1), cannot go south, so can go east, west, north. So three options: east, west, north. Then "可以转弯的方向" are east, west, north (all except south). Then with probability p, choose one of them (uniformly, so each p/3), and straight is north with 1 - p? But then "若可以向两个方向转弯,则直行的概率为 1-2p" suggests that if two options, straight is 1 - 2p. Here three options, so not sure.
This is confusing. Maybe the rule is:
At each step, possible directions are all non-opposite to current direction. Then:
If two possible directions:
turn left or right: each p
straight: 1 - 2p
If one possible direction:
must take it: p = 1
but then straight is 0? Not sure.
Alternatively, perhaps "可以转弯的方向" are the two perpendicular directions (left and right), and "直行" is the same direction. Then:
At (-1,1), came from north, so cannot go south. Possible directions: east, west, north. Then "可以转弯的方向" are east and west (left and right), and "直行" is north. Then:
with probability p, choose a turn direction (east or west, each p/2)
with probability 1 - p, choose straight (north)
But the wording is "有 p 的概率向可以转弯的方向转弯", which seems to imply that "可以转弯的方向" are all non-opposite, and with probability p, choose one of them, and if two, then straight is 1 - 2p (so turn left or right each p/2), else if one, then turn that way (p=1).
But then at (-1,1), three options: east, west, north. Then "可以转弯的方向" are east, west, north (since none are opposite), but opposite is south, so all three are allowed. Then with p, choose one of them (each p/3), and straight is 1 - p? But then "若可以向两个方向转弯,则直行的概率为 1-2p" is not applicable here.
This is getting messy. Maybe the correct interpretation is:
At each step, "可以转弯的方向" are the two perpendicular directions (left and right), and "直行" is the same direction. Then:
If current direction allows turning left and right (i.e., not at a "dead end"), then:
with probability p, choose left or right (each p/2)
with probability 1 - p, choose straight
If only one possible direction (e.g., at a T-junction where one direction is opposite), then:
must choose that direction (p=1)
But in our case, at (-1,1), came from north, so cannot go south. Possible directions: east, west, north. Then "可以转弯的方向" are east and west (left and right), and "直行" is north. Then:
with probability p, choose east or west (each p/2)
with probability 1 - p, choose north
This seems plausible.
Similarly, at (0,1), came from (-1,1) with some direction. Suppose came from east (from (-1,1) to (0,1)), then cannot go west. Possible directions: east, north, south. But cannot go west (opposite to east), and cannot go south (cannot turn around? Or is "不能调头" only immediate reverse? Maybe "不能调头" means cannot go back to previous direction, so if came from east, cannot go west, but can go south? Unclear.
Given confusion, perhaps the correct interpretation is that "不能调头" means cannot choose the opposite direction to the incoming direction, and "可以转弯的方向" are the other two (left and right), and "直行" is the same direction.
Then at (-1,1), came from north, so cannot go south. "可以转弯的方向" are east and west, "直行" is north. Then:
with p, choose east or west (each p/2)
with 1 - p, choose north
Similarly at other points.
4. 乙方案的运动规则
Given in乙方案:
p_东 = p_西 = p
p_北 = 1 - 2p
p_南 = 0
So at any intersection, directions are chosen with these probabilities, regardless of incoming direction. But the problem says "乙方案中 p_i 的概率向 i 方向继续行驶", which may imply that p_i depends on incoming direction, but given as constants, so perhaps it's fixed probabilities at each intersection, independent of history.
But the condition is that小明不会向南走, so p_南 = 0 is consistent.
在 (0,0), came from north, so cannot go south. Possible directions: east, west, north.
甲方案:
with p, choose east or west (each p/2)
with 1 - p, choose north
To reach (n,0), need to go east n times, west 0 times, and north appropriately.
This is like a random walk where at each step, can go east with p/2, west with p/2, or north with 1 - p.
But to reach (n,0), the net east steps must be n, and west steps must be 0. So must go east every time until reach n east steps, but can also go north.
This seems complicated. Maybe better to model the position as (x, y), starting at (-1, 0), first move to (0,0), then from there.
From (0,0), moves:
east: (1,0)
west: (-1,0)
north: (0,1)
To reach (n,0), need to have net +n east and 0 west from (0,0). So must have (n + k) east and k west steps, and some north steps.
The time is proportional to the number of steps, since each step is 1 km and speed is 60 km/h.
The expected time E_甲 can be modeled as a Markov chain.
But this seems complex. Maybe there's symmetry and the expected time can be computed recursively.
Alternatively, since the goal is to reach (n,0), and from (0,0), the expected time to reach (n,0) can be computed by considering the drift.
But given the complexity, perhaps the answer is that for p < 1/4, 甲 is better, but need more precise calculation.
7. 乙方案的期望时间
在乙方案中,从 (0,0), directions are:
east: p
west: p
north: 1 - 2p
south: 0
To reach (n,0), need to have net +n east and 0 west. Similar to甲方案,但概率不同。