๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ’ซ ์ˆ˜ํ•™

Day 2: Basic Probability

 HacckerRank Day2 Basic probability








Event(์‚ฌ๊ฑด)

A set of outcomes of an experiment.

์–ด๋– ํ•œ ํ•œ ์‹œํ–‰์—์„œ ์ผ์–ด๋‚  ์ˆ˜ ์žˆ๋Š” ๊ฒฐ๊ณผ.


Sample Space(ํ‘œ๋ณธ ๊ณต๊ฐ„)

An experiment is any procedure that can be infinitely repeated and has a well-defined set of possible outcomes, known as the sample space, S.

ํ•œ ๋ฒˆ์˜ ์‹œํ–‰์—์„œ ์ผ์–ด๋‚  ์ˆ˜ ์žˆ๋Š” ๋ชจ๋“  ๊ฒฐ๊ณผ์˜ ์ง‘ํ•ฉ.






Probability(ํ™•๋ฅ )
The probability of the occurrence of an event, A is:



 = ์›ํ•˜๋Š” ๊ฒฝ์šฐ์˜ ์ˆ˜ / ๋ชจ๋“  ๊ฒฝ์šฐ์˜ ์ˆ˜



Two fundamental rules of probability 

 0<= P(A) <= 1

 P(sample space S) = 1

it also means P(A)+P(A') = 1








Compound Events(๋ณตํ•ฉ์‚ฌ๊ฑด)

A compound event is a combination of 2 or more simple events.

๋ณตํ•ฉ ์‚ฌ๊ฑด์ด๋ž€ 2๊ฐ€์ง€ ์ด์ƒ์˜ ์‚ฌ๊ฑด์˜ ์กฐํ•ฉ.


If A and B are simple events,

 denotes the occurrence of either A or B (A ๋˜๋Š” B).

 denotes the occurrence of A and B together (A ๊ทธ๋ฆฌ๊ณ  B).






Mutually Exclusive Events(์ƒํ˜ธ๋ฐฐํƒ€์  ์‚ฌ๊ฑด)

A and B are said to be mutually exclusive or disjoint if they have no events in common.

A ์™€ B๊ฐ€ ์–ด๋– ํ•œ ๊ณตํ†ต๋œ ์‚ฌ๊ฑด์ด ์—†๋Š” ๊ฒฝ์šฐ ์ƒํ˜ธ ๋ฐฐํƒ€์  ๋˜๋Š” ๋ถ„๋ฆฌ๋˜์—ˆ๋‹ค๊ณ  ํ•œ๋‹ค.





The probability of 2 or more events occurring is

the union

of events.


Because disjoint probabilities have no common events, the probability of the union of disjoint events is the sum of the event's individual probabilities.

2๊ฐœ ์ด์ƒ์˜ ์ด๋ฒคํŠธ๊ฐ€ ๋ฐœ์ƒํ•  ํ™•๋ฅ ์€ ์‚ฌ๊ฑด๋“ค์˜ ํ•ฉ์ง‘ํ•ฉ์ด๋‹ค.

๋ฐฐํƒ€์  ์‚ฌ๊ฑด์—๋Š” ๊ณตํ†ต๋œ ์‚ฌ๊ฑด์ด ์—†์œผ๋ฏ€๋กœ ๋ฐฐํƒ€์  ์‚ฌ๊ฑด์˜ ํ•ฉ์ง‘ํ•ฉ ํ™•๋ฅ ์€ ์‚ฌ๊ฑด์˜ ๊ฐœ๋ณ„ ํ™•๋ฅ ์˜ ํ•ฉ์ด๋‹ค.






Collectively Exhaustive Events(์ „์ฒด ํฌ๊ด„์  ์‚ฌ๊ฑด)

A and B are said to be collectively exhaustive if their union covers all events in the sample space.

A์™€ B๊ฐ€ ํ‘œ๋ณธ ๊ณต๊ฐ„์˜ ๋ชจ๋“  ์‚ฌ๊ฑด์„ ๋‹ค๋ฃจ๋Š” ๊ฒฝ์šฐ ์ „์ฒด์ ์œผ๋กœ ํฌ๊ด„์ ์ด๋ผ๊ณ  ํ•œ๋‹ค.





If events, A and B, are disjoint, then the probability of either event is the sum of the probabilities of the 2 events.

๋‘ ์‚ฌ๊ฑด A์™€ B๊ฐ€ ๋ฐฐํƒ€์ ์ด๋ผ๋ฉด, ๋‘ ์‚ฌ๊ฑด์˜ ํ™•๋ฅ ์€ ๋‘ ์‚ฌ๊ฑด์˜ ํ™•๋ฅ ์˜ ํ•ฉ์ด๋‹ค.








Independent events(๋…๋ฆฝ์‚ฌ๊ฑด)

If the outcome of the first event(A) has no impact on the second event(B), then they are considered to be independent.

๋งŒ์•ฝ ์ฒซ๋ฒˆ์งธ ์‚ฌ๊ฑด A๊ฐ€ ๋‘๋ฒˆ์งธ ์‚ฌ๊ฑด B์— ์˜ํ–ฅ์„ ๋ฏธ์น˜์ง€ ์•Š๋Š”๋‹ค๋ฉด, ์ด๋“ค์€ ๋…๋ฆฝ์‚ฌ๊ฑด์ด๋‹ค.




If events, A and B, are independent, then the probability of both events is the product of the probabilities for each event.

์‚ฌ๊ฑด A์™€ B๊ฐ€ ๋…๋ฆฝ ์‚ฌ๊ฑด์ด๋ผ๋ฉด, ๋‘ ์‚ฌ๊ฑด์˜ ํ™•๋ฅ ์€ ๋‘ ์‚ฌ๊ฑด์˜ ๊ฐ ํ™•๋ฅ ์˜ ๊ณฑ์ด๋‹ค.



The chance of all events occurring in a sequence of events is called

the intersection

of those events.

์ผ๋ จ์˜ ์‹œ๊ฐ„ ์ˆœ์„œ ์ƒ์˜ ์‚ฌ๊ฑด๋“ค์—์„œ ๋ชจ๋“  ์‚ฌ๊ฑด ๋ฐœ์ƒ ๊ธฐํšŒ๋ฅผ ํ•ด๋‹น ์‚ฌ๊ฑด๋“ค์˜ ๊ต์ง‘ํ•ฉ์ด๋ผ๊ณ  ๋ถ€๋ฅธ๋‹ค.