CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-22-2013, 01:38 AM   #1
Animare
Still learning...
 
Animare's Avatar
portfolio
Shan Joseph
None
Animare
Australia
 
Join Date: Jun 2002
Posts: 373
Send a message via MSN to Animare
Question Math Help / Calculation Help

Hi all,



Hmm, this seems so easy, yet I canít figure it out. I have found a few formulas on the net, but Iím not exactly sure they are right because it seems there are a few ways to do this. Basically I am looking at ďCombinationí math.



So for example, I have a Character which consists of 3 elements



Hat

Pants

Shoes



Within those elements there are different variations, e.g 3 hat types 5 pant types, 3 shoe types.



What Iím trying to get is the math to figure out how many possible combinations there are



So for this example formula Iím using is :



Hat : 5

Pants : 4

Shoes : 3



5*4*3 = 60



But that doesnít seem right?



Any ideas, I suck at Math! (or Maths, I suck at English too)



Thanks





 
Old 02-22-2013, 01:51 AM   #2
Bobo
Krakatoa Guy
 
Bobo's Avatar
Borislav Petrov
Product Specialist
Thinkbox Software
Vancouver, Canada
 
Join Date: Mar 2002
Posts: 5,324
Quote:
Originally Posted by Animare
5*4*3 = 60
But that doesnít seem right?


Why doesn't it?

If you don't trust your instincts, you can write 3 simple nested loops just to get a better feeling:

Code:
(cnt = 0 for a = 1 to 5 do for b = 1 to 4 do for c = 1 to 3 do cnt += 1 cnt)
__________________
Bobo
 
Old 02-22-2013, 05:46 AM   #3
Ian31R
Expert
portfolio
Ian Adams
Freelancer
Kent, USA
 
Join Date: Aug 2011
Posts: 292
Here's some info with a calculator about combinations and permutations you might find useful -
http://www.mathsisfun.com/combinato...calculator.html
 
Old 02-27-2013, 12:57 AM   #4
Animare
Still learning...
 
Animare's Avatar
portfolio
Shan Joseph
None
Animare
Australia
 
Join Date: Jun 2002
Posts: 373
Send a message via MSN to Animare
Thumbs up

Thanks Bobo!

Wow very cool way of laying it out, very clear.


Thanks for the link Ian, it makes my head kind of spin the amount of ways you can look at it!

Much appreciated!
 
Old 02-27-2013, 07:36 PM   #5
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,626
Send a message via ICQ to denisT
Quote:
Originally Posted by Animare
So for example, I have a Character which consists of 3 elements

Hat
Pants
Shoes

Within those elements there are different variations, e.g 3 hat types 5 pant types, 3 shoe types.
What Iím trying to get is the math to figure out how many possible combinations there are

5*4*3 = 60

But that doesnít seem right?



you are absolutely right in your doubt... the right formula is

(numHats+1)*(numPants+1)*(numShoes+1)

so in your case it's 6*5*4 = 120

because... (dramatic pause is here) ... every character can be also with no hat, pants, or shoes
 
Old 02-28-2013, 02:44 AM   #6
Bobo
Krakatoa Guy
 
Bobo's Avatar
Borislav Petrov
Product Specialist
Thinkbox Software
Vancouver, Canada
 
Join Date: Mar 2002
Posts: 5,324
Quote:
Originally Posted by denisT
because... (dramatic pause is here) ... every character can be also with no hat, pants, or shoes


True, even Spongebob is sometimes without pants!
__________________
Bobo
 
Old 02-28-2013, 05:21 PM   #7
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,626
Send a message via ICQ to denisT
Quote:
Originally Posted by denisT
you are absolutely right in your doubt... the right formula is

(numHats+1)*(numPants+1)*(numShoes+1)

so in your case it's 6*5*4 = 120

because... (dramatic pause is here) ... every character can be also with no hat, pants, or shoes


and the formula above is not also corrent. there is a revision:
(numHats+1)*(numPants+1)*(numShoes+1)^2

because any character can be worn in different shows
so the final number of combinations is 6*5*4^2 = 480
 
Old 03-01-2013, 09:58 AM   #8
Animare
Still learning...
 
Animare's Avatar
portfolio
Shan Joseph
None
Animare
Australia
 
Join Date: Jun 2002
Posts: 373
Send a message via MSN to Animare
Wink

Lol....I never thought taking away would add more
 
Old 03-01-2013, 09:58 AM   #9
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:14 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.