# ok what is the equation for this?

This topic is 4850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

lets say I am generating a list of combinations. Now lets say I have 1 item that appears 3 times, and 5 spaces. The list would look like the following: 1 = item x = space 111xx 11x1x 11xx1 1x11x 1x1x1 1xx11 x111x x11x1 x1x11 xx111 There are 10 total possible combinations. I was wondering if there is a mathimatical equation that can tell me which number in the list is (for example) 1xx11? I know it is the 6'th one in the list because I generated the list. But is there away to derive that it is the 6'th one without generating the list?

##### Share on other sites
No, because your list isn't unique. Your list can be reordered and still fit the given requirement (1 item 3 times and 5 spaces).

##### Share on other sites
If the 1 was a 1 and the x was a 0 each would have a unique binary number.

16 4 1
8 2
111xx = 28
11x1x = 26
11xx1 = 24
1x11x = 22
1x1x1 = 21
1xx11 = 19
x111x = 14
x11x1 = 13
x1x11 = 11
xx111 = 7

You could probably do something with this.

If you can describe the way that you want to use the system u describe, then i might be able to help further.

ace

##### Share on other sites
In general, for one item that appears N times in M spaces, the solution can be found by looking at the Nth entry in the Mth iteration of Pascal's triangle...

specifically, the 5th line here is:

1 5 10 10 5 1

(but note carefully that the 'third' entry is actually the second 10, as the line is 0-based indexing... in other words, there is 1 way to arrange the items such that your value appears 0 times, and 1 way to arrange where it appears 5 times).

--ajas

##### Share on other sites
It's pretty simple. Just use a binary representation like ace said and put the resulting numbers into an array as a look-up table.

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 18
• 20
• 13
• 14
• 9
• ### Forum Statistics

• Total Topics
633365
• Total Posts
3011520
• ### Who's Online (See full list)

There are no registered users currently online

×