Solution (source code)

= Solution

Let $a_1<a_2<\cdots$ be the distinct observed event times, $r_j$ the <risk set> size immediately before $a_j$, and $d_j$ the events there. Under <independent censoring>, the <Kaplan–Meier estimator> is
$$
\boxed{\widehat F(t)=\prod_{a_j\leq t}\left(1-\frac{d_j}{r_j}\right).}
$$
It starts at one, jumps down at events, and is unchanged by a pure censoring time; <right censoring> removes people from subsequent <risk sets>. If events and censorings coincide, the convention here processes events before censoring, so those censored at the recorded time are included just before the event. The estimated <median> is the first time the curve reaches or falls below $1/2$. If it never does during observation, the median is not estimable from the observed curve without tail assumptions.

With one remaining individual censored at $t_1$, no event factor is introduced. Hence
$$
\boxed{\phi_1=\phi_0.}
$$
This is the terminal observed step value. With an empty <risk set> after $t_1$, continued horizontal plotting is a convention and supplies no information about the true later <survivor function>. The tail rests on one person and is imprecise; this is <terminal censoring and survival-mean identifiability>. If $\phi_0>0$, the unrestricted mean cannot be obtained nonparametrically from this censored tail: extending the last positive step to infinity would give an infinite area, which does not establish an infinite population mean. A <restricted mean survival time> up to a suitably supported finite cutoff remains estimable.