Jump to content

all possibilities


dstebbins

Recommended Posts

Suppose I have x number of items. I am instructed to put them in groups of y items, such as groups of two or groups of three. Is there an equation that I can plug these variables into to figure out all possible combinations? Thanks.

Link to comment
Share on other sites

I suppose you could do something like this (example)

 

Say we had 100 groups and we want 6 in each group...

 

[math]100 \; mod \; 6 = 4[/math]

 

4 remaining so we can do this:

 

[math]\frac{(100-4)}{6} = 16[/math]

 

And seeing as we had a remainder from our modulo we add one so we will have 17 groups :)

 

Make sence...?

 

Cheers,

 

Ryan Jones

Link to comment
Share on other sites

I wasn't asking for the total number of combinations I will have at one time. That's easy.

 

Imagine that all the items have a number on them, so they are distinguishable. I need to figure out how many possibilities there are for combining them. If I need groups of two, I need to figure out how many combinations I will have after I pair each item with each other item once.

 

Does that make it any clearer?

Link to comment
Share on other sites

Well, let's see. Say you have 100 items, and you need groups of four.

 

For the first group, first item, you have 100 choices. For the next item, you have 99 choices. Then 98 and 97 for the next two. For the next group, 96, 95, 94, 93, and so on. So there are 100! possibilities for order. Except the order in each group doesn't matter, and there are 4! ordering possibilities in each group (4 choices for first, 3 for second, etc.), so we should divide by 4! for each group, i.e. 25 times. Hence, I think an equation would look like...

 

P = n!/(s!^g)

 

where P= the number of possibilites

n= the total number of items

s = the size of each group

g = the number of groups

 

Or, since n = s*g, we can simplify to two variables.

 

P = (sg)!/s!^g

Link to comment
Share on other sites

Let me tell you why I'm asking this, and maybe it will become clearer.

 

I'm an aspiring video game designer who is about to graduate from high school and go to college. Suppose, after earning my degree, I get a job as an animator. The character I'm making is supposed to have x number of moves, but instead of making x animations, I want the character to go from one move to the next fluidly, so I want to impliment a set of transition animations. Every move has a transition animation that goes to every other move with perfect fluidity, instead of the jerky animation of many games today. Therefore, the number of items in each group, aka y, would be two.

 

Is there an equation where I can plug in x and y and figure out the total number of animations, both regular and transition, that I'll have to program?

Link to comment
Share on other sites

Well' date=' let's see. Say you have 100 items, and you need groups of four.

 

For the first group, first item, you have 100 choices. For the next item, you have 99 choices. Then 98 and 97 for the next two. For the next group, 96, 95, 94, 93, and so on. So there are 100! possibilities for order. Except the order in each group doesn't matter, and there are 4! ordering possibilities in each group (4 choices for first, 3 for second, etc.), so we should divide by 4! for each group, i.e. 25 times. Hence, I think an equation would look like...

 

P = n!/(s!^g)

 

where P= the number of possibilites

n= the total number of items

s = the size of each group

g = the number of groups

 

Or, since n = s*g, we can simplify to two variables.

 

P = (sg)!/s!^g[/quote']

this came as I was typing the last one.

 

What do the exlcamation marks mean?

 

Also, if g is the number of groups, could you isolate g for me?

Link to comment
Share on other sites

this came as I was typing the last one.

 

What do the exlcamation marks mean?

 

Also' date=' if g is the number of groups, could you isolate g for me?[/quote']

 

You've also posted as I was typing mine.

 

The ! means factorial, which means multiply successive terms. In other words, 5! = 5*4*3*2*1 = 120.

 

But that's not necessary, I misunderstood what you were asking. See above post.

Link to comment
Share on other sites

yeah that`s exactly what I was thinking, Seriously! (even though I despise maths) I remember this, as I used in a Lottery calculation ages ago :)

each variable takes away (or adds) possible combinations exponentialy.

Link to comment
Share on other sites

No. The of ways of picking 2 from n is n choose two, or n(n+1)/2, and that is the number of transition moves you need (one for each possible choice of pairs of moves).

okay, now that I've got two totally different answers from two totally different people, I don't know what to think.

Link to comment
Share on other sites

Your original question is slightly ambiguous, but that isn't a criticism. It is common in combinatorics.

 

Do you mean

 

1. how many ways are there to select two things from n.

 

2. how many ways are there to partition n into subsets of size p. this is subtly different.

 

for example, if n=4, the first case gives

 

12,13,14,23,24,34 ie 6 pairs.

 

however the second count classifies things like

 

(12)(34), or (13)(24) or (14)(23) which are the only 3 ways to split 4 up into groups of 2 objects (assuming order unimportant).

 

actually i think there is yet another way of thinking about this,and it is the correct way: order must be important to you. doing A then B will need a different animation to doing B then A, so yes, now I think about it the number you want is just n^2.

Link to comment
Share on other sites

Your original question is slightly ambiguous' date=' but that isn't a criticism. It is common in combinatorics.

 

Do you mean

 

1. how many ways are there to select two things from n.

 

2. how many ways are there to partition n into subsets of size p. this is subtly different.

 

for example, if n=4, the first case gives

 

12,13,14,23,24,34 ie 6 pairs.

 

however the second count classifies things like

 

(12)(34), or (13)(24) or (14)(23) which are the only 3 ways to split 4 up into groups of 2 objects (assuming order unimportant).

 

actually i think there is yet another way of thinking about this,and it is the correct way: order must be important to you. doing A then B will need a different animation to doing B then A, so yes, now I think about it the number you want is just n^2.[/quote']

I explained the problem I was trying to solve in another post in this thread.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.