返回题库

迷路探险家

The Lost Explorer’s Dilemma

专题
Probability / 概率
难度
L6

题目详情

探险家在一条直线上,两个出口分别位于位置 00(陷阱)和 NN(自由)。

探险家从位置 kk 出发(0<k<N0<k<N)。每一步:

  • 以概率 pp 向北(+1),
  • 以概率 1p1-p 向南(-1)。

到达 NN 则逃脱,到达 00 则落入陷阱。

问:从 kk 出发逃脱的概率 PkP_k 是多少?

An explorer is trapped in a mysterious labyrinth with two exits. One exit, located NN steps to the north, leads to freedom. The other exit, NN steps to the south, leads to a pit. The explorer starts kk steps north of a reference point (i.e., between the two exits).

At each decision point, the explorer moves:

  • North with probability pp
  • South with probability 1p1 - p

If the explorer reaches the freedom point at position NN, they escape. If they reach the pit at position 00, they fall in.

What is the probability PkP_k that the explorer escapes, given that they start kk steps north of the reference point?

解析

满足递推

Pk=pPk+1+(1p)Pk1,P0=0, PN=1.P_k=pP_{k+1}+(1-p)P_{k-1},\quad P_0=0,\ P_N=1.

解得:

  • p=12p=\frac12,则 Pk=kNP_k=\frac{k}{N}
  • p12p\ne\frac12,则
Pk=1(1pp)k1(1pp)N.P_k=\frac{1-\left(\frac{1-p}{p}\right)^k}{1-\left(\frac{1-p}{p}\right)^N}.

Original Explanation

Let PkP_k be the probability that the explorer reaches freedom starting from position kk.

The recurrence relation is:

Pk=pPk+1+(1p)Pk1P_k = p \cdot P_{k+1} + (1 - p) \cdot P_{k-1}

Boundary conditions:

  • P0=0P_0 = 0 (falls into the pit)
  • PN=1P_N = 1 (reaches freedom)

🔁 Solution to the recurrence

When p12p \ne \frac{1}{2}, the solution is:

Pk=1(1pp)k1(1pp)NP_k = \frac{1 - \left( \frac{1 - p}{p} \right)^k}{1 - \left( \frac{1 - p}{p} \right)^N}

When p=12p = \frac{1}{2} (i.e., a fair chance), it simplifies to:

Pk=kNP_k = \frac{k}{N}

Final Answer:

  • If p=12p = \frac{1}{2}, then Pk=kNP_k = \frac{k}{N}
  • If p12p \ne \frac{1}{2}, then:
Pk=1(1pp)k1(1pp)NP_k = \frac{1 - \left( \frac{1 - p}{p} \right)^k}{1 - \left( \frac{1 - p}{p} \right)^N}

So, PkP_k is the probability that the explorer escapes, starting kk steps north of the reference point.