This commit is contained in:
2025-10-08 15:48:07 +02:00
parent b2a968feff
commit 125f67f9b6
5 changed files with 126 additions and 0 deletions

19
Serie01/aufg8.py Normal file
View File

@@ -0,0 +1,19 @@
import numpy as np
R = np.array([720, 740, 760, 780, 800, 820])
A = np.array([19, 24, 26, 27, 10, 5])
B = np.array([4, 8, 52, 40, 32, 24])
def qval(edges, counts, x):
cdf = np.cumsum(counts) / counts.sum()
i = np.searchsorted(edges, x)
if i == 0: return 0.0
if i >= len(edges): return 1.0
w = edges[1] - edges[0]
return cdf[i-1] + (x - edges[i-1]) / w * (cdf[i] - cdf[i-1])
qa = qval(R, A, 730)
qb = qval(R, B, 750)
print(qa)
print(qb)