From 7972747c92d05540bf429a7f43d9f4e467738d25 Mon Sep 17 00:00:00 2001 From: wkeahi Date: Sun, 14 Feb 2021 04:17:59 -0800 Subject: [PATCH] fixed exercise 1 solution indexing --- source/rst/dynamic_programming/mccall_model.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/rst/dynamic_programming/mccall_model.rst b/source/rst/dynamic_programming/mccall_model.rst index 0089da6e..0276d88e 100644 --- a/source/rst/dynamic_programming/mccall_model.rst +++ b/source/rst/dynamic_programming/mccall_model.rst @@ -617,7 +617,7 @@ Here's one solution @assert length(w) - 1 ∈ support(dist) && w̄ <= w[end] while true # Generate a wage draw - w_val = w[rand(dist)] # the wage dist set up earlier + w_val = w[rand(dist)+1] # the wage dist set up earlier if w_val ≥ w̄ stopping_time = t break