View previous topic :: View next topic |
Author |
Message |
psmadhusudhan Beginner
Joined: 28 Nov 2006 Posts: 143 Topics: 48
|
Posted: Wed Jun 03, 2009 6:08 am Post subject: Cobol challenge |
|
|
A game is played with a deck of cards numbered 1 to N. The deck is placed with the faces down. The game proceeds by revealing a card and placing it at the end of the deck, parallelly keeping a track of the number of cards being revealed. If at any time, the number on the card revealed matches the count so far; the card is removed from the deck and the count is reset. The game again starts with remaining cards in the deck.
The order in which the cards are placed initially is called a sequence. In any sequence the position of a number _________________ Thanks
Madhu Sudhan |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Wed Jun 03, 2009 7:57 pm Post subject: |
|
|
psmadhusudhan,
Couple of questions.
1. How do you generate the initial sequence? Since N is 5 do you generate the 5! = 120 permutations and combinations ? If you are doing that then the max value N cant be bigger than 20 as the permutations and combinations will be 20! which is a very very large number.
2. I guess you are aware of the rules of this forum. Please post only questions which you can answer. You are responsible to answer the question after 72 hours of posting. |
|
Back to top |
|
|
psmadhusudhan Beginner
Joined: 28 Nov 2006 Posts: 143 Topics: 48
|
Posted: Wed Jun 03, 2009 11:34 pm Post subject: |
|
|
Kolusu,
I really dont know the solution . Even I am trying for it. I am unable to crack it. If some body knows please help me.
Sorry if I have done anything wrong. _________________ Thanks
Madhu Sudhan |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Jun 04, 2009 12:01 am Post subject: |
|
|
psmadhusudhan,
This mainframe challenge forum is basically a showoff forum for displaying your skills. I will move it to the application programming forum. I have a solution in mind but you need to answer my first question. How are you generating the initial sequence?
Kolusu |
|
Back to top |
|
|
|
|