Created
December 7, 2018 15:40
-
-
Save scilganon/872756eb5271c25e2783c663d98c008e to your computer and use it in GitHub Desktop.
Бросают два кубика. С какой вероятностью сумма чисел на них будет больше или равна 8?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let dataSet = new Set(); | |
for(let i=1; i<=6; i++){ | |
for(let j=1; j<=6; j++){ | |
if(i+j>=8){ | |
dataSet.add([i,j]); | |
} | |
} | |
} | |
console.log(`Size: ${dataSet.size}`); | |
dataSet.forEach(([i, j]) => console.log(`i(${i})/j(${j})`)); | |
// 15(dataSet.size) / 36 (6 * 6 sides) = 0.42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment