import random
def calculate_odds(rider_skill, horse_skill):
random_num = random.randint(5, 10)
odds = (rider_skill * random_num) / horse_skill
return odds
# シミュレーション回数
num_simulations = 10000
odds_list = []
for _ in range(num_simulations):
rider_skill = random.choices([1, 2, 3, 4], weights=[1, 2, 2, 3])[0]
horse_skill = random.randint(1, 10)
odds = calculate_odds(rider_skill, horse_skill)
odds_list.append(odds)
# 平均値と最大値を計算
average_odds = sum(odds_list) / len(odds_list)
max_odds = max(odds_list)
print("平均値:", average_odds)
print("最大値:", max_odds)
aW1wb3J0IHJhbmRvbQoKZGVmIGNhbGN1bGF0ZV9vZGRzKHJpZGVyX3NraWxsLCBob3JzZV9za2lsbCk6CiAgICByYW5kb21fbnVtID0gcmFuZG9tLnJhbmRpbnQoNSwgMTApCiAgICBvZGRzID0gKHJpZGVyX3NraWxsICogcmFuZG9tX251bSkgLyBob3JzZV9za2lsbAogICAgcmV0dXJuIG9kZHMKCiMg44K344Of44Ol44Os44O844K344On44Oz5Zue5pWwCm51bV9zaW11bGF0aW9ucyA9IDEwMDAwCm9kZHNfbGlzdCA9IFtdCgpmb3IgXyBpbiByYW5nZShudW1fc2ltdWxhdGlvbnMpOgogICAgcmlkZXJfc2tpbGwgPSByYW5kb20uY2hvaWNlcyhbMSwgMiwgMywgNF0sIHdlaWdodHM9WzEsIDIsIDIsIDNdKVswXQogICAgaG9yc2Vfc2tpbGwgPSByYW5kb20ucmFuZGludCgxLCAxMCkKICAgIG9kZHMgPSBjYWxjdWxhdGVfb2RkcyhyaWRlcl9za2lsbCwgaG9yc2Vfc2tpbGwpCiAgICBvZGRzX2xpc3QuYXBwZW5kKG9kZHMpCgojIOW5s+Wdh+WApOOBqOacgOWkp+WApOOCkuioiOeulwphdmVyYWdlX29kZHMgPSBzdW0ob2Rkc19saXN0KSAvIGxlbihvZGRzX2xpc3QpCm1heF9vZGRzID0gbWF4KG9kZHNfbGlzdCkKCnByaW50KCLlubPlnYflgKQ6IiwgYXZlcmFnZV9vZGRzKQpwcmludCgi5pyA5aSn5YCkOiIsIG1heF9vZGRzKQ==