5 kyu

Tracking Hits for Different Sum Values for Different Kinds of Dice

582 of 697raulbc777
Description
Loading description...
Mathematics
Statistics
Probability
Permutations
Data Science
View
AllIssues6Questions1Suggestions4Show Resolved
  • Please sign in or sign up to leave a comment.
  • tobeannouncd Avatar
  • arkhireyev Avatar

    Nice kata, but it lacks the tests with larger values, at least 20 dice of 20-sides.

  • silviluliuma Avatar

    Nice kata!! It has been real fun solving it.

  • MikhailD1711 Avatar

    This comment has been hidden.

  • avermakov Avatar

    Very nice kata, I have had a great time solving it!

    A suggestion: Could you please replace these two lines of text a single one? Since there is no assertion after the first line, the output is rendered red, as if something went wrong.

        test.it("number of dice = " + str(n))
        test.it("amount of sides = " + str(s))
    
  • elmofre Avatar

    Guys, help anyone who is not difficult. I don't understand the condition.What is asked to find in the task? At first I thought it was a possibility...I read it inattentively..

  • depial Avatar
  • ejini战神 Avatar

    Python initial solution setup should just be return []

  • ejini战神 Avatar

    Description should be language-agnostic

  • TarkinD Avatar

    very good kata ... but always timeout :( I really need to learn how to improve my code

  • FArekkusu Avatar

    Empty it blocks must be removed from tests.

  • ejini战神 Avatar
    • Node V 14. should be enabled

    • Python new test framework should be used (Refer this & this for more detail)

    • Ruby 3.0 should be enabled (Refer this & this for more detail)

  • Blind4Basics Avatar

    Hi Raul,

    Some typos in the description:

    • Suposse -> Suppose (start of 2nd §)
    • Suposse that we roll... dice 6> Suppose that we roll... dices (2 line after the previous)
    • probabilities for each ent has to be 1.0000 -> probabilities for each enD has to be 1.0000
    • number of dice, n -> number of diceS, n

    cheers

  • arias-ham Avatar

    Awesome Kata! Your other Kata helped me out, still new to coding. Thanks!

  • kazk Avatar

    I'm trying in Ruby and I believe some tests expect wrong values (6 tests 3 combinations: n=2, s=20; n=4, s=10; n=4, s=12). Can you check your code?

    # expects max 20 where 40 is possible
    Testing for amount of dice: 2, and each one with number of sides: 20
    ✘ Expected: [[2, 4], [3, 12], [4, 17], [5, 20], [6, 24], [7, 28], [8, 32], [9, 36], [10, 40], [11, 40], [12, 34], [13, 28], [14, 24], [15, 20], [16, 16], [17, 12], [18, 8], [19, 4], [20, 1]],
    instead got: [[2, 1], [3, 2], [4, 3], [5, 4], [6, 5], [7, 6], [8, 7], [9, 8], [10, 9], [11, 10], [12, 11], [13, 12], [14, 13], [15, 14], [16, 15], [17, 16], [18, 17], [19, 18], [20, 19], [21, 20], [22, 19], [23, 18], [24, 17], [25, 16], [26, 15], [27, 14], [28, 13], [29, 12], [30, 11], [31, 10], [32, 9], [33, 8], [34, 7], [35, 6], [36, 5], [37, 4], [38, 3], [39, 2], [40, 1]]
    # 3 times
    
    Testing for amount of dice: 4, and each one with number of sides: 10
    ✘ Expected: [[4, 16], [5, 32], [6, 56], [7, 88], [8, 129], [9, 180], [10, 242], [11, 316], [12, 403], [13, 472], [14, 540], [15, 600], [16, 649], [17, 684], [18, 702], [19, 700], [20, 675], [21, 624], [22, 568], [23, 504], [24, 435], [25, 364], [26, 294], [27, 228], [28, 169], [29, 120], [30, 84], [31, 56], [32, 35], [33, 20], [34, 10], [35, 4], [36, 1]],
    instead got: [[4, 1], [5, 4], [6, 10], [7, 20], [8, 35], [9, 56], [10, 84], [11, 120], [12, 165], [13, 220], [14, 282], [15, 348], [16, 415], [17, 480], [18, 540], [19, 592], [20, 633], [21, 660], [22, 670], [23, 660], [24, 633], [25, 592], [26, 540], [27, 480], [28, 415], [29, 348], [30, 282], [31, 220], [32, 165], [33, 120], [34, 84], [35, 56], [36, 35], [37, 20], [38, 10], [39, 4], [40, 1]]
    # 2 times
    
    Testing for amount of dice: 4, and each one with number of sides: 12
    ✘ Expected: [[4, 16], [5, 64], [6, 160], [7, 288], [8, 432], [9, 576], [10, 728], [11, 896], [12, 1088], [13, 1272], [14, 1416], [15, 1488], [16, 1505], [17, 1484], [18, 1442], [19, 1372], [20, 1267], [21, 1120], [22, 952], [23, 784], [24, 637], [25, 508], [26, 394], [27, 292], [28, 205], [29, 136], [30, 88], [31, 56], [32, 35], [33, 20], [34, 10], [35, 4], [36, 1]],
    instead got: [[4, 1], [5, 4], [6, 10], [7, 20], [8, 35], [9, 56], [10, 84], [11, 120], [12, 165], [13, 220], [14, 286], [15, 364], [16, 451], [17, 544], [18, 640], [19, 736], [20, 829], [21, 916], [22, 994], [23, 1060], [24, 1111], [25, 1144], [26, 1156], [27, 1144], [28, 1111], [29, 1060], [30, 994], [31, 916], [32, 829], [33, 736], [34, 640], [35, 544], [36, 451], [37, 364], [38, 286], [39, 220], [40, 165], [41, 120], [42, 84], [43, 56], [44, 35], [45, 20], [46, 10], [47, 4], [48, 1]]