These examples are so mind blowing if you think about them in depth… I’ve realized the axiom of choice, degrees of freedom, Euler’s number… just from these examples in the first three lectures. I never thought I would understand those concepts in my life… Really incredible teaching
At 01:8:41, Can this be solved like this also, ((n k)-(n-1 k))/(n k). This is because (n k) - (n-1 k) will give you all events where defective choice will be present, where (n-1 k) is the selecting k chips from (n-1) non-defective chips and (n k) is the total sample space
As what happened to many videos, photographers always like to pay too much attention to professors' face, instead of the slides. The slides contains a lot of stuffs that deserve thinking and time. It's a course, NOT a movie... Thanks so much for sharing the excellent course!
It is a freely available class dude. All the math/code is being discussed in real time - so if you want static math slides - why don't you just open up a textbook, eh?
it's funny when the prof. at 1:08:59 says "And guess what 1 choose 1 is?" Everyone says 1. And when he says "And guess what 1 multiplied by anything is?", some people said 1. 😂
One question in Cow and Pig problem. Regardless you are going to pick 3 toys which means you have 2^3 combinations ccc ccp cpc cpp pcc pcp ppc ppp so if I want 1 cow and 2 pigs there is 3 combination cpp,pcp and ppc Which will give us 3/8
when you drawn the first item and, say, it is a Cow - the probability of drawing a Cow as a next item has reducedc since there are less Cows left. In your setting you are assuming, that the probability doesn’t chanage over drawings
I have a question: I tried solving the pigs and cows problem like this: The probability that if you choose 3 toys randomly out of the bag and they end up being 2 cows and 1 pig are: (4 % 7) * (3 % 6) * (3 % 5) = 0.17 I used the step rule of counting I assumed that this is an unordered indistinct set of toys and that the toys that are taken out aren't being returned to the box. But you used a much different method and in your calculations the likelihood was way higher. Is it because you made a different assumption?
this is because you are considering an outcome where you drawn exactly Cow as 1st item, then exactly Cow as 2nd item, and then exactly Pig as 3rd item. I know that „ordered” or „unordered” approach naming provides some mess, but the thing is that „ordered approach” means that you are considering all the ordered outcomes during resolving the problem (with OR operator). So basically the approach suggestes that you account order1, order2, order3, … so eventually when you accounted all orders, than means that order doesn’t metter anymore. So in the task the question is: what is the probability of drawing 2 cows and 1 pig, no metter what was drawn after what. And your solution suggests that it does metter what the sequence is
Problem : Pigs and Cow: Q: why event space become equily likely if we take every cows and pigs as distinct ? Ans : Lets take indistinct, P(2 cow, 1 pigs) = 4/7*3/7*3/7 if we take in this order and P(3 cow) = 4/7*3/7*2/7. it seems probability is not same for these two outcomes, so not equily likely. but if we take distinct, P(C1,C2,P1) = 1/7*1/6*1/5 and P(C1,C2,C3) = 1/7*1/6*1/5. for all outcomes probability will be 1/7*1/6*1/5. Hence Equily Likely.
@@noomade P(2 cows, 1pig) = 4/7*3/7*3/7 because for indistinct case every cow is same and every pig is same. so probability of getting cow would be (# of cows)/(# of cows and pigs), after this is step rule. For distinct where every cow is distinct, the probability of getting only Cow1 would be 1/total as there only 1 unique C1 cow.
forgot it was poker not capsa (im from asia) , was confused on why the starting for straight is only 10 possible ways , turns out you can’t start with Jacks queen kings 😅
With regard to the straight cards example: I think explaining the 10 with choosing the lowest value is incorrect, because the possible permutations are not equally likely, i.e. it is much more likely to get a straight starting with a 6 than it is to get a straight starting with a 2. Explaining it using the largest value, on the other hand, solves this issue. Thanks for sharing these lectures!
Does that matter? Even if you pick the middle one first, don't the rest of the 4 cards fall into place as stated? I believe choosing the lowest value was mentioned to make the understanding a bit easier. also in the set of possible lowest values, he included {Ace,2,3,4,5,6,7,8,9,10} which means all the lowest possible values are considered. Also why would it be more likely to get a straight starting with 6 than 2?
@@monemahmed6830 But wouldn't a suit starting with 10 and with 6 be the same. Cuz they are getting filled with the same values. 10 with 9 8 7 6 and 6 with 7 8 9 10. He did say lowest value. If we only have 6 options then it would make sense. Then the probability would become 6 * 4*4*4*4*4 / 52 choose 5.
@@person1420 i think you understood correctly. But a slight correction: there are 13 cards actually. so 10 straight would be {A, 2, 3,4, 5} {2,3,4,5,6} . . {10, J, Q,K,A} There is no card with value 1. A plays kind of double role, If I am not wrong.
I got the right answer using the Unordered Indistinct case. 4 Outcome: all cows, all pigs, 1 cow 2 pigs, 2 cow 1 pig. How many ways to get: all cows -- 4 choose 3 ways = 4 ways [Cuz there are 4 cows and we are choosing 3 out of them] all pigs -- 3 choose 3 ways = 1 way [Cuz choosing 3 pigs out of 3 pigs] 1 cow 2 pigs -- 4 choose 1 and 3 choose 2 = 4*3 = 12 [cuz 1 cow out of 4, and 2 pigs out of 3] 1pig 2 cows -- 3 choose 1 and 4 choose 2 = 3*6 = 18 Total outcomes = 35 ways of getting 1 cow 2 pigs = 12 So probability of getting 1 cow 2 pigs is 12/35
this is actually a distinct way: when you say „4 ways to choose 3 cows out of 4” - automatically mens that you actually care if you have chosen „cow1, cow2, cow3” or „cow2, cow3, cow4”. If it was an indistinct approach, there would have been only 1 way to choose 3 cows out of 4: „cow, cow, cow” - because all the cows are the same and it doesn’t metter which is where. Indistinct approach implies that P(ccc) = P(ccp) = P(cpp) = P(ppp) = 1/4 which is not true. So word „indistinct” doesn’t concern the distinction within the outcome. It’s all about the distinction in the Sample Space
@@Lee-zo3dy There are other great resources...try CS70 (Berkeley discrete math which includes some probability) and Washington CSE312 with has handouts/solutions, slides (for current and past semesters)
These examples are so mind blowing if you think about them in depth… I’ve realized the axiom of choice, degrees of freedom, Euler’s number… just from these examples in the first three lectures. I never thought I would understand those concepts in my life… Really incredible teaching
5:50 counting revision
17:13 probability
Oh how I wish I was part of this class and among these people with a teacher like that
36:15 there are actually 21 possible outcomes, not 20. You can even count the number of outcomes on the slide manually
At 01:8:41, Can this be solved like this also, ((n k)-(n-1 k))/(n k). This is because (n k) - (n-1 k) will give you all events where defective choice will be present, where (n-1 k) is the selecting k chips from (n-1) non-defective chips and (n k) is the total sample space
As what happened to many videos, photographers always like to pay too much attention to professors' face, instead of the slides. The slides contains a lot of stuffs that deserve thinking and time. It's a course, NOT a movie...
Thanks so much for sharing the excellent course!
It is a freely available class dude. All the math/code is being discussed in real time - so if you want static math slides - why don't you just open up a textbook, eh?
Slides and problem sets are available here: web.stanford.edu/class/archive/cs/cs109/cs109.1232/
@@stanfordonline It seems like i'll need to be a student to access the psets? Really curious to have a go at them if possible!
@@Justjemming same here
@@stanfordonline Its not available publicly, can you please make them available to public, it would be of really great help !!
it's funny when the prof. at 1:08:59 says "And guess what 1 choose 1 is?" Everyone says 1. And when he says "And guess what 1 multiplied by anything is?", some people said 1. 😂
One question in Cow and Pig problem. Regardless you are going to pick 3 toys which means you have 2^3 combinations
ccc
ccp
cpc
cpp
pcc
pcp
ppc
ppp
so if I want 1 cow and 2 pigs there is 3 combination cpp,pcp and ppc Which will give us 3/8
when you drawn the first item and, say, it is a Cow - the probability of drawing a Cow as a next item has reducedc since there are less Cows left. In your setting you are assuming, that the probability doesn’t chanage over drawings
I have a question:
I tried solving the pigs and cows problem like this:
The probability that if you choose 3 toys randomly out of the bag and they end up being 2 cows and 1 pig are:
(4 % 7) * (3 % 6) * (3 % 5) = 0.17
I used the step rule of counting I assumed that this is an unordered indistinct set of toys and that the toys that are taken out aren't being returned to the box. But you used a much different method and in your calculations the likelihood was way higher. Is it because you made a different assumption?
this is because you are considering an outcome where you drawn exactly Cow as 1st item, then exactly Cow as 2nd item, and then exactly Pig as 3rd item. I know that „ordered” or „unordered” approach naming provides some mess, but the thing is that „ordered approach” means that you are considering all the ordered outcomes during resolving the problem (with OR operator). So basically the approach suggestes that you account order1, order2, order3, … so eventually when you accounted all orders, than means that order doesn’t metter anymore.
So in the task the question is: what is the probability of drawing 2 cows and 1 pig, no metter what was drawn after what. And your solution suggests that it does metter what the sequence is
Problem : Pigs and Cow:
Q: why event space become equily likely if we take every cows and pigs as distinct ?
Ans : Lets take indistinct, P(2 cow, 1 pigs) = 4/7*3/7*3/7 if we take in this order and P(3 cow) = 4/7*3/7*2/7.
it seems probability is not same for these two outcomes, so not equily likely.
but if we take distinct, P(C1,C2,P1) = 1/7*1/6*1/5 and P(C1,C2,C3) = 1/7*1/6*1/5.
for all outcomes probability will be 1/7*1/6*1/5. Hence Equily Likely.
@@noomade P(2 cows, 1pig) = 4/7*3/7*3/7 because for indistinct case every cow is same and every pig is same. so probability of getting cow would be (# of cows)/(# of cows and pigs), after this is step rule. For distinct where every cow is distinct, the probability of getting only Cow1 would be 1/total as there only 1 unique C1 cow.
forgot it was poker not capsa (im from asia) , was confused on why the starting for straight is only 10 possible ways , turns out you can’t start with Jacks queen kings 😅
that's true. But I think it is the ideas that matter, not the actual result.
With regard to the straight cards example: I think explaining the 10 with choosing the lowest value is incorrect, because the possible permutations are not equally likely, i.e. it is much more likely to get a straight starting with a 6 than it is to get a straight starting with a 2. Explaining it using the largest value, on the other hand, solves this issue. Thanks for sharing these lectures!
Does that matter? Even if you pick the middle one first, don't the rest of the 4 cards fall into place as stated? I believe choosing the lowest value was mentioned to make the understanding a bit easier.
also in the set of possible lowest values, he included {Ace,2,3,4,5,6,7,8,9,10} which means all the lowest possible values are considered.
Also why would it be more likely to get a straight starting with 6 than 2?
@@monemahmed6830 But wouldn't a suit starting with 10 and with 6 be the same. Cuz they are getting filled with the same values. 10 with 9 8 7 6 and 6 with 7 8 9 10.
He did say lowest value.
If we only have 6 options then it would make sense.
Then the probability would become 6 * 4*4*4*4*4 / 52 choose 5.
@@person1420 No a flush starting with 10 would be: 10, j, q, K, A I believe. So 10 is the lowest here.
@@monemahmed6830 Okay I got it. Cuz there are 14 Options {A, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K}
@@person1420 i think you understood correctly. But a slight correction: there are 13 cards actually.
so 10 straight would be
{A, 2, 3,4, 5}
{2,3,4,5,6}
.
.
{10, J, Q,K,A}
There is no card with value 1. A plays kind of double role, If I am not wrong.
why not use the measure theory to explain the probability theory? it would be a scientific explanation more natural
👏👏👏👏👏👏
I got the right answer using the Unordered Indistinct case.
4 Outcome: all cows, all pigs, 1 cow 2 pigs, 2 cow 1 pig.
How many ways to get:
all cows -- 4 choose 3 ways = 4 ways [Cuz there are 4 cows and we are choosing 3 out of them]
all pigs -- 3 choose 3 ways = 1 way [Cuz choosing 3 pigs out of 3 pigs]
1 cow 2 pigs -- 4 choose 1 and 3 choose 2 = 4*3 = 12 [cuz 1 cow out of 4, and 2 pigs out of 3]
1pig 2 cows -- 3 choose 1 and 4 choose 2 = 3*6 = 18
Total outcomes = 35
ways of getting 1 cow 2 pigs = 12
So probability of getting 1 cow 2 pigs is
12/35
this is actually a distinct way:
when you say „4 ways to choose 3 cows out of 4” - automatically mens that you actually care if you have chosen „cow1, cow2, cow3” or „cow2, cow3, cow4”. If it was an indistinct approach, there would have been only 1 way to choose 3 cows out of 4: „cow, cow, cow” - because all the cows are the same and it doesn’t metter which is where.
Indistinct approach implies that P(ccc) = P(ccp) = P(cpp) = P(ppp) = 1/4 which is not true. So word „indistinct” doesn’t concern the distinction within the outcome. It’s all about the distinction in the Sample Space
Anyone tempted to pay 7 grand for this course? 💀
250 bucks /session☠💀
No
@@Saleh1ebr 💀💀
seems problem sets are not open?
Google Stanford cs109 2021. The summer link has psets and solutions
You're a hero.@@steve6012
@@steve6012 Just a heads up: The website has practice questions and solutions as well as psets, but no solutions for the psets
@@steve6012 bro save my life! But it seems like it is not lectured by professor piech? And the content seems a little bit different
@@Lee-zo3dy There are other great resources...try CS70 (Berkeley discrete math which includes some probability) and Washington CSE312 with has handouts/solutions, slides (for current and past semesters)