Please explain steps along the way, along with code! Thanks! (used through Matla
ID: 3713114 • Letter: P
Question
Please explain steps along the way, along with code! Thanks! (used through Matlab)
26. During a golf match, a certain number of points are awarded for each eagle and a different number for each birdie. No points are awarded for par, and a certain number of points are deducted for each bogey and a different number deducted for each double bogey (or worse). The newspaper report of an important match neglected to mention what these point values were, but did provide the following table of the results Golfer EaglesBirdiesPars Bogeys Doubles Points 2 10 12 4 10 10 10 12 0 From the information in the table write four equations in terms of four unknowns. Solve the equations for the unknown points awarded for eagles and birdies and points deducted for bogeys and double bogeysExplanation / Answer
Ans :
Let Points awarded for Eagles be A
Let Points awarded for Birdies be B
Let Points awarded for Bogeys be C
Let Points awarded for Doubles be D
So, A+2B+C+D = 5--------->Eq(1)
2A+3B+D = 12--------->Eq(2)
A+4B+C = 11--------->Eq(3)
A+3B+2C = 8--------->Eq(4)
Solving (3) and (4) we get [Substract (3) from (4) we get ]
B - C = 3 --------->Eq(5)
Solving (1) and (2) we get [Substract (1) from (2) we get ]
A+B-C = 7 --------->Eq(6)
Solving (5) and (6) we get [Substract (5) from (6) we get ]
A = 4
Put A =4 in Eq(3) we get ,
4B + C = 7--------->Eq(7)
Solving (5) and (7) we get [Add (5) and (7) we get ]
5B = 10 , B = 2
B -C = 3,
So C = -1
A+2B+C+D = 5
=> 4 + 4 -1 + D = 5
=> D = -2
Mat lab code :
MATLAB code to solve the four equations in four unknowns.
X=[1 2 1 1; 2 3 0 1; 1 4 1 0; 1 3 2 0];
Y=[5; 12; 11; 8];
Points=XY; % solve by using left division
fprintf('The point values are: Eagles: %.1f Birdies: %.1f ',Points(1:2))
fprintf('Bogeys: %.1f Doubles: %.1f ',Points(3:4))
Execute the MATLAB code to get the unknown points awarded.
The point values are:
Eagles: 4.0
Birdies: 2.0
Bogeys: -1.0
Doubles: -2.0
Thus the points awarded for eagles is 4 , and awarded for birdies is 2 .
Observe that the points for bogeys and doubles are negative , which implies that the points are deducted .
The points deducted for bogeys is 1 , and deducted for double bogies is 2 .