# Tell Wolfram Alpha that a variable is a natural number

How can I tell Wolfram Alpha that some variables are natural numbers, when I want to solve a equation?

An example of what I want to do:

$\binom{n}{k}\cdot p^k \cdot (1-p)^{n-k} = \frac{1}{\sqrt{n\cdot p \cdot (1-p)}}\cdot \frac{1}{\sqrt{2 \cdot \pi}} \cdot e^{-\frac{1}{2} \cdot \left(\frac{x-np}{\sqrt{n \cdot p \cdot (1-p)}}\right)^2}$ solve for $x$ with $n,k \in \mathbb{N}$, $0 \lt p \lt 1$.

• Do you have an example? – Amzoti Oct 31 '13 at 17:05
• i have the same problem, here's an example @Amzoti : sum_{i=1}^{infinity}(1/2)^i*(1-p)^(i-1) assuming p in ]0,1[ – philx_x Apr 26 '17 at 9:04

Just add an "assuming x integer" at the end. I tested it, and it seems to work. (similar to Maple's notation assuming x::integer, I guess) For natural it doesn't seem to work properly: assuming x natural

• This doesn't seem to work anymore. – Skeen Oct 10 '17 at 18:38
• @Skeen Pardon me, but my link seems to work. Funny enough, even assuming x natural works (just click the link) – AlexR Oct 10 '17 at 21:20
• I'm getting this: Wolfram|Alpha does not yet know how to respond to your exact query. The "closest interpretation" is based on lexical and semantic similarity in Wolfram|Alpha's computable knowledge space. – Skeen Oct 11 '17 at 15:03
• Can you give a link? As I said, I have no problem with the link in my Answer - it simplifies Gamma(x) to (x+1)! using the assumption that x is an integer. – AlexR Oct 11 '17 at 16:08

It depends on how you are trying what it is you are trying to solve. Telling Mathematica that something is an integer has a different syntax depending on what you are trying to do.

Assuming that you are using the "Solve" function, it would look like this:

Solve[(x - 3/2) (x - 2)== 0 && x $\in$ Integers]

Solve[ ..., Element[..., Integers]]

As dirty as this is, I've used modulus 1 to force numbers to be integers. Combine with a >= 0 restriction and you can reach Natural numbers.

Example