Question
Assignment: This coursework asks you to compare different scoring methods for the sport of squash by simulating matches between players of different ability. Rules of
Assignment: This coursework asks you to compare different scoring methods for the sport of squash by simulating matches between players of different ability.
Rules of squash: This coursework uses a simplified summary of the rules of squash. Squash is a racquet game played by two players, and consists of a number of rallies. In each rally, the player who starts is the server, and the receiving player is the returner. A player wins a rally if the other player is unable to make a legal shot. Matches are usually played over a number of games, with each the winner being the player who reaches a certain score first. Professional matches are played over 5 games, with the winner being the first player to win 3.
There are two scoring systems commonly used in squash:
Point-a-rally scoring (PARS)
The winner of each rally always receives a point (regardless of whether they were the server or re- turner).
The first player to reach at least 11 points and be ahead by at least 2 points wins the game.
If the server wins a rally, they continue as server.
If the returner wins a rally, they become the server.
English scoring
Only the server is awarded a point if they win a rally.
If the server wins a rally, they receive a point and continue as server.
If the returner wins a rally, they become the server but dont receive a point.
The first player to reach 9 points wins the game unless the score has reached 8-8.
If the score reaches 8-8, the player who reached 8 first decides whether to play to 9 or to 10.
Modelling playing ability
- Assume a player As ability is represented by an integer value rA such that 0
- In a game between player A and player B, the probability that A wins any given point is:
P (A wins) = rA / rA + rB
How to solve 1d and 1e?
Questions 1. Provide code to answer the questions below. You should also provide a transcript of a Python inter- active session that shows the result of executing the test case given for each question. All parts of this question use the Point-a-rally scoring (PARS) system. (a) Define a function game (ra, rb) that implements the algorithm below to simulate a single game of squash between players with abilities ra and rb. The function should return the final score as a tuple. Start Generate random number r between 0 and 1 IsrStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started