Prob16 possible discrepancy of rounding rule

Back to General discussions forum

bermanrl     2015-08-16 16:34:59

Given the following input data: 10 224 24 109 73 134 0 1679 5882 6954 7561 4145 7511 2282 1727 8119 0 1065 659 1838 1381 966 1340 0 11087 6519 5225 11695 8667 3131 13195 15606 7803 5385 5305 4352 8741 684 0 1122 64 1506 1554 46 1727 0 337 432 443 1302 1772 206 1294 1109 0 4182 449 2321 992 16055 10123 6377 4975 14474 15118 0 6212 14631 474 1868 10673 839 15678 15808 0 45 208 194 11 233 100 149 105 87 215 112 0 6812 1611 4693 11787 16084 3426 1061 16047 9637 15692 0

looking at the third test case (line 5) your program claims the answer to be 1208 when in fact it should be 1209. Proof?: (1065 +659 +1838 +1381 +966 +1340)/(6 * 1.0) = int(round(1208.66666666666667)) = 1209.

I am going to asume I am misreading the rules in play. Any clarification would be most gladly received.

Thank you,

Robert Berman

Quandray     2015-08-16 18:22:05
User avatar

1065+659+1838+1381+966+1340 = 7249

7249/6 = 1208.166666667 so the answer is 1208

How are you getting 1208.66666666666667?

bermanrl     2015-08-17 14:27:30

Quandray,

The answer to your question about my summation is I have no idea except possibly brain freeze. But the question certainly did give me a kick start which I appreciate.

Thanks sgain,

Robert

Please login and solve 5 problems to be able to post at forum