Skip to content

Instantly share code, notes, and snippets.

@mushanyoung
mushanyoung / poker_offline_insurance_actual_ev.py
Last active July 8, 2024 20:52
计算扑克线下保险的真实期望值
#!/usr/bin/env python3
# Iterate folded cards in [0, 14] from undealt_cards then calculate the actual EV.
def calculate_ev_for_unseen_cards(undealt_cards, outs):
ev_sum = 0
count = 0
for folded_cards in range(0, 15):
actual_undealt_cards = undealt_cards - folded_cards
# actual_undealt_cards must be a positive number in real life.