반응형

코딩놀이! 10 Days of Statistics(HackerRank)

 Day 2-2: More Dice



다섯번째 문제!

Objective 
In this challenge, we practice calculating probability. We recommend you review the previous challenge's Tutorial before attempting this problem. 

Task 
In a single toss of  fair (evenly-weighted) six-sided dice, find the probability that the values rolled by each die will be different and the two dice have a sum of .

1.  1 / 9
4.   1 / 6
3.   2 / 3
5.   5 / 6
You have 1 attempts left.


2일차의 문제는 기본적인 수학 문제 입니당.


네번째 문제와 비슷 하네요 ㅎㅎ 아니 똑..같네요?ㅎ


문제해석!

1. 두개의 6면 주사위가 있습니다.

2. 주사위를 던졌을때 합이 6인 확률.


풀이!

1. 주사위 2개의 나올수 있는 모든 경우의 수는 6*6 = 36 개의 경우에수 존재!

2. 36개중 합이 6인 경우의 수는?? -> 5개 , but 같은수(3,3)은 제외! 하면 -> 4개!

(1,1)(1,2)(1,3)(1,4)(1,5)(1,6) 
(2,1)(2,2)(2,3)(2,4)(2,5)(2,6)
(3,1)(3,2)(3,3)(3,4)(3,5)(3,6)
(4,1)(4,2)(4,3)(4,4)(4,5)(4,6)
(5,1)(5,2)(5,3)(5,4)(5,5)(5,6)
(6,1)(6,2)(6,3)(6,4)(6,5)(6,6)

3. 확률 = 4/36은 모든 경우의 수

4. 1/9이 답이겠네요 .





2,3일차 문제는 대부분 이런 문제입니다. 짧게 짧게 skip!~할게요


(출처:https://www.hackerrank.com/challenges/s10-mcq-2/problem)

반응형

+ Recent posts