Day 1: Basic Statistics - A Warmup
-
1gn1t 9 years ago The challenge indicates five lines to be output, however the grader only expects 4 (no confidence interval)
-
PRASHANTB1984 9 years ago Yes, thanks for pointing out - we removed that requirement. It's not needed.
-
aastha92 9 years ago It showed when I was solving, and I got a 0 score even though all my answers are correct.!
-
[deleted] 9 years ago Had the same issue. Not solved yet. Might I suggest checking (our) precision ?
-
-
-
-
oyearunpal 9 years ago test case #3 shows error, anyone know what is problem
-
logodska 9 years ago same here, while the test case passes the 'test run mode'
-
bob04 Asked to answer 9 years ago Unfortunately I don't know the contents of case#3 - if you can either get hold of the data (which you can normally do when you get it wrong) or provide a link to your code, I may be able to help.
-
logodska 9 years ago Thank you Bob. I'm not sure if there is allowed here to share code samples, however the problem isn't that complicated though.
For the test case #3 (the fourth one :-)) I just had to:
- get the mean value
- map the expression (x-m)^2 onto the elements of the provided array
- sum the result array
- divide the sum through array length
- get the square root of the result
- format the output
This algorythm passes the test run perfectly, but fails in the final submission, so I'm not sure where I'm wrong.
So I get 30466.9475274 (unformatted) for provided data:
10
64630 11735 14216 99233 14470 4978 73429 38120 51135 67060
... which is quite close to the expected output.
I'm sorry for this formatting :-)
-
bob04 9 years ago Thinking about it, since you may be coding in a language I do not know very well, seeing your code may not help. I solve most of the problems here by using JavaScript by the way. The problem here is we do not know which of the four values you got wrong in case#3. When you see the results, if you click on the test case that you got wrong, you should be able to get access to the data - that should help you see what your error is. I would think it is more likely to be a problem relating to the mode or median. For instance, if there is more than one mode, have you made sure your code always picks out the smallest value?
-
-
-
bob04 9 years ago In the past, when I have failed a test case, it has been possible to click on, or near, the red cross and have the option to view the input data for that test case. It may not be possible with this problem I don't know for certain.
-
-
-
-
coolrohan123 9 years ago my test case 4 is failing, dont know why.
-
cgira 9 years ago same for for me but I suspect the precision. Especially on the mode. For example, on testcase #1, when I print it as 4978.0 it testcase 1 fail but when I force it to be 4978 (using {0:.0f}), testcase #1 succeeds.
-
mfry 9 years ago I am not sure its the precision of the mode, or any precision is the issue. I double checked how my language performs rounding and found out it uses banker's rounding. I changed this to the standard round half up, but that did not fix problem #4.
-
nicocai 9 years ago I had problem with #4 before and I get it now: it can only be two probs: 1) you print the mode as float which actually can only be int; 2) when you have more than one mode you need to print the smallest one: like in 1 1 2 2 3 4 5, you need to print only 1.
-
-
vinays0116 9 years ago mode must be an integer not a double value. i dont think precision of mode is the issue here rather there must be something wrong in calculation of mode. did u verufy the code for all possible inputs?
-
coolrohan123 9 years ago Yes I did, the rest three cases are fine. Just the last one is failing
-
-
-
anil2381 9 years ago Mode: The element(s) that occur most frequently. If multiple elements satisfy this criteria, display the numerically smallest one.
-
-
panuphan1997 5 years ago who have problem case#3 because mode error , I recommend:
1) sorted data
2) use most_common in Counter instead of using mode in statistics.
Good Luck. โชคดีนะ
I hope it helps you.
Sort 19 Discussions, By:
Please Log In in order to post a comment