Why is Wolfram Alpha miscomputing this problem?

284 Views Asked by At

I was incorporating Wolfram Alpha into an API I am build, and to test it entered a few equations. One of the equations I entered was as follows.

!6/(!3*!3)

This obviously equals 20, but my API spat back 66.25!

At first I thought I had mis-coded my API, but then I tried it on WA and got the same result.

Why is WA making this mistake?

3

There are 3 best solutions below

3
On BEST ANSWER

Given that you tagged this with factorial I assume what you meant to write was:

6!/(3!*3!)

You put the ! on the wrong side. n! is n factorial. !n is sub factorial.

Next time just type in the words to make sure you have the right syntax(e.g., factorial(6)((factorial(6)*factorial(6)))

0
On

The issue lay in the fact that the notation $!6$ means something very specific to Wolfram Alpha. You likely want it to mean $6$ factorial (i.e. $6\cdot 5\cdot 4\cdot 3 \cdot 2 \cdot 1$). However Wolfram Alpha interprets $!6$ to be the subfactorial of $6$ which is the number of permutations of $6$ elements which leaves no element fixed. In this case, $!6 = 265$ and $!3 = 2$, giving $\frac{!6}{!3\cdot !3} = \frac{265}{2\cdot 2} = 66.25$ as you obtained. Just put your $!$ on the correct side and you'll be fine. The difference between $n!$ and $!n$ is that $n!$ counts the total number of permutations of $n$ objects, including those that do leave some elements fixed so in general $!n \le n!$.

0
On

Alpha uses the $!x$ notation for

$$\frac{\Gamma(x+1,-1)}{e},$$ where $$\Gamma(x,a)=\int_x^{\infty}t^{-a}e^tdt,$$ the incomplete Gamma function.