MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cobol challenge

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Mainframe Challenge
View previous topic :: View next topic  
Author Message
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Wed Jun 03, 2009 6:08 am    Post subject: Cobol challenge Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Wed Jun 03, 2009 7:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Wed Jun 03, 2009 11:34 pm    Post subject: Reply with quote

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
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Thu Jun 04, 2009 12:01 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Mainframe Challenge All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group