Dice Possibilities (retired)
Description:
Task:
Given two integer numbers, [s] is for [sides] of a dice, [c] is how many times getting the same number [continuously]
The number of possibilities for that is (1/[s])^[c]
You are going to return the number of possibilties, and to be more clear, let's see some examples:
dice_possibilities(6,2) => this means that there are 6 sides on a dice, and 2 times getting the same number continuously, so the number of possibilities for this is (1/6) * (1/6) or (1/6)^2. return 1/36
dice_possibilities(3,3) => this means that there are 8 sides on a dice, and 4 times getting the same number continuously, so the number of possibilities for this is (1/3) * (1/3) * (1/3) or (1/3)^3. return 1/27
dice_possibilities(0,3) => return False
dice_possibilities(2,0) => return False
Note:
If any of the [s] or [c] is 0, return False, since it's impossible to have 0 side on a dice or 0 times getting the same number continuously
[s] >= 0
[c] >= 0
Have Fun! ;)
Similar Kata:
Stats:
Created | Jun 1, 2021 |
Warriors Trained | 18 |
Total Skips | 0 |
Total Code Submissions | 33 |
Total Times Completed | 14 |
Python Completions | 14 |
Total Stars | 2 |
% of votes with a positive feedback rating | 13% of 12 |
Total "Very Satisfied" Votes | 1 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 10 |
Total Rank Assessments | 10 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |