Skip to content

Commit aa08db0

Browse files
authored
Update monte_carlo.py (#751)
([0,radius], [0, radius]) is in the upper RIGHT quadrant, as mentioned in the explanations for Monte Carlo.
1 parent d21dacd commit aa08db0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contents/monte_carlo_integration/code/python/monte_carlo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def monte_carlo(n_samples, radius = 1):
1919
if(in_circle(x, y, radius)):
2020
in_circle_count += 1
2121

22-
# Since we've generated points in upper left quadrant ([0,radius], [0, radius])
22+
# Since we've generated points in upper right quadrant ([0,radius], [0, radius])
2323
# We need to multiply the number of points by 4
2424
pi_estimate = 4 * in_circle_count / (n_samples)
2525

0 commit comments

Comments
 (0)