dstebbins Posted April 17, 2006 Posted April 17, 2006 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.
RyanJ Posted April 17, 2006 Posted April 17, 2006 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
YT2095 Posted April 17, 2006 Posted April 17, 2006 Is there an equation that I can plug these variables into to figure out all possible combinations? Thanks. all possible combinations of What? Particular items in groups? item combinatons?
dstebbins Posted April 17, 2006 Author Posted April 17, 2006 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?
Sisyphus Posted April 17, 2006 Posted April 17, 2006 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
dstebbins Posted April 17, 2006 Author Posted April 17, 2006 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?
dstebbins Posted April 17, 2006 Author Posted April 17, 2006 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?
Sisyphus Posted April 17, 2006 Posted April 17, 2006 Oh. Well, that's easier. You have x moves. Each move needs a transition to every other, so for each move, you need 1 + (x-1) animations, i.e. x animations. Thus the total you need is just x^2.
Dave Posted April 17, 2006 Posted April 17, 2006 n! = n * (n-1) * (n-2) * ... * 3 * 2 * 1 It's called a factorial.
Sisyphus Posted April 17, 2006 Posted April 17, 2006 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.
YT2095 Posted April 17, 2006 Posted April 17, 2006 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.
dstebbins Posted April 17, 2006 Author Posted April 17, 2006 So let me clarify. If x is the number of items I have, and y is the number of items that must be put in a group, then the total number of possibilities is equal to x^y?
matt grime Posted April 17, 2006 Posted April 17, 2006 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).
YT2095 Posted April 17, 2006 Posted April 17, 2006 just a quicky but shouldn`t the Overall result be -1 as you singled out a Particular Item? I could be wrong tho (I hate Maths).
dstebbins Posted April 17, 2006 Author Posted April 17, 2006 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.
matt grime Posted April 17, 2006 Posted April 17, 2006 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.
dstebbins Posted April 17, 2006 Author Posted April 17, 2006 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now