Skip to content
New issue

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

'Solution' #1106

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
# write your code here
import random
import numpy as np
import matplotlib.pyplot as plt


def flip_coin() -> dict:
coin = ["heads", "tails"]
res = {i: 0 for i in range(11)}
for _ in range(10000):
count = sum(random.choice([0, 1]) for _ in range(10))
res[count] += 1

return {key: (value/10000) * 100 for key, value in res.items()}

def draw_gaussian_distribution_graph() -> None:

res = flip_coin()

ypoints = np.array([value for value in res.values()])

plt.plot(ypoints, color='blue')
plt.title("Gaussian distribution")
plt.xlabel("Heads count")
plt.ylabel("Drop percentage %")
plt.show()
Loading