Question: please use python to write Problem J5: Chances of winning Problem Description You want to determine the chances that your favourite team will be the
Problem J5: Chances of winning Problem Description You want to determine the chances that your favourite team will be the champion of a small tour- nament There are exactly four teams. At the end of the toumament, a total of six games will have been played with each team playing every other team exactly once. For each game, either one team wins (and the other loses), or the game ends in a tie. If the game does not end in a tie, the winning team is awarded three points and the losing team is awarded zero points. If the game ends in a tie, each team is awarded one point. Your favourite team will only be the champion if ends the tournament with strictly more total points than every other team i.e., a tie for first place is not good enough for your favourite team) The tournament is not over yet but you know the scores of every game that has already been played. You want to consider all possible ways points could be awarded in the remaining games that have not yet been played and determine in how many of these cases your favourite team will be the toumament champion Input Specification The first line of input will contain an integer T which is your favourite team (1ST4) The second line will contain an integer G, the number of games already played (0G5). The next G lines will give the results of games that have already been played. Each of these lines will consist of four integers A, B, SA. SB separated by single spaces where 1 A SB,tea B won if SA
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
