반응형

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

 Day 2-3: Compound Event Probability



여섯번째 문제! 

이번 문제는! 복합 이벤트 확률 게임'S

Objective 
In this challenge, we practice calculating the probability of a compound event. We recommend you review today's Probability Tutorial before attempting this challenge. 

Task 
There are  urns labeled , and 

  • Urn  contains  red balls and  black balls.
  • Urn  contains  red balls and  black balls.
  • Urn  contains  red balls and  black balls. 

One ball is drawn from each of the  urns. What is the probability that, of the  balls drawn,  are red and  is black?

1.  10 / 63
2.   2 / 7
3.   17 / 42
4.   31 / 126
You have 2 attempts left.



문제해석!

1. 항아리 3개(X,Y,Z)

2. X 항아리에 빨간공 4개, 검은공 3개

3. Y 항아리에 빨간공 5개, 검은공 4개

4. Z 항아리에 빨간공 4개, 검은공 4개

5. 각 항아리에서 하나씩 공을 뽑을때, 빨간공 2개, 검은공 1개가 나올 확율은?


풀이!

1. X항아리 에서 빨간공(4/7 확률), 검은공(3/7 확률)

2. Y항아리 에서 빨간공(5/9 확률), 검은공(4/9 확률)

3. Z항아리 에서 빨간공(4/8 확률), 검은공(4/8 확률)

4. 빨간공 2번 확률!(4/7+5/9+1/2)+(4/7+5/9+1/2)

5. 검은공 1번 확률!(3/7+4/9+1/2)

6. 다 더하기! -> 17/42





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


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



반응형

+ Recent posts