Cobol challenge
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Mainframe Challenge

#1: Cobol challenge Author: psmadhusudhan PostPosted: Wed Jun 03, 2009 6:08 am
    —
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

#2:  Author: kolusuLocation: San Jose PostPosted: Wed Jun 03, 2009 7:57 pm
    —
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.

#3:  Author: psmadhusudhan PostPosted: Wed Jun 03, 2009 11:34 pm
    —
Kolusu,

I really dont know the solution Sad. 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. Embarassed

#4:  Author: kolusuLocation: San Jose PostPosted: Thu Jun 04, 2009 12:01 am
    —
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



MVSFORUMS.com -> Mainframe Challenge


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group