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$.

  • $\begingroup$ Do you have an example? $\endgroup$ – Amzoti Oct 31 '13 at 17:05
  • $\begingroup$ 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[ $\endgroup$ – 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

  • 3
    $\begingroup$ This doesn't seem to work anymore. $\endgroup$ – Skeen Oct 10 '17 at 18:38
  • $\begingroup$ @Skeen Pardon me, but my link seems to work. Funny enough, even assuming x natural works (just click the link) $\endgroup$ – AlexR Oct 10 '17 at 21:20
  • $\begingroup$ 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. $\endgroup$ – Skeen Oct 11 '17 at 15:03
  • $\begingroup$ 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. $\endgroup$ – 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.



Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.