in reply to Stuck with hw
An accurate solution is not possible from the input data unless it is known how the individual games from each match turned out.
For example in the Kasparov Karpov match the score 2.0-2.0 could be a result of.
| Kasparov | Karpov |
|---|---|
| win 2 lose 2 | win 2 lose 2 |
| win 1 draw 2 lose 1 | win 1 draw 2 lose 1 |
| win 0 draw 4 lose 0 | win 0 draw 4 lose 0 |
Each of these will produce the 2.0-2.0 score from the excersize. Of course, pointing this out to your teacher may not improve your grade. I guess you could code the excersize to print out all the possible variations for each score but this will cause the summary scores at the end to vary over a wide range indeed since for this one match they could each have 0,1, or 2 wins, 0,1 or 2 losses, or 0, 2, or 4 draws with a couple these combined in the middle...
One consolation, is that the .5 scores have to have an odd number of draws and the .0 scores have to have an even number of draws.
|
|---|