Ever since I began using Wolfram Alpha for quick online calculations I have had trouble specifying the domain of my variables. Note that I have already read the related MSO question "Tell Wolfram Alpha that a variable is a natural number", but that did not help.
Let's take a minimal simple example: expanding the binomial coefficient $2n \choose n$. Of course, depending on $n$ we have vastly different results. For instance, the formula ${\displaystyle {\binom {n}{k}}={\frac {n!}{k!(n-k)!}}}$ is only valid for positive integers $n$ and $k$, while ${n \choose k}={\frac {\Gamma (n+1)}{\Gamma (k+1)\Gamma (n-k+1)}}$ is valid for complex $n$ and $k$. Naturally, in such a simple case there is no real difference, but in more complex queries there is.
If we try "Expand (2n choose n)" with Alpha, we will not get the desired result if we want $n\in\mathbb{Z}$. So, following several pieces of advice found commonly in other forums, we try the following, without success:
- "Expand (2n choose n), assuming n integer" gives "closest Wolfram|Alpha interpretation: choose assuming integer",
- "Expand (2n choose n), for n integer" gives "closest Wolfram|Alpha interpretation: expand (2n n), n",
- "Expand (2n choose n), for integer n" gives "closest Wolfram|Alpha interpretation: expand (2n n)",
- and so forth with many variations of the above.
This same scenario arises in many situations where I need Alpha to understand that my variable is in a certain domain. I know Alpha understands Mathematica syntax to some extent, but I do not want to start mixing Alpha and Mathematica syntax as it quickly becomes confusing for larger inputs. Moreover, Alpha was designed to process more "human" inputs.
So is there any way of telling Alpha that my variable is part of a given domain in a simple way?