Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 5th, 2008, 1:58 PM   #1
paul6789
Newbie
 
Join Date: Mar 2008
Posts: 1
Rep Power: 0 paul6789 is on a distinguished road
Help with countinig principle

Hi I was wondering if someone could take a look at this. I am currently doing a project on horse racing and I am
stuck on a piece of programming logic. The piece I am stuck on is based on the counting principle.
I have been trying to find a way to output all the possible permutations ( without Replacement) from a varying
number of inputs

Example 1 :
HorseA
HorseB .
............................

HorseA
HorseB ....is one and only permutation ( a 2 X 1 matrix)



Example 2 :
HorseA Horse C
HorseB EMPTY
..................................

HorseA
HorseB

and

HorseC
HorseB ..... are the permutations (2X2 matrix)





Example 3 :

HorseA HorseC
HorseB HorseD
............................................
HorseA
HorseB

and

HorseC
HorseB

and

HorseA
HorseD

and

HorseC
HorseD

.........are the permutations (2X2 matrix)







I have been trying with for loops. But it is more difficult than it seems. I need the loops top output all
permutations. THE FIRST COLUMN IN THE MATRICES MUST ALWAYS BE FULL -- NOT THE CASE HOWEVER FOR THE OTHER COLUMNS
paul6789 is offline   Reply With Quote
Old Mar 6th, 2008, 10:24 AM   #2
Arla
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 222
Rep Power: 4 Arla is on a distinguished road
Re: Help with countinig principle

Any good links to websites explaining the counting principle? Because I'm not sure I understand it from your explination. Is it simply that you can match ever item in a cell, with every item in every other column except items in the same row as itself?

(i.e. that's why you didn't match A to C in either of your examples, or B to D in the third example)?
Arla is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't Repeat Yourself principle for Initialization lists. Eoin C++ 6 Sep 20th, 2007 10:43 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:59 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC