Closed zwhitchcox closed 4 years ago
Ok, so, looking at your actual code (I got stuck trying to understand the formula), it looks like you're actually using the formula [(m + n)!/max(m,n)!]/min(m,n)!
. So, I guess that was the problem.
@zwhitchcox Yes, sorry for not making it clearer, n
denotes the total elements (m + n
) in the formula.
No! Don't be sorry! Thanks so much for posting your solutions, they are very helpful to me.
It makes a lot more sense now :)...had to watch a few khan academy videos though
So, the actual formula would be (m+n)!/(n!*m!)
in case anyone else has trouble with this
The formula you gave seems incorrect to me. I know you said it's high school math, but I guess I forgot it.
It works, for the example, but I don't see how it could work for many other ones.
For example, say you have a 3x3 matrix. With your formula, it would be
3!/(3!*(3 - 3)!) = 1
. It seems to me like there would be more than one way to make it down in a 3 by 3 matrix. In fact, matrix with the same number of rows and columns would equal 1 with the formulan! / r!(n-r)!
.Am I missing something here?