473,225 Members | 1,322 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

possible combination of numbers

AAA
hi,
I'll explain fastly the program that i'm doing..
the computer asks me to enter the cardinal of a set X ( called "dimX"
type integer)where X is a table of one dimension
and then to fill it with numbers X[i];
then the computer asks me how many subsets i have (nb_subset type
(integer))
then,i have to enter for every sebset the card, and then to fill it,
we'll have a two tables , one called cardY which contains nb_subset
elements,and every element is the cardinal of every Yi
example:
X={0, 1, 2, 3, 4, 5,6, 7,8, 9, 10} dimX= 11

Y1={5, 8, 9, 7} cardY[0]=4
Y2={2, 0, 7, 6, 4, 10} cardY[1]=6
Y3={8, 10, 6, 4, 3, 1} cardY[2]=6
Y4={9, 7, 5, 3, 1, 10, 7} ...
Y5={3, 8, 1, 9, 6} ...
Y6={1, 2, 3} ...
Y7={4, 9, 6, 3, 0} card[6]=4

and then a table of two dimensions, called TY(corresponding to Table Y)
which contains all the values of Yi
5 8 9 7 * * *
2 0 7 6 4 10 *
8 10 6 4 3 1 *
9 7 5 3 1 10 7
3 8 1 9 6 * *
1 2 3 * * * *
4 9 6 3 0 * *

(sure i'll lose memory, but its okay) i know that using chained lists
is best , but its okay

now the problem is to find all the combination possible of Yi which is
equal to X
example :

X= {1, 2, 3, 4, 5}
Y1= {2, 4, 5}; Y2= {1, 2, 4} ; Y3= {2, 3, 5} ; Y4= {3, 5} ; Y5= {1, 3,
4}
S= {1, 3, 5} S is a solution, N.B. where 1,3,and 5 are not elements,
but they are the indicies of Y
in this case Y1, Y3 and Y5

this was the subject of my mini project,
now ,my algorithm is to make a table containing all the possible
combinations of the indicies,example :
if the nb_subsets is 3
1
2
3
1,2
1,3
2,3
1,2,3
and then,i bring the Y1 and compare it to X, if the same, i return S=
{1}
if not , i try Y2,
then Y3
then Y1 and Y2 , if Y1 U Y2 = X , then the solution S={1,2}
and i continue

my question that i'd like to have your help in is :
HOW TO MAKE A TABLE OF THREE DIMENSIONS CONTAINING ALL THE POSSIBLE
INDICIIES, like the example above.
i don't know if it is possible,but it is something that i need
urgently,cause i have to give back my work on monday(in less than 2
days)
thanks a lot for your help..
sincerely

Sep 2 '06 #1
1 6917
AAA wrote:
hi,
I'll explain fastly the program that i'm doing..
the computer asks me to enter the cardinal of a set X ( called "dimX"
type integer)where X is a table of one dimension
and then to fill it with numbers X[i];
Since X is a **set** does this mean that the numbers
you have to enter are distinct ?
then the computer asks me how many subsets i have (nb_subset type
(integer))
then,i have to enter for every sebset the card, and then to fill it,
If you know the subset then it automatically determines
its cardinal and its elements. So I don't see why you have
to enter the card and fill it.
we'll have a two tables , one called cardY which contains nb_subset
elements,and every element is the cardinal of every Yi
example:
X={0, 1, 2, 3, 4, 5,6, 7,8, 9, 10} dimX= 11

Y1={5, 8, 9, 7} cardY[0]=4
Y2={2, 0, 7, 6, 4, 10} cardY[1]=6
Y3={8, 10, 6, 4, 3, 1} cardY[2]=6
Y4={9, 7, 5, 3, 1, 10, 7} ...
Y5={3, 8, 1, 9, 6} ...
Y6={1, 2, 3} ...
Y7={4, 9, 6, 3, 0} card[6]=4

and then a table of two dimensions, called TY(corresponding to Table Y)
which contains all the values of Yi
5 8 9 7 * * *
2 0 7 6 4 10 *
8 10 6 4 3 1 *
9 7 5 3 1 10 7
3 8 1 9 6 * *
1 2 3 * * * *
4 9 6 3 0 * *

(sure i'll lose memory, but its okay) i know that using chained lists
is best , but its okay

now the problem is to find all the combination possible of Yi which is
equal to X
example :

X= {1, 2, 3, 4, 5}
Y1= {2, 4, 5}; Y2= {1, 2, 4} ; Y3= {2, 3, 5} ; Y4= {3, 5} ; Y5= {1, 3,
4}
S= {1, 3, 5} S is a solution, N.B. where 1,3,and 5 are not elements,
but they are the indicies of Y
in this case Y1, Y3 and Y5

this was the subject of my mini project,
now ,my algorithm is to make a table containing all the possible
combinations of the indicies,example :
if the nb_subsets is 3
1
2
3
1,2
1,3
2,3
1,2,3
and then,i bring the Y1 and compare it to X, if the same, i return S=
{1}
if not , i try Y2,
then Y3
then Y1 and Y2 , if Y1 U Y2 = X , then the solution S={1,2}
and i continue

my question that i'd like to have your help in is :
HOW TO MAKE A TABLE OF THREE DIMENSIONS CONTAINING ALL THE POSSIBLE
INDICIIES, like the example above.
i don't know if it is possible,but it is something that i need
urgently,cause i have to give back my work on monday(in less than 2
days)
I'm sure it is possible if you manage to actually explain
what you need to do. So far I ain't got a clue. To be
perfectly honest with you it doesn't look like you can
manage for Monday but we'll see.

Sep 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chris Lasher | last post by:
Hello, I would like to create a set of very similar regular expression. In my initial thought, I'd hoped to create a regular expression with a variable inside of it that I could simply pass a...
36
by: rbt | last post by:
Say I have a list that has 3 letters in it: I want to print all the possible 4 digit combinations of those 3 letters: 4^3 = 64 aaaa
9
by: tony collier | last post by:
i have created a 7-dimensional array which has 19.5 million elements. when i try to create 8-dimensional array i get out of bounds system exception. does anyone know if this limitation is due...
6
by: aka_eu | last post by:
I have this problem. I'm trying to get all the valid combination C(N,K) that pass one condition. For example C(5,3) can use in any combination this numbers {1,2,3,4,5} But let's say that I...
4
by: kivan.maharaj | last post by:
What I want to do is write a program to test lexicographical combinations of various sets of numbers to a predefined number and write that true values to a text file. Example: Number choosen...
8
by: Mir Nazim | last post by:
Hello, I need to write scripts in which I need to generate all posible unique combinations of an integer list. Lists are a minimum 12 elements in size with very large number of possible...
9
by: Andy | last post by:
Hi there, I'm trying to do some predicting work over user input, here's my question: for pattern r'match me', the string 'no' will definitely fail to match, but 'ma' still has a chance if...
4
by: RSH | last post by:
Okay my math skills aren't waht they used to be... With that being said what Im trying to do is create a matrix that given x number of columns, and y number of possible values i want to generate...
7
by: Mysterydave | last post by:
Hi, I have a table of applications including what someone's applied for, which year, what type of applicant they are, and progress of the application etc. I want to be able to break this down...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.