Autograder demo: Code with randomization

The python autograder will automatically seed student and answer code with the same seed, which can be useful in problems that require extensive randomization. This problem also aliases some functions in the random library to use numpy's random functions so that the results are more reproducible.

Using Monte Carlo integration, approximate the area of a circle with radius of $1$. Generate $N=100$ random points such that each point lies inside of a box centered at the origin with side length $2$, and use these points to estimate the area.

Your code snippet should define the following variables:

Name Type Description
area Number Approximate area of the circle.
user_code.py

Correct answer

Student view placeholder

In student views this area is used for assessment and score info.
Tools

Staff information

Question

Title:
Autograder demo: Code with randomization

Variant

Started at:
2026-09-19 08:00:22 (CDT)
Duration:
0s
Show/Hide answer
{}
History
dec frac
rad deg