The following is a way to use tilde (∼) in context of random variables or random vectors.

In statistics, the tilde is frequently used to mean "has the distribution (of)," for instance, $X∼N(0,1)$ means "the stochastic (random) variable $X$ has the distribution $N(0,1)$ (the standard normal distribution). If X and Y are stochastic variables then $X∼Y$ means "$X$ has the same distribution as $Y$.

Consider the following usage of tilde in the paper titled Generative Adversarial Nets

$$x ∼ p_{data}(x)$$ $$z ∼ p_z(z)$$

I am thinking that the following is the standard (and possibly correct) notation

$$x ∼ p_{data}$$ $$z ∼ p_z$$

$p_{data}$ is a probability distribution and $p_{data}(x)$ is not a probability distribution and it is a value in $[0, 1]$. It is same in case of noise probability distribution.

Is it an abuse of notation to use in such a way or is it also a standard and allowed notation to use?

  • $\begingroup$ Comments are not for extended discussion; this conversation has been moved to chat. $\endgroup$
    – Dennis Soemers
    Commented Aug 1, 2021 at 13:38
  • 1
    $\begingroup$ Since the question is now closed as off-topic by the community, I honestly hope that it will not be re-opened unilaterally by the mod that has an obvious conflict of interest (i.e. has provided an answer below), at least not without a discussion in Meta. As it seems, the community has real concerns about if such a question about general mathematical notation, and tagged as probability and random-variable, has really anything specific to do with AI, just because it happened to be stumbled upon in a ML paper. $\endgroup$
    – desertnaut
    Commented Aug 2, 2021 at 8:39
  • 1
    $\begingroup$ Most of the AI textbooks has initial units dedicated to Mathematics useful to AI. So, I think these are on-topic. If some maths question is asked that is not directly or indirectly related to AI, then it can be off-topic. $\endgroup$
    – hanugm
    Commented Aug 2, 2021 at 9:23

1 Answer 1


The notation $p(x)$ is widely used in machine learning (e.g. here) and even statistics (e.g. here). People often use $p(x)$ to refer to a probability distribution (either pmf, pdf, or cdf) rather than just $p$. There is also the notation $p_x$ (or things like $p_{x \mid y}$ for conditional p.d.s), which you will find in some statistics books.

Of course, if you interpret the notation $p(x)$ as the evaluation of e.g. the pdf at $x$, it's a density value, so not a p.d. However, I think, in your case, $p(x)$ is used as $p_x$, i.e. to emphasize that the pd $p$ is associated with the r.v. $x$ or that it's a function of one variable (in this case denoted by $x$ to remind the reader that this pd is associated with the r.v. $x$). That's how I would interpret that notation in this case.

This can be useful if you use the letter $p$ to denote multiple p.d.s associated with different r.v.s (which is often the case); so, by using $p_x$ or $p(z)$, you make it clear which r.v. $p$ is associated with.

I looked at the GAN paper, and sometimes they use $z \sim p_z(z)$ and other times $z \sim p_z$, so there are some inconsistencies in the paper, which is not so uncommon in machine learning papers (sometimes people do that just to avoid verbosity).

One that knows the mathematical definition of an r.v. will also know that an r.v. is a function. So, if $p$ is e.g. a pdf and $x$ in $p(x)$ is an r.v., then $p(x)$ would be a composition of functions. I don't think that people use the notation $p(x)$ for that case, as this can become more complicated: we can easily start to talk about measure theory or pushforward measures (which I only barely heard of). I think that many people in the machine learning community do not have a formal statistics or mathematical background, so they probably just use $p(x)$ because everyone else does.

In this answer that I wrote a while ago, I also say that $p(x)$ could be a shorthand for $p(x = x_i)$, i.e. the probability that $x = x_i$ (some event). This is also common, but that's not how I would interpret $p(x)$ in your case.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .