Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def simulate_pickem(simulations=10000):
- # Actual teams in the tournament
- teams = [
- "B8", "HEROIC", "BetBoom Team", "OG", "Nemiga Gaming",
- "Lynn Vision Gaming", "Legacy", "TYLOO", "FlyQuest", "NRG",
- "Wildcard", "Imperial Esports", "Chinggis Warriors",
- "Complexity", "Metizport", "Fluxo Fluxo"
- ]
- # Define the actual outcomes
- actual_3_0 = set(["HEROIC", "B8"]) # Picked to go 3:0
- actual_0_3 = set(["Fluxo Fluxo", "Metizport"]) # Picked to go 0:3
- actual_3_win = set([ # 3:1 and 3:2 teams (both count as going through)
- "BetBoom Team", "OG", "Nemiga Gaming",
- "Lynn Vision Gaming", "Legacy", "TYLOO"
- ])
- passed = 0 # Counter for successful pick'ems
- for _ in range(simulations):
- # Shuffle all teams to make random picks each simulation
- shuffled = teams.copy()
- random.shuffle(shuffled)
- # Pick random teams for 3:0, 3:1/3:2, and 0:3
- pick_3_0 = set(shuffled[:2])
- pick_3_win = set(shuffled[2:8]) # 6 teams
- pick_0_3 = set(shuffled[8:10])
- # Count how many picks match the actual outcomes
- correct = len(pick_3_0 & actual_3_0) + \
- len(pick_3_win & actual_3_win) + \
- len(pick_0_3 & actual_0_3)
- # If 5 or more picks are correct, it's a "pass"
- if correct >= 5:
- passed += 1
- # Calculate statistics
- not_passed = simulations - passed
- percentage = (passed / simulations) * 100
- # Output results
- print(f"Simulations run: {simulations}")
- print(f"Passed: {passed}")
- print(f"Not passed: {not_passed}")
- print(f"Percentage passed: {percentage:.2f}%")
- if __name__ == "__main__":
- # Run the simulation with desired number of trials
- simulate_pickem(simulations=10000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement