Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Frustrated with Factorials
"Les Coover" wrote in message t...
Thank you everyone for your posts. I apologize if I mislead anyone into thinking the problem was more complicated than it actually is. The problem: Design a program that will calculate the probability no 2 people have the same birthday when the number of randomly selected people is 3, 5 and 25. NOW HE TELLS US!!!!!!!! I wrote an all-singing all-dancing MACHINE-CODE program to work out ZILLIONS and VERMILLIONS and POSTILLIONS of combinations - and he wants to go up to 25. Anyway, look elsewhere in this string - or at http://wehner.org/tools/factor.txt The object code is at http://wehner.org/tools/factor.x It must be renamed "factor.com" (IBM DOS only) Charles Douglas Wehner |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Frustrated with Factorials
"Les Coover" wrote in message
t... Thank you everyone for your posts. I apologize if I mislead anyone into thinking the problem was more complicated than it actually is. The problem: Design a program that will calculate the probability no 2 people have the same birthday when the number of randomly selected people is 3, 5 and 25. On 24 Jul 2003 15:46:19 -0700, (Charles Douglas Wehner) wrote: NOW HE TELLS US!!!!!!!! I wrote an all-singing all-dancing MACHINE-CODE program to work out ZILLIONS and VERMILLIONS and POSTILLIONS of combinations - and he wants to go up to 25. Anyway, look elsewhere in this string - or at http://wehner.org/tools/factor.txt The object code is at http://wehner.org/tools/factor.x It must be renamed "factor.com" (IBM DOS only) Charles Douglas Wehner Myrna Larson wrote in message . .. I don't think this problem even involves factorials. In A1 put the number 1. In A2, =A1*(366-ROW())/365 Copy down as many rows as there are people in the room. A3 = 0.9918, A5 = 0.9729, A25 = 0.4313 You hit 50% at about 23 people. If you have three people, and select one, the chance of him/her having a particular birthday is 1 in 365. If you select the next, he also has 1 in 365 of hitting that same date. The last has 1 in 365 of hitting that date. It can happen that ALL THREE have the same birthday. This is the kind of complication that brings in factorials - the OVERLAP problem. For example, A may not hit the selected date and B may not hit the selected date. C alone may or may not hit that date - but is only ONE, not TWO. However, the two who seemed to be "in the clear" may in fact have the same "non-selected" birthday. So ALL permutations have to be computed. This involves factorials. I am actually too busy with other matters to think about this too deeply - but it is a standard, and fairly easy, probability problem. For those who hate maths, the key is in the "DESIGN A PROGRAM" phrase. You just get the program to make an array, as Myra suggests, of 365 by 3, of 365 by 5 and 365 by 25. Then you get it to "hunt" for matches in the array - and divide the total by the total size of the array. The question is - WHAT IS BEING TAUGHT? If it is programming techniques, you do not need to understand the problem - just to write the code. I remember how a very eminent mathematician called Alan Coutanceau Clark showed me his paper on an elaborate theorem he had devised. I had no time to try to understand it - and anyway, it was HIS not MINE. Line by line I turned his text into Basic with machine-code extensions (for high-value primes). When the program was finished, it did exactly what Alan said it would do. To this day I do not understand the theorem. I did not bother to think along those lines. So if Les Coover is studying programming rather than maths, he should make an array and scan it for matching numbers. Charles Douglas Wehner |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
So frustrated! Please help! | Excel Discussion (Misc queries) | |||
Frustrated | New Users to Excel | |||
Frustrated Professor | Excel Worksheet Functions | |||
Frustrated Cook | Excel Worksheet Functions | |||
Frustrated with Factorials | Excel Programming |