Blog Day 21: Combinations with Repetition, Event Object, Validation

Inseo Park·2021년 7월 28일
0

Path to Data Scientist

목록 보기
20/58
post-thumbnail

1. TIL (Today I learned)

Combinations with Repetition

Definition: The number of different possible ways we can pick a number elements for combinations with repetition we use a different formula.

	c(n, p) = (n + p - 1)! / (n - 1)!p!
    

We use combinations with repetition when the events we are dealing with have sufficient quantity if each of the distinct values in the sample space.

ex1. Toppings on pizza

  • we can order any given topping, so repetition is allowed. however, we do not care about the order so we cannot use variations formula.

ex2. Picking BaskinRobbin's icecream flavour or the players for the EPL 11.

Example:

  • You are ordering a 3-topping pizza from your pizza shop but they only have 6 toppings left.
    toppings = [cheddar cheese, onions, green peppers, mushrooms, pepperoni, bacon]

You can have 3 same topping, 3 different toppings, or double of one topping and another topping.

Use 0s and 1s to show what toppings you want (6 zeroes & 3 ones)

A pizza with cheese & extra pepperoni:

	C     O     G     M     P     B
       1,0    0     0     0    1,1,0  0
       

Only the first 8 elements can take a value of 1
The number of different pizzas would be the combination of any 3 of the 8 positions.

Therefore, the number of pizzas we can get would the number of combinations of picking 3 elements out of a set of 8.

	C(6, 3)"combinations with repetition" = C(8, 3)"combinations without repetition"
    

3 represents the amount of toppings we need to pick = p
8 represents the number of positions we have for the ones
6 + 3 = 9 positions but the last element is always a 0

which makes (n + p - 1)

2. 3 Things to be Thankful for

  1. I thank God for making me humble and just rely on you deeply.
  2. Thank God I endured throughout the day even when it was not so easy.
  3. Thank God for reminding me about my vulnerability.

3. Ideas and Things to think about

  • Don't put your life into codestates, it is not a must-do thing. It is just a challenge just like a business start-up, people fail badly and lose more money than if you fail. Just take it easy and enjoy the ride.
  • Always remind yourself that till now, God lead you through a great journey because you are His son. Just keep the faith there and do not fall into worldy stuffs.
profile
my journey to become a data scientist.

0개의 댓글