0

I am trying to solve for the total number of combinations of 3 separate parts. No part can be used more than once and each part must go within its own set of parts.

For example part A has 3 parts to choose from. Part B has 9 parts to choose from, and part C has 18 parts to choose from. I would think factorials would be the way to go about this, but I don't know how to combine them together to make a total list of combinations.

So my idea is:
int a = 3;
int b = 9;
int c = 18;
int d;
d = (a!/(a-1)!) * (b!/(b-1)!) * (c!/(c-1)!)

Would that be enough? I can't help but think that is way too easy, and can't help but think I am missing a step.

  • Why isn't it just $3\cdot9\cdot18$? There are $3$ ways to choose part A, not $3!$, unless I'm missing something. – saulspatz May 19 '21 at 14:09
  • Each part is chosen only once. Think parts to the car, 3 engines to choose from, 9 wheels types to choose from, and 18 body types to choose from. – Kyle Campbell May 19 '21 at 14:12
  • 1
    Then there are no factorials involved. We have and ordered triple $(a,b,c)$ where $a$ can take $3$ values, $b$ can take $9$ and $c$ can take $18$. The total number is $3\cdot 9\cdot18$. Think about a $3\times9\times18$ rectangular box. – saulspatz May 19 '21 at 14:17
  • 1
    d = (a!/(a-1)!) * (b!/(b-1)!) * (c!/(c-1)!), the expression you have written is just $d = a\cdot b\cdot c$ – true blue anil May 19 '21 at 14:18
  • See the Rule of Product on wikipedia. – JMoravitz May 19 '21 at 14:19
  • Don't try to shoehorn in factorials and binomial coefficients and other more complicated results into problems like these where they don't belong. Assuming we are interpreting the problem correctly at this point this relies on far more basic and fundamental principles which should be learned and mastered well before ever being introduced to the concept of factorials. – JMoravitz May 19 '21 at 14:21
  • Also, why are you using programming language notation with the int a = 3; and such? Just use normal everyday language... it looks weird and unnecessary to write as you did. At least you didn't go so far as to declare a main method... – JMoravitz May 19 '21 at 14:23
  • It is meant to be edited later so that multiple parts can be chosen in different locations. I am aware that the current math is simply 3 * 9 * 18. The car example was poorly chosen. This is actually going to be for spaceship parts. A is the thruster set, B is the cockpit set, and C is the Wing set. So later on we aim to allow larger ships to have multiple thrusters, multiple cockpits (mostly to add body style) and multiple wing types going front to back. So the coding is just pre-planning for later expansion once we figure out the anchor points for the parts. – Kyle Campbell May 19 '21 at 14:26

0 Answers0