tag:blogger.com,1999:blog-8677649049588007585.post4222082474256860788..comments2016-06-07T12:37:50.928+01:00Comments on PL/SQL Challenge: "Average" function not correct due to lack of rounding? (9397)Steven Feuersteinhttp://www.blogger.com/profile/16619706770920320550noreply@blogger.comBlogger6125tag:blogger.com,1999:blog-8677649049588007585.post-4630335884681428812011-11-10T21:25:43.212+00:002011-11-10T21:25:43.212+00:00Hi, S. I was one who did not mark a answer where w...Hi, S. I was one who did not mark a answer where was a lot of computing with the floating point - and yes, my reason was a "there is a few operation with real numbers and there "must" be a some trouble with periodis number in binary format". If was or was not right i do not know, but I believe that your marking of what is right as best as you can ;). I just say, yes, there was probably people who thinked about rounding and I was one of them too ;)AZORhttp://www.blogger.com/profile/12104952848684065146noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-27776684043311811352011-11-07T14:12:53.360+00:002011-11-07T14:12:53.360+00:00Strictly spoken is is not about rounding problems,...Strictly spoken is is not about rounding problems, but about Numerical Methods. Dividing is a calculation which introduces numerical problems, the same as subtraction. Small errors or deviations in presentation can have a big influence on dividing and subtraction. Adding and multiplication introduces less errors.<br />So in practice, try to avoid dividing and subtraction as much as possible, because the are ill behaved and easily introduces very big errors. Try the following 1-(3/3). Could go anywhere depending on computer language and implimention.Wim de Langehttp://www.blogger.com/profile/05505341375827859005noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-83243962436526689092011-11-04T07:31:36.122+00:002011-11-04T07:31:36.122+00:00I did not type it in and test it, but I had that c...I did not type it in and test it, but I had that choice marked incorrect. My reasoning was the following:<br /><br />"There is already one choice showing the bad way of doing your own average calculation. This choice is just an even worse implementation of that choice. Why would the author include that choice if not for a reason? Ah, rounding problems! Yes, I bet those data will cause a rounding error. I'll mark it as incorrect."<br /><br />Yes, I know one of the premises of the quiz is that each choice is completely independent. But it is difficult not to try to second-guess the author ;-)<br /><br />I believe the scoring of the quiz is correct - I must just teach myself not to think in "over-complicated" ways ;-)<br /><br />I do not believe we need to complicate quiz scoring by weighting algorithms. My experience is, that the more you try to create an algorithm that has to be meticulously fair in all possible and impossible situations - the more impossible it gets to understand the scoring algorithm and that opens up for constant arguing. (Witness the income tax system in many countries :-)<br /><br />(I could even argue that the present scoring system and wildcards and forgiveness for un-played days is too complex, but we have learned its quirks by now. Just don't change scoring algorithm every now and again over each tiny issue that pops up - consistency is the best :-)Kim Berg Hansenhttp://www.blogger.com/profile/06491635470794828550noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-91173254595059553672011-11-03T12:15:08.159+00:002011-11-03T12:15:08.159+00:00I agree with the scoring of this quiz, which is co...I agree with the scoring of this quiz, which is consistent with the scoring of similar quizzes in the past (ones where the algorithm would not work for all situations, but does work for the question given).Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-88282653603256151952011-11-02T20:08:20.032+00:002011-11-02T20:08:20.032+00:00As a reviewer I was a bit cautious about that choi...As a reviewer I was a bit cautious about that choice, but then realized I was thinking too far... Questions and choices are (usually) provided in a very narrow context and we should leave it at that. The idea is to present features, and sometimes quirks, of the PL/SQL language. The idea is not to provide full-blown, tested and certified production solutions.<br /><br />It is Math-101 that you should not compute an average as presented here, but that is besides the point. With the simple integers presented, who would anticipate a deviation from a straight 3.5? I'll admit that I was a little surprised to see a deviation with the range from 1 thru 9, and probably even more so when seeing the result from shifting the numbers a little: plch_numbers_t (9,2,3,4,5,6,7,8,1); returns just 5.<br /><br />Should we have added a ROUND to kill any potential too many decimals? Could have, but... honestly... Was there a reason to believe that such simple numbers could create an issue? Don't forget, the PL/SQL Challenge is not out to trick players, rather the idea is to increase awareness of PL/SQL features.<br /><br />I think the biggest problem here is that we all defaulted to that basic training; Don't compute averages this way! Is it always bad? No, just don't do it! Do we know when it is a problem? Well, most times we would need to try it out.<br /><br />I think the choice is scored correctly. It does produce the desired result and there is really no reason, when looking at it, to believe that it would not.<br /><br />MikeMikehttp://www.blogger.com/profile/04855911908563127732noreply@blogger.comtag:blogger.com,1999:blog-8677649049588007585.post-3892186006982768052011-11-02T17:11:49.759+00:002011-11-02T17:11:49.759+00:00Hello Steven, All,
While strictly mathematically ...Hello Steven, All,<br /><br />While strictly mathematically this choice is correct, math is still superior to any computer :) :) and this is the (maybe only) positive message !<br /><br />Regarding the choice itself, its mere inclusion in the quiz somehow "did injustice" to those who<br />marked as correct the TABLE function choice and as incorrect this one, and may it be for whatever reasons that may extend from "bad practices" up to "performance" (that is,<br />to avoid several useless division operations)<br />or even the rounding problem described here, versus those who marked these two choices <br />the opposite way ...<br /><br />They scored the same, but the first ones were more correct versus the main topic of the quiz<br />and the "Quiz Lesson" and all the explanations given, that clearly favor the usage of the TABLE function.<br /><br />So, maybe we can think of a possibility to create "weighted choices", that is, to divide the total achievable points for a quiz not necessarily evenly among the different choices, but giving a higher weight to the recommendable (or best practice) choices.<br /><br />Just an idea that seems to "offer itself" as a better solution for several quizzes up to now,<br />maybe to be considered in the future.<br /><br />Thanks & Best Regards,<br />Iudith MentzelAnonymousnoreply@blogger.com