Looking for a mathematical formula
-
Its about combinations. If I have 4 cards and I need to select 2 cards out of them then it can be done in 4C2 ways i.e. 4!/[2!(4-2)!] i.e. 6 ways. Now I have been trying to map a formula to find out exactly how many number of times will each card get touched in these 6 combinations. In this particular example each card gets touched 3 times. Is there any formula that already exists for this purpose? If you are going to nuke it saying it doesn't belong in the Lounge then consider it a puzzle ;P
-
Its about combinations. If I have 4 cards and I need to select 2 cards out of them then it can be done in 4C2 ways i.e. 4!/[2!(4-2)!] i.e. 6 ways. Now I have been trying to map a formula to find out exactly how many number of times will each card get touched in these 6 combinations. In this particular example each card gets touched 3 times. Is there any formula that already exists for this purpose? If you are going to nuke it saying it doesn't belong in the Lounge then consider it a puzzle ;P
__yash__ wrote:
If you are going to nuke it saying it doesn't belong in the Lounge then consider it a puzzle
This kind of question does belong to the Lounge so you are ok. Now if you had said you needed code for this problem, you might have seen different sort of responses. :)
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick
-
Its about combinations. If I have 4 cards and I need to select 2 cards out of them then it can be done in 4C2 ways i.e. 4!/[2!(4-2)!] i.e. 6 ways. Now I have been trying to map a formula to find out exactly how many number of times will each card get touched in these 6 combinations. In this particular example each card gets touched 3 times. Is there any formula that already exists for this purpose? If you are going to nuke it saying it doesn't belong in the Lounge then consider it a puzzle ;P
It's a good puzzle! :-D Unfortunately, I've been away from school for 30 years and I forgot the answer. But let me know when you find an answer. I have a similar problem that should be simple, but I think I keep making it too hard by worrying it like a dog with a big bone. I live amidst 9 casinos, and all have electronic Keno games. Each machine offers different versions of the game, each with it's own payout schedule for picking 3 to 20 spots. I want to write a simple program to calculate the best odds, not of winning, but of increasing my holdings. On some machines you can win often, but the payout is so low you still get eaten alive. On others the odds of hitting a mark are low, but the payout is so high that it only takes one to do well. I want to generate a table of bets that optimize my chances of walking out with my shirt and pants, given the inputs of # spots selected, # spots hit, and the payout in multiples of the bet amount. I'm embarrassed to admit that I've forgoten the formula for this, as once I knew it well enough to get an 'A' grade in the class. If I can create such a function, I can run it in a loop and accumulate the results for each selection and see which strategy is likely to generate the most income (or least loss).
Will Rogers never met me.
-
Its about combinations. If I have 4 cards and I need to select 2 cards out of them then it can be done in 4C2 ways i.e. 4!/[2!(4-2)!] i.e. 6 ways. Now I have been trying to map a formula to find out exactly how many number of times will each card get touched in these 6 combinations. In this particular example each card gets touched 3 times. Is there any formula that already exists for this purpose? If you are going to nuke it saying it doesn't belong in the Lounge then consider it a puzzle ;P
Well I just run some combination and looks like if you have to chose 2 cards from n cards will have nC2 different combination. If you look at the number of combination every card comes (n-1) times. For 4 cards 1 2 3 4 there will be 1 2 1 3 1 4 2 3 2 4 3 4 are the possible combination as you can see card no 1 is there 3 times, card no 2 us there 3 times and so on . it looks like (n-1) times it is repeating. this is true for only 2 card selection I haven't tried this on selecting more than 2 cards. Office time is about to over . 5 min to go !!
Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.
-
Well I just run some combination and looks like if you have to chose 2 cards from n cards will have nC2 different combination. If you look at the number of combination every card comes (n-1) times. For 4 cards 1 2 3 4 there will be 1 2 1 3 1 4 2 3 2 4 3 4 are the possible combination as you can see card no 1 is there 3 times, card no 2 us there 3 times and so on . it looks like (n-1) times it is repeating. this is true for only 2 card selection I haven't tried this on selecting more than 2 cards. Office time is about to over . 5 min to go !!
Zen and the art of software maintenance : rm -rf * Math is like love : a simple idea but it can get complicated.
Been there, done that!! :) Its pretty straight forward for selecting 2 from N but gets more involved when trying for more than 2. I have been drawing weird diagrams and after having seen "A Beautiful Mind" I thought I should get it just looking at the numbers ;P I disappoint myself :doh:
-
Its about combinations. If I have 4 cards and I need to select 2 cards out of them then it can be done in 4C2 ways i.e. 4!/[2!(4-2)!] i.e. 6 ways. Now I have been trying to map a formula to find out exactly how many number of times will each card get touched in these 6 combinations. In this particular example each card gets touched 3 times. Is there any formula that already exists for this purpose? If you are going to nuke it saying it doesn't belong in the Lounge then consider it a puzzle ;P
Sounds like an Algorithms[^] question to me...
Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
-
Its about combinations. If I have 4 cards and I need to select 2 cards out of them then it can be done in 4C2 ways i.e. 4!/[2!(4-2)!] i.e. 6 ways. Now I have been trying to map a formula to find out exactly how many number of times will each card get touched in these 6 combinations. In this particular example each card gets touched 3 times. Is there any formula that already exists for this purpose? If you are going to nuke it saying it doesn't belong in the Lounge then consider it a puzzle ;P
Number of ways of choosing m from n is nCm. The number of times a particular card is used (touched) is (n-1)C(m-1). In case this is homework I'll leave the explanation to you.
Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
-
Number of ways of choosing m from n is nCm. The number of times a particular card is used (touched) is (n-1)C(m-1). In case this is homework I'll leave the explanation to you.
Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
-
Been there, done that!! :) Its pretty straight forward for selecting 2 from N but gets more involved when trying for more than 2. I have been drawing weird diagrams and after having seen "A Beautiful Mind" I thought I should get it just looking at the numbers ;P I disappoint myself :doh:
__yash__ wrote:
drawing weird diagrams and after having seen "A Beautiful Mind"
btw... are you able to see that little girl after using your mind for such things!! ;P
Believe Yourself™