Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- matrix20 = [
- [39, 41, 41, 21, 40, 26, 32, 31, 35, 43],
- [31, 37, 36, 39, 47, 27, 50, 49, 28, 45],
- [31, 37, 41, 40, 34, 37, 42, 22, 36, 34],
- [36, 45, 31, 41, 26, 37, 41, 33, 37, 31],
- [38, 27, 29, 39, 35, 42, 45, 32, 46, 31],
- [21, 26, 37, 47, 32, 38, 45, 32, 36, 24],
- [37, 37, 30, 33, 29, 42, 29, 34, 35, 38],
- [26, 51, 27, 29, 37, 26, 45, 33, 20, 34],
- [44, 45, 28, 33, 37, 31, 41, 43, 41, 33],
- [39, 41, 42, 30, 30, 46, 35, 30, 45, 39],
- [37, 40, 39, 41, 39, 41, 31, 35, 42, 39],
- [33, 37, 42, 40, 36, 29, 42, 32, 32, 29],
- [35, 30, 52, 49, 39, 40, 36, 30, 34, 41],
- [34, 47, 33, 45, 34, 44, 22, 29, 36, 33],
- [32, 30, 17, 38, 34, 32, 35, 38, 31, 35],
- [22, 39, 29, 28, 34, 36, 35, 36, 38, 44],
- [37, 35, 41, 35, 30, 31, 28, 46, 30, 37],
- [48, 40, 44, 41, 40, 33, 36, 32, 38, 22],
- [32, 43, 34, 45, 34, 46, 38, 38, 28, 39],
- [58, 26, 29, 41, 38, 38, 32, 39, 28, 35],
- ]
- array = []
- for a in matrix20:
- b = []
- for i in range(5):
- b.append(a[2 * i] + a[2 * i + 1])
- array.append(b)
- matrix40 = []
- for i in range(10):
- a = []
- for j in range(5):
- a.append(cmp40[2 * i][j])
- for j in range(5):
- a.append(cmp40[2 * i + 1][j])
- matrix40.append(a)
- for a in matrix40:
- print(a)
- from collections import Counter
- t10 = []
- for a in matrix10:
- for el in a:
- t10.append(el)
- t40 = []
- for a in matrix40:
- for el in a:
- t40.append(el)
- #print(t40)
- table40 = sorted(Counter(t40).items(), key = lambda x: x[0])
- data40 = []
- #print("TABLE 40")
- for p in table40:
- #print(p[0], p[1], p[1] / len(t40))
- data40.append(tuple( (p[0], p[1] / len(t40)) ))
- #print()
- """cnt = 0
- cases = []
- for i in range(24):
- a, b = map(int, input().split())
- cases.append(tuple( (a, b) ))
- cnt += b
- print(cases)
- for p in cases:
- print(p[0], p[1])
- print("cnt:", cnt)"""
- cases = [(6, 2), (8, 4), (9, 8), (10, 9), (11, 20), (12, 12), (13, 19), (14, 26), (15, 27), (16, 28), (17, 37), (18, 37), (19, 28), (20, 26), (21, 23), (22, 22), (23, 11), (24, 19), (25, 10), (26, 13), (27, 7), (28, 6), (29, 2), (30, 2)]
- cnt = 400
- data10 = []
- for p in cases:
- data10.append(tuple( (p[0], p[1] / cnt) ) )
- """
- print("DATA, t = 10")
- for p in data10:
- print(p[0], p[1])
- """
- """
- print("DATA, t = 40")
- for p in data40:
- print(p[0], p[1]) """
- s10 = 0
- for p in data10:
- s10 += p[0] * p[1] * 400
- n10 = s10 / 400
- #print("s10:", s10)
- #print("n10:", n10)
- s40 = 0
- for p in data40:
- s40 += p[0] * p[1] * 100
- n40 = s40 / 100
- #print("s40:", s40)
- #print("n40:", n40)
- sigma10 = 0
- for p in data10:
- sigma10 += p[1] * 400 * (p[0] - n10)**2
- sigma10 /= 400
- sigma10 = sigma10**0.5
- #print("sigma10:", sigma10)
- sigma40 = 0
- for p in data40:
- sigma40 += p[1] * 100 * (p[0] - n40)**2
- sigma40 /= 100
- sigma40 = sigma40**0.5
- #print("sigma40:", sigma40)
- sigma10_relative = sigma10 / 20
- sigma40_relative = sigma40 / 10
- #print("sigma10_relative:", sigma10_relative)
- #print("sigma40_relative:", sigma40_relative)
- #print("n10**0.5:", n10**0.5)
- #print("n40**0.5:", n40**0.5)
- diff10_relative = abs(sigma10 - n10**0.5) / sigma10
- diff40_relative = abs(sigma40 - n40**0.5) / sigma40
- #print("diff10_relative:", diff10_relative)
- #print("diff40_relative:", diff40_relative)
- """
- cnt_in_sigma10 = 0
- cnt_in_2_sigma10 = 0
- for p in data10:
- if abs(p[0] - n10) <= sigma10:
- cnt_in_sigma10 += p[1] * 400
- if abs(p[0] - n10) <= 2 * sigma10:
- cnt_in_2_sigma10 += p[1] * 400
- cnt_in_sigma10_proportion = cnt_in_sigma10 / 400
- cnt_in_2_sigma10_proportion = cnt_in_2_sigma10 / 400
- print("cnt_in_sigma10:", cnt_in_sigma10)
- print("cnt_in_sigma10_proportion:", cnt_in_sigma10_proportion)
- print("cnt_in_2_sigma10:", cnt_in_2_sigma10)
- print("cnt_in_2_sigma10_proportion:", cnt_in_2_sigma10_proportion)
- """
- """
- cnt_in_sigma40 = 0
- cnt_in_2_sigma40 = 0
- for p in data40:
- if abs(p[0] - n40) <= sigma40:
- cnt_in_sigma40 += p[1] * 100
- if abs(p[0] - n40) <= 2 * sigma40:
- cnt_in_2_sigma40 += p[1] * 100
- cnt_in_sigma40_proportion = cnt_in_sigma40 / 100
- cnt_in_2_sigma40_proportion = cnt_in_2_sigma40 / 100
- print("cnt_in_sigma40:", cnt_in_sigma40)
- print("cnt_in_sigma40_proportion:", cnt_in_sigma40_proportion)
- print("cnt_in_2_sigma40:", cnt_in_2_sigma40)
- print("cnt_in_2_sigma40_proportion:", cnt_in_2_sigma40_proportion)
- """
- """
- e10_eq1 = sigma10_relative / n10
- print("e10_eq1:", e10_eq1)
- e10_eq2 = 1 / (n10 * 400)**0.5
- print("e10_eq2:", e10_eq2)
- """
- e40_eq1 = sigma40_relative / n40
- print("e40_eq1:", e40_eq1)
- e40_eq2 = 1 / (n40 * 100)**0.5
- print("e40_eq2:", e40_eq2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement