| Author |
Replies: 79 / Views: 3,392 |
|
|
|
Valued Member
 Canada
287 Posts |
I have a daughter in grade 11, so I've been refreshing on alot of stuff I had put aside or forgotten over the last {insert large number} years. Permutations was one of them.
My wife made comment this morning about my additons to the list of currencies. She feels that everyone will know that since I've added them I will most likely use them in my answer. To enusre this does not become an advantage to anyone paying attention I wrote a quick and simple permutation generator that I will be using to select my currencies. It will be completely random.
|
|
Valued Member
 Canada
287 Posts |
Quote: The part I'm confused about is the continuing to *9 The ten highest numbers are 18 - 9, as 18-10 is only 9 distinct values. {I think}
|
|
Pillar of the Community
United States
4000 Posts |
Quote: I thought you only go to the number of slots You do. But you were only going to 9 slots. From 18*17...*10 is only 9 slots.
|
|
Pillar of the Community
United States
2605 Posts |
Looks like you don't need me. Scooby is right. Since we're looking for correct order it would be number of permutations, P(18, 10)=18!/(18-10)!=18*17*...*9.
If the order didn't matter it would be the number of combinations, C(18, 10)=18!/[10!(18-10)!] or the number above over 10*9*...*1.
|
|
Pillar of the Community
United States
2669 Posts |
I finally figured out where my short-circuit was - I got my 10's crossed. Like I went to the 6 in other example. So it's a count of (x available slots), not to the actual number (18*17 ...* 10) <--wrong 10! What is it the kids say now? Epic Fail?  Thanks everyone, for explaining. Professor, are you playing this round?
|
|
Pillar of the Community
United States
4000 Posts |
|
|
Valued Member
 Canada
287 Posts |
Ok, I'm taking my wife out for ice cream and I'll pick my currencies when I get back. If you care to see how I am going to pick them, here's the program I wrote this morning. http://24.57.62.251/perm_gen.php
|
|
Pillar of the Community
United States
4000 Posts |
Man, you had me foaming at the mouth, I thought I was gonna get to see some code.
Edited by Scooby Due 05/28/2010 7:56 pm
|
|
Valued Member
 Canada
287 Posts |
Scooby, if you want the code, I'll arrange it for you.
|
|
Valued Member
 Canada
287 Posts |
It is 7:57 and I have selected my currencies. Good luck to everyone !
|
|
Pillar of the Community
United States
4000 Posts |
After the game.
I always enjoy looking at other peoples programming. I like the various logic forms you run across. Sometimes you see a different or more efficient approach to a problem. What language?
|
|
Pillar of the Community
United States
4000 Posts |
So, we're sticking with RON and USZ? Kinda strange without XAU/XAG - kinda like a missing family member.
|
|
Pillar of the Community
United States
4000 Posts |
OK everybody! Let's throw out some clues before midnight to give us something to work on!
I'll go with the example:
EUR, MXN, JPY, NZD, SGD, DKK, SEK, USZ, AUD, RON
|
|
Valued Member
 Canada
287 Posts |
Sorry Scooby, but I've already picked the currencies, so it would not be right to change the rules now. No gold or silver, just plain ol' money. As for the program, it is PHP, but I wrote it with NotePad at work and uploaded to my server, so it is a bit rough, and simple. Here is where you can see the raw code. http://home.cogeco.ca/~rbalkwill/perm_gen.php
|
|
Valued Member
 Canada
287 Posts |
Quote: EUR, MXN, JPY, NZD, SGD, DKK, SEK, USZ, AUD, RON 5 correct, 0 in the right place.
|
| |
Replies: 79 / Views: 3,392 |