From dfbdc4563c85afb143455d6a90cbdd2319615b3b Mon Sep 17 00:00:00 2001 From: Daniel <59575049+lemoentjiez@users.noreply.github.com> Date: Wed, 14 Dec 2022 12:22:57 +0200 Subject: [PATCH] Update distribution.py --- LabPSA_2/distribution.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/LabPSA_2/distribution.py b/LabPSA_2/distribution.py index 8b13789..1b93593 100644 --- a/LabPSA_2/distribution.py +++ b/LabPSA_2/distribution.py @@ -1 +1,20 @@ +import random + +students, jora, offence = 0, 0, 0 +for i in range(730): + students += 6 + y, x = random.uniform(0, 1), random.uniform(0, 1) + if y <= 0.02: + jora += 6 + if x <= 0.05: + if offence == 0: + jora += 50 + if offence == 1: + jora += 150 + if offence > 1: + jora += 300 + offence += 1 + +print("expected cost jora:" + str(jora)) +print("expected cost students:" + str(students))