Skip to content

[numba.md] numba_ex3 asks for n = 100_000_000 but the shared setup and solution use n = 1_000_000 #579

Description

@mmcky

Since #550, the Exercises section opens with a shared setup block that draws u_draws and v_draws at n = 1_000_000 so the samples can be reused by both {ref}speed_ex1 and {ref}numba_ex3.

The statement of numba_ex3 still ends with: "For the size of the Monte Carlo simulation, use something substantial, such as n = 100_000_000." The provided solution then uses the shared 10^6 arrays, so it appears to ignore the exercise's own instruction — and at 10^6 the parallel gain over the serial version is modest, which undercuts the point the exercise is making.

Two possible fixes:

  • Soften or drop the n = 100_000_000 sentence in numba_ex3 and point readers at numba_ex_draw_speed, which already does the large-n comparison end-to-end.
  • Keep the sentence and add a line to the solution noting that the shared n keeps runtime and memory low, and that scaling up means regenerating the arrays (memory grows at roughly 16n bytes, about 1.6 GB at 10^8).

Origin: flagged by Copilot review on the zh-cn sync PR QuantEcon/lecture-python-programming.zh-cn#70. The translated text mirrors the English source verbatim, so the fix belongs here and will propagate to all editions through translation sync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions