We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The plt render should be moved back one indentation, since you're really only interested in the final result and it saves you 5000 unnecessary renders
def monte_carlo(n): results = 0 for i in range(n): flip_result = coin_flip() results = results + flip_result
prob_value = results/(i+1) list1.append(prob_value) plt.axhline(y=0.5, color ='r', linestyle='-') plt.xlabel("Iterations") plt.ylabel("Probability") plt.plot(list1) return results/n
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The plt render should be moved back one indentation, since you're really only interested in the final result and it saves you 5000 unnecessary renders
def monte_carlo(n):
results = 0
for i in range(n):
flip_result = coin_flip()
results = results + flip_result
The text was updated successfully, but these errors were encountered: