|
On June 23 2017 05:42 esla_sol wrote: i teach elementary school and we do probability. things like dice and spinners. basic stuff. was talking to a friend about probability and he gave me this problem. i've been unable to make sense of it. any help is appreciated.
You and I are playing a game. We each shout out a number 1-100 every 5 seconds. Once someone says a number, that person can't say it again. What's the probability we match at least once? The probablity of matching at least once equals 1 minus the probablity of never matching so the answer to your question is:
1-!100/100! which approximately equals 63 percent.
I can explain what dearangement is all about tomorrow if you're interested but for now I need to go to bed
|
On June 23 2017 06:24 travis wrote: yeah I think it is can I ask how you got it? Sure I can try to explain my process in my broken english tomorrow but i need to get up in 8 hours and i really need a lot of sleep not to be a zombie
|
probability can be so counter-intuitive sometimes, it's really crazy.
|
28057 Posts
Had to take three stats courses to get my degree and I still have no idea what I'm doing when it comes to probability. Just keep guessing until I get the answer
|
On June 23 2017 04:15 travis wrote: Here's a math question I have.
i want to write a sum:
from i=1 to n of: 1/2*(i-1)i
But I don't actually want i to stop when i = n. I want i to stop when the sum of "i values" has reached n. How do I do that?
It's like if I could write my sum as "from i = i +1 to n"
Example:
If n = 10 I want my sum to go through i values of: 1, 2, 3, 4 - then STOP. Which gives me a sum of 0+1+3+6 = 10
Is the only way to do this to solve for the relationship between what I want i to do, and n? Because I am not sure what the relationship is.
You can write basically anything below the sum symbol as a condition, but usually you use these conditions to only describe individual elements of the sum, not the sum as a whole.
I would write it as the Minimum of { (your sum from 0 to n) | n € N, (your sum) > n0}, with n0 being the thing you want. That works as long as all of the things in the sum after this are positive. If you have a sum that has negative elements afterwards, it becomes more complicated, because the minimum could be later down the line.
|
The probablity of matching at least once equals 1 minus the probablity of never matching so the answer to your question is:
1-!100/100! which approximately equals 63 percent.
I can explain what dearangement is all about tomorrow if you're interested but for now I need to go to bed
that's amazing. i had to look up what the factorial in the front meant. is the reason you divide by 100! because you have 1/100 chance, then 1/99, and so on?
|
So I have a bit of a problem I've worked on in the past, but my math is too lacking to solve it. The problem is as follows: with a standard deck of cards (52; 26 black, 26 red), what is the probability that one of colors is found 5 times or more (so at least 5 times) in a row when the deck is shuffled and put in a sequence (so random sequence of 52 cards)? I've made a small piece of code that can easily make over 1x10^6 runs to come to just under 80% and I know it's a combinatorial problem, but I have no idea how to formally solve it. Nor does the probability seem consistent because it fluctuates depending on the type of code used (different people, different code, or either my code sucks, but I've tested it thoroughly, so that shouldn't be it...)
|
On June 23 2017 11:21 Uldridge wrote: So I have a bit of a problem I've worked on in the past, but my math is too lacking to solve it. The problem is as follows: with a standard deck of cards (52; 26 black, 26 red), what is the probability that one of colors is found 5 times or more (so at least 5 times) in a row when the deck is shuffled and put in a sequence (so random sequence of 52 cards)? I've made a small piece of code that can easily make over 1x10^6 runs to come to just under 80% and I know it's a combinatorial problem, but I have no idea how to formally solve it. Nor does the probability seem consistent because it fluctuates depending on the type of code used (different people, different code, or either my code sucks, but I've tested it thoroughly, so that shouldn't be it...)
Isnt that just b = number of black cards left when drawing the first black card, c = total number of cards left in the deck b/c * b-1/c * b-2/c * b-3/c * b-4/c The -1/2/3/4 comes from one black card already being drawn and therefore the chance to draw antother black card decreases by 1/c
EDIT: So basically, the chance to draw a black card is always (black cards left) / (total number of cards left), and for the chance to draw multiple black caards in a row it is (chance for card 1) * (chance for card 2) ... * (chance for card n).
|
On June 23 2017 15:51 Artesimo wrote:Show nested quote +On June 23 2017 11:21 Uldridge wrote: So I have a bit of a problem I've worked on in the past, but my math is too lacking to solve it. The problem is as follows: with a standard deck of cards (52; 26 black, 26 red), what is the probability that one of colors is found 5 times or more (so at least 5 times) in a row when the deck is shuffled and put in a sequence (so random sequence of 52 cards)? I've made a small piece of code that can easily make over 1x10^6 runs to come to just under 80% and I know it's a combinatorial problem, but I have no idea how to formally solve it. Nor does the probability seem consistent because it fluctuates depending on the type of code used (different people, different code, or either my code sucks, but I've tested it thoroughly, so that shouldn't be it...) Isnt that just b = number of black cards, c = cards b/c * b-1/c * b-2/c * b-3/c * b-4/c The -1/2/3/4 comes from one black card already being drawn and therefore the chance to draw antother black card decreases by 1/c I think he's asking the probability of a sequence of 5 black cards appearing anywhere in the stack. I have calculated this in sequences with replacement. Without replacement it's harder and I'm not sure you can use the same approach at all, but with replacement it works as follows:
The chance of having 5 black cards in a row of simply 1/2^5. So with 52 cards, you have 52-5+1=48 different sequences of having 5 cards. So the chance of one or more of these being all black is simply 1 minus the chance of none of them being all black:
1 - (1- 1/2^5)^48. So with replacement, you'd have ~78% chance of getting a 5-card sequence of all-black cards. Without replacement the problem seems much harder, but perhaps this gives you an idea of how to approach it?
Edit: hmm, with replacement you should just be able to enumerate all the ways of getting a flush, right? I am missing something here, but a first stab: There are 47 cards left after your flush, so that's 47! possible orders. 48 places for starting your flush, so 48! combinations... and 26 choose 5 ways of actually making a flush, so (26,5)*48!/52! This seems way too small, so I probably have a mistake somewhere. But this approach seems promising.
|
On June 23 2017 11:21 Uldridge wrote: So I have a bit of a problem I've worked on in the past, but my math is too lacking to solve it. The problem is as follows: with a standard deck of cards (52; 26 black, 26 red), what is the probability that one of colors is found 5 times or more (so at least 5 times) in a row when the deck is shuffled and put in a sequence (so random sequence of 52 cards)? I've made a small piece of code that can easily make over 1x10^6 runs to come to just under 80% and I know it's a combinatorial problem, but I have no idea how to formally solve it. Nor does the probability seem consistent because it fluctuates depending on the type of code used (different people, different code, or either my code sucks, but I've tested it thoroughly, so that shouldn't be it...)
I expect that a closed-form expression for this probability will be rather complicated. I suppose you can get a recursive formula which then can be evaluated by a computer.
Let A(b,r) be the probability that you will have a streak of 5 black cards in a deck with b black cards and r red cards Like for an example, if you start with stack of 26 black cards (and no red cards), you obviously have a probabilty of 1 that you will get a streak of 5 black cards. Whereas in a stack with 26 red cards (and 0 black cards), the probability is 0.
Now suppose that you have a stack of b black cards and r red cards. If the first card is red (which happens with a probabilty of r/(b+r) ), then a streak of 5 black cards must be contained in remaining b black and (r-1) red cards, where it has probability A(b, r-1). The probabilty of getting a 5-black-streak in this case (first card is red) is therefore (r/(b+r)) *A(b, r-1) If the first card is black and second card is red (which happens with probability (b/(b+r))*(r/(b+r-1)), a 5-black-streak must be contained in the remaining (b-1) black and (r-1) red cards. The probabilty of getting a 5-black-streak in this case (first card is black, second card is red) is therefore (b/(b+r))*(r/(b+r-1)) *A(b-1, r-1). ..... now you iterate this idea for (1st card black, 2nd card black, 3rd card red),..... until (1st B, 2nd B, 3rd B, 4th B, 5th B) in which case you have 5-black-streak regardless of what is happening for the reamining cards.
Altogether, you obtain a recursive formula for A(b,r) with intial values A(b,0)=1 for b >= 5 and A(0,r)=0 for any r. (You might simplify by saying A(26, 5)=1. I suppose this should be easy to code once you've found all formulas and a computer should be able to find A(26,26), the value in question, in almost no time.
edit: I think may initial values are not sufficient yet for the recursion. But if you understand the principle, adding the missing initial values should not be much of a problem.
|
+ Show Spoiler [To travis] +Hey, travis. On June 23 2017 04:15 travis wrote: Here's a math question I have.
i want to write a sum:
from i=1 to n of: 1/2*(i-1)i
But I don't actually want i to stop when i = n. I want i to stop when the sum of "i values" has reached n. How do I do that?
It's like if I could write my sum as "from i = i +1 to n"
Example:
If n = 10 I want my sum to go through i values of: 1, 2, 3, 4 - then STOP. Which gives me a sum of 0+1+3+6 = 10
Your series can be written as where k is defined by your requirement that the sum of the i values has to equal n. All that we have to do now is solve equation (1) for k in terms of n. The finite sum on the left side is one we can look up in a table. What we have here is a quadratic equation for k. Use the quadratic formula to solve it. We use the expression on the right for k since we want it to be a positive value. The one on the left is negative, so we discard it. Therefore, your sum can be written in terms of n as follows. This sum can be evaluated. Switch the upper limit back to k for a moment and split up the sum like so. The finite sum of i^2 and the finite sum of i can be looked up in a table and/or proved using mathematical induction. Simplifying this gives us Now we can plug in that value for k. Doing so and simplifying gives us the final result. If we plug in n = 10, then the upper limit evaluates to 4 and the sum evaluates to 10, which is consistent with your example. Is the only way to do this to solve for the relationship between what I want i to do, and n?
I'm reluctant to say it's the only way, but it is the most convenient way as far as I can see. Because I am not sure what the relationship is.
Yeah, you are. You say yourself that you want the sum to stop when the sum of i values equals n. We write equation (1) from that fact.
+ Show Spoiler [To esla_sol] +Hey, esla_sol. On June 23 2017 07:18 esla_sol wrote:Show nested quote + The probablity of matching at least once equals 1 minus the probablity of never matching so the answer to your question is:
1-!100/100! which approximately equals 63 percent.
I can explain what dearangement is all about tomorrow if you're interested but for now I need to go to bed
that's amazing. i had to look up what the factorial in the front meant. is the reason you divide by 100! because you have 1/100 chance, then 1/99, and so on? On the bottom you have 100!, which is the total number of ways to order the 100 numbers. On the top you have !100, which is the number of different ways to order the 100 numbers such that none of the numbers are shouted at the same time. I have to admit I've never even heard of derangements or subfactorials before today.
|
On June 23 2017 05:42 esla_sol wrote: i teach elementary school and we do probability. things like dice and spinners. basic stuff. was talking to a friend about probability and he gave me this problem. i've been unable to make sense of it. any help is appreciated.
You and I are playing a game. We each shout out a number 1-100 every 5 seconds. Once someone says a number, that person can't say it again. What's the probability we match at least once?
If neither person was allowed to repeat the other's numbers the problem would be considerably easier (just break it down into a big conditional probability chain). I'm stumped.
|
On June 23 2017 07:18 esla_sol wrote:Show nested quote + The probablity of matching at least once equals 1 minus the probablity of never matching so the answer to your question is:
1-!100/100! which approximately equals 63 percent.
I can explain what dearangement is all about tomorrow if you're interested but for now I need to go to bed
that's amazing. i had to look up what the factorial in the front meant. is the reason you divide by 100! because you have 1/100 chance, then 1/99, and so on? !100 (subfactorial 100) is the numbers of ways you can derange 100 objects.
!1=0 because there is no way to derange one object !2=1 because there is one way to derange two objects (BA) !3=2 (BCA, CAB) !4=9 (BADC, BCDA, BDAC, CADB, CDAB, CDBA, DABC, DCAB, DCBA) !5=44 !6=265
+ Show Spoiler +
100! is the number of permutations (ways to arrange) for 100 objects. !100/100! is the probablity of derangement occuring.
------------------ Edit: why is the picture I uploaded not showing? :/
|
On June 23 2017 17:45 Shalashaska_123 wrote:+ Show Spoiler [To travis] +Hey, travis. On June 23 2017 04:15 travis wrote: Here's a math question I have.
i want to write a sum:
from i=1 to n of: 1/2*(i-1)i
But I don't actually want i to stop when i = n. I want i to stop when the sum of "i values" has reached n. How do I do that?
It's like if I could write my sum as "from i = i +1 to n"
Example:
If n = 10 I want my sum to go through i values of: 1, 2, 3, 4 - then STOP. Which gives me a sum of 0+1+3+6 = 10
Your series can be written as where k is defined by your requirement that the sum of the i values has to equal n. All that we have to do now is solve equation (1) for k in terms of n. The finite sum on the left side is one we can look up in a table. What we have here is a quadratic equation for k. Use the quadratic formula to solve it. We use the expression on the right for k since we want it to be a positive value. The one on the left is negative, so we discard it. Therefore, your sum can be written in terms of n as follows. This sum can be evaluated. Switch the upper limit back to k for a moment and split up the sum like so. The finite sum of i^2 and the finite sum of i can be looked up in a table and/or proved using mathematical induction. Simplifying this gives us Now we can plug in that value for k. Doing so and simplifying gives us the final result. If we plug in n = 10, then the upper limit evaluates to 4 and the sum evaluates to 10, which is consistent with your example. Is the only way to do this to solve for the relationship between what I want i to do, and n?
I'm reluctant to say it's the only way, but it is the most convenient way as far as I can see. Because I am not sure what the relationship is.
Yeah, you are. You say yourself that you want the sum to stop when the sum of i values equals n. We write equation (1) from that fact. + Show Spoiler [To esla_sol] +Hey, esla_sol. On June 23 2017 07:18 esla_sol wrote:Show nested quote + The probablity of matching at least once equals 1 minus the probablity of never matching so the answer to your question is:
1-!100/100! which approximately equals 63 percent.
I can explain what dearangement is all about tomorrow if you're interested but for now I need to go to bed
that's amazing. i had to look up what the factorial in the front meant. is the reason you divide by 100! because you have 1/100 chance, then 1/99, and so on? On the bottom you have 100!, which is the total number of ways to order the 100 numbers. On the top you have !100, which is the number of different ways to order the 100 numbers such that none of the numbers are shouted at the same time. I have to admit I've never even heard of derangements or subfactorials before today.
firstly: wow secondly, sorry HTKPZ but what you posted actually wasn't what I wanted, I don't know how I got confused. This is the solution I was looking for, since I needed things in terms of n instead of in terms of the iteration I want to stop at.
but now I am shocked because while this answer certainly seems correct, this seems way more advanced than anything I should be having to do for this class, lol
maybe not though... since I do actually understand it
I really don't understand what you are doing in this step:
-what am I doing wrong? why is this image not loading?
edit2: oh wait, I see what you are doing now! I misunderstood the picture, you are saying the entire sum = n. ok that makes sense
anyways big thanks to everyone!
|
wowowow my final question is SO much harder
http://www.cs.umd.edu/class/summer2017/cmsc351/hwk7.pdf
It's the final question there (2b). It works like the first one except for now, the sum goes from i=1 to k of (i-1)i/2
but this sum will be repeated Z times and after every Z repetitions of this inside sum, Z is raised to the next power of 2 (if it was 1, it becomes 2, if it was 2, it becomes 4, if it was 4, it becomes 8), and k is incremented by 1
But then finally all this needs to be related to n, where n is equal to the total times i was incremented over all repetitions
aaand this was probably all insanely confusing so I will write it like this
If our n = 17
Then we need to do the sum from i=1 to 1 of (i-1)i/2 ONE TIME Then we need to do the sum from i=1 to 2 of (i-1)i/2 TWO TIMES Then we need to do the sum from i=1 to 3 of (i-1)i/2 FOUR TIMES
If our n was 49
Then we need to do the sum from i=1 to 1 of (i-1)i/2 ONE TIME Then we need to do the sum from i=1 to 2 of (i-1)i/2 TWO TIMES Then we need to do the sum from i=1 to 3 of (i-1)i/2 FOUR TIMES Then we need to do the sum from i=1 to 4 of (i-1)i/2 EIGHT TIMES
and we don't worry about n-values that don't line up nicely
I could definitely use help.. I am about 75% sure I've got this much correct. I'll be working on it.. lol I'll try using what shalashaska showed. But first... lunch
|
Apologies if this has already been answered somewhere, but I wanted to ask this.
Its been almost 20 years since I did any serious kind of mathematics, and I don't have much exposure to mathematics in my current role as an application programmer.
Can any of you recommend some resources to start learning calculus and probability from scratch? I am looking for books that talk more about the theory rather than working out exercises. A few books I tried in the past turned out to be extremely dry affairs that jumped straight into problem solving without much background text.
Thank you.
|
So in the end, Travis made this thread to solve some homework questions :D
|
edit, oops did my math wrong, back to the drawing board
|
On June 24 2017 00:49 Piledriver wrote: Apologies if this has already been answered somewhere, but I wanted to ask this.
Its been almost 20 years since I did any serious kind of mathematics, and I don't have much exposure to mathematics in my current role as an application programmer.
Can any of you recommend some resources to start learning calculus and probability from scratch? I am looking for books that talk more about the theory rather than working out exercises. A few books I tried in the past turned out to be extremely dry affairs that jumped straight into problem solving without much background text.
Thank you.
For the calculus portion, do you mean its theoretical foundations? If that is the case you are looking for an introductory text into real analysis, you can go on math.stackexchange to find all sorts of textbook recommendations. However, the typical answer to calculus theory/ real analysis has always been Rudin's real analysis textbook though there are friendlier versions out there.
|
Does 1 + 1 ever not equal 2?
|
|
|
|