Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[hoist_failure] Two new exercises in #656 need re-scoping

Aperta
#1,027 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Ambito
documentation

Direzione di ricerca

Leggi hoist_failure.md e la PR #656, quindi confronta i due testi degli esercizi e le soluzioni fornite con il contenuto della lezione. Decidi se ridefinire o eliminare Exercise 2 e concilia la conclusione p = 13 di Exercise 1 con il p = 15 della lezione; il lavoro è completato quando gli esercizi e la lezione non si contraddicono più e l'approssimazione viene valutata in modo significativo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

PR #656 adds two new exercises to hoist_failure.md. The lecture changes in that PR are good — it fixes several genuine errors in the mathematics — but both exercises have problems that should be resolved before or shortly after it merges.

Exercise 2 cannot be answered as posed

The exercise reads:

The rare event approximation assumes that $P(A_i) P(A_j)$ is negligible compared to $P(A_i) + P(A_j)$.

Using the computed distribution, calculate the expected value of the system failure rate and compare it to the sum of the expected values of the individual component failure rates.

How good is the rare event approximation in this case?

The comparison it asks for cannot speak to the quality of the approximation. The lecture builds the system failure rate as a sum of component rates — that construction is the rare event approximation, since the $P(A_i)P(A_j)$ cross terms have already been dropped. Comparing $E[\text{system}]$ with $\sum_i E[\text{component}_i]$ therefore just verifies linearity of expectation, which holds regardless.

The supplied solution concedes exactly this:

The expected value of the sum equals the sum of the expected values (by linearity of expectation), so these should match closely regardless of the rare event approximation.

Running it gives a relative difference of 0.03%, which is discretization error, not evidence about the approximation.

To actually assess the approximation you would need to compare against a system probability that retains the cross terms — e.g. contrasting $1 - \prod_i (1 - p_i)$ with $\sum_i p_i$ at the relevant magnitudes, which is where the approximation's accuracy genuinely lives.

Options: re-scope the exercise along those lines, or drop it.

Exercise 1 contradicts the lecture body

The solution concludes:

Beyond $p = 13$, the accuracy gains diminish while computational cost continues to grow

For this application, $p = 13$ provides a good balance between accuracy and efficiency

but the lecture itself sets $p = 15$. The computed output does support the claim — the median is 260.55 from $p = 13$ upward — so this is the exercise and the lecture disagreeing rather than an error in either.

Options: change the lecture to $p = 13$, or soften the exercise's conclusion to note that the lecture uses a larger grid for headroom.

Context

Both exercises are new in #656, so neither is a regression against main. They need an author decision, and @HumphreyYang has not been available. Flagging here so #656 is not blocked on it.

Everything else in that PR checks out: it corrects the lognormal definition ($y = \exp(x)$, not $\log(x)$), the convolution integrand ($f(\tau)$, not $f(z)$), the integration limits, the discrete convolution upper index, and the 0.95/0.05 quantile ratio ($e^{3.29\sigma}$, not $e^{1.645\sigma}$) — all of which are wrong on main today.

Lingua principale
TeX
Stelle
125
Fork
57
Merge medio
1g 22h
PR unite (30g)
18

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di QuantEcon/lecture-python.myst

Tutte le issue di QuantEcon/lecture-python.myst

Issue simili

Altre issue su Documentation

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.