Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me answer it asap. It is due soon Two basketball teams are trying to draft players. They would each like to add 10
Please help me answer it asap. It is due soon
Two basketball teams are trying to draft players. They would each like to add 10 new players to round out their teams. You are going to simulate the draft for the two teams. Each of the 20 available players has a random free-throw percentage between 50% and 90% (let's use uniformly distributed INTEGERS from 50-90), and a random average number of turnovers per game between 0 and 8 (uniformly distributed INTEGERS), and can be identified by a jersey number which ranges from 1 to 20. Create a 3 by 20 matrix that contains all of the relevant information for the twenty players with the jersey numbers (first row), free throw percentages (second row), and average number of turnovers per game (third row), Team A likes to pick players with the highest free-throw percentage, while Team B prefers players with a low average number of turnovers. Thus, when choosing teams, Team A will choose whichever player is available with the highest free-throw percentage, while Team B will choose whichever player is available with the lowest turnover rate. To be fair, the teams must alternate choosing players. Also remember that no one player can be placed on both teams each player must be assigned to one and only one team! Simulate the draft using a loop, with alternating picks. To start of the draft, perform a coin toss: heads - Team A starts: tails-team B starts. Create 3 by 10 matrices that display the players chosen and corresponding stats for Team A and Team B. The matrix for each team should include the jersey number (first row), free-throw percentage (second row), and average number of turnovers (third row) for each of the players selected. Once you are done with picking the teams, print the matrices for each team to the command window. Also, calculate the average free-throw percentage and the average turnover rate for each team, and print these four values to the command window with informative text Notes on proper programming style - please follow for full credit Now that you have had some experience working witl Matlab as well as the chance to review several m-files (HW solutions/in-class examples), you should start thinking about how to write clear and concise code. (We will worry about performance/speed later.) Starting from this homework, our grading rubric will also take into consideration programming style. So, here are some tips for this homework: . You should only hard-code one variable the total number of players (20). All other variables must either be calculated or randomly assigned as per the problem statement. If want to simulate a draft with fewer/ more players. I should only need to alter one variable total number of players-manually in your code. You should not create extra/temporary row or column vectors and then combine them into matrices. Either populate matricus in one shot or pre-allocate them using ceros and then populate rows/columns. Data should not be copied element-wise between arrays. Copy over entire rows or columns using array operators/functions. Do not repeat blocks of code unnecessarily - use loops along with selection brunching statements. In particular, you only need one loop in this problem; everything else can be accomplished using array operations/functions and selection branching No user-defined functions are required. So save yourself the trouble of additional coding and debugging . Two basketball teams are trying to draft players. They would each like to add 10 new players to round out their teams. You are going to simulate the draft for the two teams. Each of the 20 available players has a random free-throw percentage between 50% and 90% (let's use uniformly distributed INTEGERS from 50-90), and a random average number of turnovers per game between 0 and 8 (uniformly distributed INTEGERS), and can be identified by a jersey number which ranges from 1 to 20. Create a 3 by 20 matrix that contains all of the relevant information for the twenty players with the jersey numbers (first row), free throw percentages (second row), and average number of turnovers per game (third row), Team A likes to pick players with the highest free-throw percentage, while Team B prefers players with a low average number of turnovers. Thus, when choosing teams, Team A will choose whichever player is available with the highest free-throw percentage, while Team B will choose whichever player is available with the lowest turnover rate. To be fair, the teams must alternate choosing players. Also remember that no one player can be placed on both teams each player must be assigned to one and only one team! Simulate the draft using a loop, with alternating picks. To start of the draft, perform a coin toss: heads - Team A starts: tails-team B starts. Create 3 by 10 matrices that display the players chosen and corresponding stats for Team A and Team B. The matrix for each team should include the jersey number (first row), free-throw percentage (second row), and average number of turnovers (third row) for each of the players selected. Once you are done with picking the teams, print the matrices for each team to the command window. Also, calculate the average free-throw percentage and the average turnover rate for each team, and print these four values to the command window with informative text Notes on proper programming style - please follow for full credit Now that you have had some experience working witl Matlab as well as the chance to review several m-files (HW solutions/in-class examples), you should start thinking about how to write clear and concise code. (We will worry about performance/speed later.) Starting from this homework, our grading rubric will also take into consideration programming style. So, here are some tips for this homework: . You should only hard-code one variable the total number of players (20). All other variables must either be calculated or randomly assigned as per the problem statement. If want to simulate a draft with fewer/ more players. I should only need to alter one variable total number of players-manually in your code. You should not create extra/temporary row or column vectors and then combine them into matrices. Either populate matricus in one shot or pre-allocate them using ceros and then populate rows/columns. Data should not be copied element-wise between arrays. Copy over entire rows or columns using array operators/functions. Do not repeat blocks of code unnecessarily - use loops along with selection brunching statements. In particular, you only need one loop in this problem; everything else can be accomplished using array operations/functions and selection branching No user-defined functions are required. So save yourself the trouble of additional coding and debugging Step 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