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:

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?

  • 1
    $\begingroup$ I would rather just use Mathematica syntax. In this way you can also run your code in Mathematica, not just on WolframAlpha. $\endgroup$ – ablmf Jan 12 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.