This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.theguardian.com/science/2024/sep/30/did-you-solve-it-the-box-problem-that-baffled-the-boffins | |
def all_games | |
(0...15).to_a.combination(2).map do |prize_a, prize_b| | |
game(prize_a, prize_b) | |
end.tally | |
end | |
def game(prize_a, prize_b) | |
field = make_field(prize_a, prize_b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# matchup format: | |
# favorite, underdog, p fave wins at home, p fave wins away, series score so far | |
matchups = [ | |
# ['GSW', 'HOU', 0.87, 0.69, [0, 0]], | |
# ['SAS', 'MEM', 0.92, 0.78, [0, 0]], | |
# ['OKC', 'DAL', 0.82, 0.59, [0, 0]], | |
# ['LAC', 'POR', 0.71, 0.45, [0, 0]], | |
# ['CLE', 'DET', 0.80, 0.56, [0, 0]], | |
# ['TOR', 'IND', 0.79, 0.55, [0, 0]], | |
# ['MIA', 'CHA', 0.62, 0.35, [0, 0]], |