Suppose we have any $n$ numbers. How many combinations can we make to multiply them with each other. We don't only have to multiply all $n$ numbers we can multiply any amount of numbers. And is there any way to get all the possible combinations?
Asked
Active
Viewed 178 times
-3
-
do we care if the answer is the same ? – Sep 21 '17 at 13:04
-
no the answer can be same@RoddyMacPhee – Sumit Sep 21 '17 at 13:05
-
2If you're asking: "given $n$ numbers, how many ways can we multiply some of these $n$ numbers together?" then the answer is just $2^n-n-1$. Recall that the cardinality of the power set of a set with $n$ elements is equal to $2^n$. We take away n and 1 as there has to be at least 2 numbers – Sep 21 '17 at 13:06
-
@Jazzachi you could make that an answer and gain more reputation maybe. – Sep 21 '17 at 13:12
-
@Jazzachi thanks it worked – Sumit Sep 21 '17 at 13:13
-
@RoddyMacPhee done – Sep 21 '17 at 13:19
1 Answers
2
Recall that the cardinality of a power set of a set with $n$ elements is equal to $2^n$. This brings up all the possible ways we can select elements from our set of $n$ numbers. However, we have to select at least two numbers (you cannot multiply one number) so we do not consider the subsets with one element or the empty set. This means we subtract $n$ and $1$ from our total, giving $$2^n-n-1$$
-
is there any formulae to get all the possible combinations i have to implement this in a computer program – Sumit Sep 21 '17 at 13:21
-
@Sumit That's simply taking all the subsets of $n$ with cardinality two or greater. For algorithmic implementation, I recommend you head to StackOverflow – Sep 21 '17 at 13:24