Day 1: Basic Statistics - A Warmup

Sort 19 Discussions, By:

Sorry, you do not have a permission to answer to this question.

  • 1gn1t 9 years ago + 1 comment

    The challenge indicates five lines to be output, however the grader only expects 4 (no confidence interval)

    Add Reply Preview cancel

    Sorry, you do not have a permission to answer to this question.

    • PRASHANTB1984 9 years ago + 1 comment

      Yes, thanks for pointing out - we removed that requirement. It's not needed.

      Add Reply Preview cancel

      Sorry, you do not have a permission to answer to this question.

      • aastha92 9 years ago + 1 comment

        It showed when I was solving, and I got a 0 score even though all my answers are correct.!

        Add Reply Preview cancel

        Sorry, you do not have a permission to answer to this question.

        • [deleted] 9 years ago + 0 comments

          Had the same issue. Not solved yet. Might I suggest checking (our) precision ?

          Add Reply Preview cancel

          Sorry, you do not have a permission to answer to this question.

    • oyearunpal 9 years ago + 2 comments

      test case #3 shows error, anyone know what is problem

      Add Reply Preview cancel

      Sorry, you do not have a permission to answer to this question.

      • logodska 9 years ago + 0 comments

        same here, while the test case passes the 'test run mode'

        Add Reply Preview cancel

        Sorry, you do not have a permission to answer to this question.

        • bob04 Asked to answer 9 years ago + 2 comments

          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.

          Add Reply Preview cancel

          Sorry, you do not have a permission to answer to this question.

          • logodska 9 years ago + 1 comment

            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 :-)

            Add Reply Preview cancel

            Sorry, you do not have a permission to answer to this question.

            • bob04 9 years ago + 0 comments

              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?

              Add Reply Preview cancel

              Sorry, you do not have a permission to answer to this question.

            • mfry 9 years ago + 1 comment

              @bob04 How can you get ahold of the data if you get the problem wrong?

              Add Reply Preview cancel

              Sorry, you do not have a permission to answer to this question.

              • bob04 9 years ago + 0 comments

                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.

                Add Reply Preview cancel

                Sorry, you do not have a permission to answer to this question.

          • cgira 9 years ago + 1 comment

            TestCase 4 failing. I suspect the precision on the mode. Any thought?

            Add Reply Preview cancel

            Sorry, you do not have a permission to answer to this question.

            • anil2381 9 years ago + 0 comments

              Something to do with Mode definition, May be.

              Add Reply Preview cancel

              Sorry, you do not have a permission to answer to this question.

            • coolrohan123 9 years ago + 2 comments

              my test case 4 is failing, dont know why.

              Add Reply Preview cancel

              Sorry, you do not have a permission to answer to this question.

              • cgira 9 years ago + 2 comments

                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.

                Add Reply Preview cancel

                Sorry, you do not have a permission to answer to this question.

                • mfry 9 years ago + 1 comment

                  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.

                  Add Reply Preview cancel

                  Sorry, you do not have a permission to answer to this question.

                  • nicocai 9 years ago + 0 comments

                    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.

                    Add Reply Preview cancel

                    Sorry, you do not have a permission to answer to this question.

                  • vinays0116 9 years ago + 1 comment

                    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?

                    Add Reply Preview cancel

                    Sorry, you do not have a permission to answer to this question.

                    • coolrohan123 9 years ago + 0 comments

                      Yes I did, the rest three cases are fine. Just the last one is failing

                      Add Reply Preview cancel

                      Sorry, you do not have a permission to answer to this question.

                  • anil2381 9 years ago + 0 comments

                    Mode: The element(s) that occur most frequently. If multiple elements satisfy this criteria, display the numerically smallest one.

                    Add Reply Preview cancel

                    Sorry, you do not have a permission to answer to this question.

                  • panuphan1997 5 years ago + 0 comments

                    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.

                    Add Reply Preview cancel

                    Sorry, you do not have a permission to answer to this question.

                    1. Challenge Walkthrough
                      Let's walk through this sample challenge and explore the features of the code editor.1 of 6
                    2. Review the problem statement
                      Each challenge has a problem statement that includes sample inputs and outputs. Some challenges include additional information to help you out.2 of 6
                    3. Choose a language
                      Select the language you wish to use to solve this challenge.3 of 6
                    4. Enter your code
                      Code your solution in our custom editor or code in your own environment and upload your solution as a file.4 of 6
                    5. Test your code
                      You can compile your code and test it for errors and accuracy before submitting.5 of 6
                    6. Submit to see results
                      When you're ready, submit your solution! Remember, you can go back and refine your code anytime.6 of 6
                    1. Check your score