Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

my question is pretty much the same as the one asked here: Notation for sampling random variate (I did not find a satisfying answer there...):

I have a random variable $X \sim U(1, 10)$. I want to define a function $f : [n] \mapsto \mathbb{R}$ (or an $n$-dimensional vector if you prefer) which is supposed to evaluate for each $i \in [n]$ to one value sampled from $X$.

I am describing how I generate data for a problem, internally I am using the C++11 random generator described here:

I am unsure how to write this as a formula, especially if I use some more complex way of computing the function, for example flipping a coin to decide whether I choose the value for one $i$ from one distribution or another.

share|cite|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.