Beta

Histograms For All The World

Description
Loading description...
Algorithms
Mathematics
Statistics
Data Science
Performance
  • Please sign in or sign up to leave a comment.
  • Sidaoui-Bilel Avatar

    The last interval isn't clear how to get. if the idea is to get the upper - 1, this doesn't work for all the cases. I don't know how you get the last interval

  • dfhwze Avatar

    I have no clue how these intervals work. I guessed how to handle 99 and 100 as upper limit. I can't approve this kata in its current form. But then again, this kata has been in beta for 10 years, so you probably don't care anymore ;)

  • TimoNotThy Avatar

    add links (to wikipedia) in the description for things like Sturges' rule

  • ejini战神 Avatar

    This issue is still not fixed!

    Number of elements = 30000
    
    [[1, [2, 8], 759, 759], [2, [9, 15], 1349, 2108], [3, [16, 22], 1462, 3570], [4, [23, 29], 1520, 5090], [5, [30, 36], 1897, 6987], [6, [37, 43], 2188, 9175], [7, [44, 50], 2422, 11597], [8, [51, 57], 2837, 14434], [9, [58, 64], 2853, 17287], [10, [65, 71], 2827, 20114], [11, [72, 78], 2909, 23023], [12, [79, 85], 2798, 25821], [13, [86, 92], 2407, 28228], [14, [93, 99], 1703, 29931], [15, [100, 100], 69, 30000]]
    should equal
    [[1, [2, 8], 759, 759], [2, [9, 15], 1349, 2108], [3, [16, 22], 1462, 3570], [4, [23, 29], 1520, 5090], [5, [30, 36], 1897, 6987], [6, [37, 43], 2188, 9175], [7, [44, 50], 2422, 11597], [8, [51, 57], 2837, 14434], [9, [58, 64], 2853, 17287], [10, [65, 71], 2827, 20114], [11, [72, 78], 2909, 23023], [12, [79, 85], 2798, 25821], [13, [86, 92], 2407, 28228], [14, [93, 99], 1703, 29931], [15, [100, 106], 69, 30000], [16, [107, 100], 0, 30000]]
    
  • Voile Avatar

    Python 3 should be enabled ;-)

  • Voile Avatar

    The issue below is not resolved yet:

    Number of elements = 30000
    
    [[1, [2, 8], 759, 759], [2, [9, 15], 1349, 2108], [3, [16, 22], 1462, 3570], [4, [23, 29], 1520, 5090], [5, [30, 36], 1897, 6987], [6, [37, 43], 2188, 9175], [7, [44, 50], 2422, 11597], [8, [51, 57], 2837, 14434], [9, [58, 64], 2853, 17287], [10, [65, 71], 2827, 20114], [11, [72, 78], 2909, 23023], [12, [79, 85], 2798, 25821], [13, [86, 92], 2407, 28228], [14, [93, 99], 1703, 29931], [15, [100, 100], 69, 30000]]
    should equal
    [[1, [2, 8], 759, 759], [2, [9, 15], 1349, 2108], [3, [16, 22], 1462, 3570], [4, [23, 29], 1520, 5090], [5, [30, 36], 1897, 6987], [6, [37, 43], 2188, 9175], [7, [44, 50], 2422, 11597], [8, [51, 57], 2837, 14434], [9, [58, 64], 2853, 17287], [10, [65, 71], 2827, 20114], [11, [72, 78], 2909, 23023], [12, [79, 85], 2798, 25821], [13, [86, 92], 2407, 28228], [14, [93, 99], 1703, 29931], [15, [100, 106], 69, 30000], [16, [107, 100], 0, 30000]]
    
  • Voile Avatar

    k = 1 + 3.32 * log (n)

    Log base is not specified. Apparently it's base 10 and not natural log, which is not what typical log means and so it should be clarified.

  • Voile Avatar

    Sample test is missing a closing parenthesis at the end.

  • ChristianECooper Avatar

    I think I'm right in thinking that the upper bound on the final interval should be "lowest value + intervals * amplitude", and yet I'm seeing odd errors relating to the final interval's upper bound being out by a small amount when the tests are run.

  • CrazyMerlyn Avatar

    Getting this error on random tests.

    Number of elements = 100
    Students Results = [29, 77, 97, 73, 62, 28, 58, 86, 47, 67, 29, 85, 73, 55, 11, 43, 19, 63, 43, 20, 92, 57, 73, 56, 11, 90, 57, 89, 87, 80, 17, 26, 19, 85, 88, 38, 98, 93, 86, 94, 34, 24, 34, 17, 80, 78, 58, 55, 78, 39, 35, 35, 80, 65, 22, 36, 86, 65, 70, 15, 64, 63, 98, 84, 43, 47, 83, 11, 97, 36, 68, 7, 72, 27, 87, 54, 76, 70, 13, 63, 8, 54, 24, 79, 50, 44, 63, 97, 41, 98, 67, 49, 49, 67, 59, 88, 97, 87, 2, 62]
    [[1, [2, 13], 7, 7], [2, [14, 25], 9, 16], [3, [26, 37], 11, 27], [4, [38, 49], 11, 38], [5, [50, 61], 11, 49], [6, [62, 73], 19, 68], [7, [74, 85], 12, 80], [8, [86, 98], 20, 100]] should equal [[1, [2, 13], 7, 7], [2, [14, 25], 9, 16], [3, [26, 37], 11, 27], [4, [38, 49], 11, 38], [5, [50, 61], 11, 49], [6, [62, 73], 19, 68], [7, [74, 85], 12, 80], [8, [86, 98], 17, 97]]
    

    I believe my solution is correct because the cumulative frequency expected is wrong (97 instead of 100). Could you look into it? Probably some floating point error somewhere.

    • raulbc777 Avatar

      I' ll check it. If we have 100 elements the cumulative frequency should be 100. Right!

    • raulbc777 Avatar

      It's easy to see what happened. The upper bound of the last class can't be less than the max value of the variable. I'll correct this bug

    • raulbc777 Avatar

      Thanks a lot for your observation. It should be solved this part. I'll be waiting your answer.

    • CrazyMerlyn Avatar

      There is another problem. Look at this.

      Number of elements = 30000
      [[1, [2, 8], 747, 747], [2, [9, 15], 1371, 2118], [3, [16, 22], 1439, 3557], [4, [23, 29], 1439, 4996], [5, [30, 36], 1909, 6905], [6, [37, 43], 2261, 9166], [7, [44, 50], 2505, 11671], [8, [51, 57], 2796, 14467], [9, [58, 64], 2822, 17289], [10, [65, 71], 2866, 20155], [11, [72, 78], 2857, 23012], [12, [79, 85], 2880, 25892], [13, [86, 92], 2370, 28262], [14, [93, 99], 1676, 29938], [15, [100, 100], 62, 30000], [16, [107, 100], 0, 30000]] should equal [[1, [2, 8], 747, 747], [2, [9, 15], 1371, 2118], [3, [16, 22], 1439, 3557], [4, [23, 29], 1439, 4996], [5, [30, 36], 1909, 6905], [6, [37, 43], 2261, 9166], [7, [44, 50], 2505, 11671], [8, [51, 57], 2796, 14467], [9, [58, 64], 2822, 17289], [10, [65, 71], 2866, 20155], [11, [72, 78], 2857, 23012], [12, [79, 85], 2880, 25892], [13, [86, 92], 2370, 28262], [14, [93, 99], 1676, 29938], [15, [100, 106], 62, 30000], [16, [107, 100], 0, 30000]]
      

      Note only the last interval is wrong (107, 100) the second last (100, 106) is also wrong. What is the correct value to be returned in cases where the last two intervals are greater than 100?

    • raulbc777 Avatar

      The problem is at the end. I'll solve this.