Advertisement
Guest User

Untitled

a guest
Jun 10th, 2025
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. import random
  2.  
  3. def simulate_pickem(simulations=10000):
  4. # Actual teams in the tournament
  5. teams = [
  6. "B8", "HEROIC", "BetBoom Team", "OG", "Nemiga Gaming",
  7. "Lynn Vision Gaming", "Legacy", "TYLOO", "FlyQuest", "NRG",
  8. "Wildcard", "Imperial Esports", "Chinggis Warriors",
  9. "Complexity", "Metizport", "Fluxo Fluxo"
  10. ]
  11.  
  12. # Define the actual outcomes
  13. actual_3_0 = set(["HEROIC", "B8"]) # Picked to go 3:0
  14. actual_0_3 = set(["Fluxo Fluxo", "Metizport"]) # Picked to go 0:3
  15. actual_3_win = set([ # 3:1 and 3:2 teams (both count as going through)
  16. "BetBoom Team", "OG", "Nemiga Gaming",
  17. "Lynn Vision Gaming", "Legacy", "TYLOO"
  18. ])
  19.  
  20. passed = 0 # Counter for successful pick'ems
  21.  
  22. for _ in range(simulations):
  23. # Shuffle all teams to make random picks each simulation
  24. shuffled = teams.copy()
  25. random.shuffle(shuffled)
  26.  
  27. # Pick random teams for 3:0, 3:1/3:2, and 0:3
  28. pick_3_0 = set(shuffled[:2])
  29. pick_3_win = set(shuffled[2:8]) # 6 teams
  30. pick_0_3 = set(shuffled[8:10])
  31.  
  32. # Count how many picks match the actual outcomes
  33. correct = len(pick_3_0 & actual_3_0) + \
  34. len(pick_3_win & actual_3_win) + \
  35. len(pick_0_3 & actual_0_3)
  36.  
  37. # If 5 or more picks are correct, it's a "pass"
  38. if correct >= 5:
  39. passed += 1
  40.  
  41. # Calculate statistics
  42. not_passed = simulations - passed
  43. percentage = (passed / simulations) * 100
  44.  
  45. # Output results
  46. print(f"Simulations run: {simulations}")
  47. print(f"Passed: {passed}")
  48. print(f"Not passed: {not_passed}")
  49. print(f"Percentage passed: {percentage:.2f}%")
  50.  
  51. if __name__ == "__main__":
  52. # Run the simulation with desired number of trials
  53. simulate_pickem(simulations=10000)
  54.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement