Questions tagged [random]

Questions relating to (pseudo)randomness, random oracles, and stochastic processes.

1860 questions
1
vote
1 answer

Write a one-liner function to return a random integer with decreasing chances as it gets higher

I am a computer programmer and I would like to write a simple formula that would return a random integer, but I’d like to decrease the chance of getting a value as it increases. i.e., if I want to get an integer between 1 and 4, I would like this…
1
vote
1 answer

Approximating the uniform distribution on an interval with a distribution on the rationals

Does there exist a function $p:\mathbb{Q}\cap[0,1]\to\mathbb{R}$ st. for any continuous $f:[0,1]\to\mathbb{R}$ we have $\sum_{x\in \mathbb{Q}\cap [0,1]} f(x)p(x) =\int_0^1 f(x)dx$? If this is not possible, then how about other classes of functions…
Mathew
  • 1,894
1
vote
1 answer

Are probabilities of repeated independent random events gauranteed to deviate from the expected propabilities by any constant number of experiments?

So if I roll a die, there is a $1/6$ chance that I get let's say a 1. From my understanding, this implies that if I were to pick any tolerance $\theta > 0$, and then repeatedly roll the die, It is guaranteed that eventually the proportion of 1's…
Zachiah
  • 123
1
vote
0 answers

Generate random perturbation without revealing the source

Given a vector as an answer, I'd like to generate misleading answers for a multiple choice question. The first idea is to add random perturbation. However, the right answer will tend to be close to the average of all answers. Can I do something…
1
vote
0 answers

Distinguishing randomness and pseudo randomness

Thank you for giving me feedback about how my question was ambiguous. Sorry for the confusion, and I reformulated my question. Reformulation: Let's say a black box is giving me a real number every second in a truly random way. By truly random, I…
1
vote
1 answer

Doubt in Discrete-Event System Simulation by Jerry Banks,4th Edition

I'm new to the Math forum here, so pardon my question if it seems juvenile to some. I've googled intensively,gone through wikipedia,wolfram and after hitting dead ends everywhere have resorted to this site. My query is this- In chapter#8,…
1
vote
1 answer

Generating a sequence of $n$-bit random-like numbers that will never repeat.

I am actually aiming for n $\approx 100$ but obviously I could interleave the bits of two never-repeating $50$-bit sequences etc. I need to be able to generate the $n^{th}$ number quickly enough to seem instantaneous to a human. After that, finding…
1
vote
1 answer

Generate 3 random numbers such that the sum is below a number, or within a range

I'm writing a program for fun which generates random colours for text. (If you're curious: https://github.com/Arunscape/acat) So, I have 3 variables $r, g$, and $b$ , each of which can be any integer $\in [0, 256)$ I figure that if I want dark text…
1
vote
1 answer

Find parameters of Linear Congruential Generator?

Given 2 successive numbers produced by the LCG (Linear Congruential Generator) $x_{n+1} = (a \cdot x_n + c) \bmod m.$, how can I determine the parameters of this LCG? Assuming that $m$ is given. Given that there are several candidate LCGs, how is…
aquila
  • 105
1
vote
1 answer

Is there a way of generating true random numbers only using pure maths?

I know that true random numbers can be generated using measurements taken from the atmosphere, but is there any way of doing this mathematically, without any measurements taken from the external world?
Joe
  • 19,636
1
vote
1 answer

Random number generator based on probability distribution

1) What are the formulas for function 'random' and 'wblrnd' to generate the random numbers? assuming that I need these formula for coding in C++. 2) What are the differences between random numbers generated from function 'random' and 'wblrnd' for…
Sata
  • 13
1
vote
0 answers

How to calculate the derivative of a random variable to one of the parameters?

So, I have a function: $f(x) = a\cdot x + b\cdot x + \varepsilon$, where $\varepsilon \sim \mathcal{N}(0, a+2b)$ I want to derive this function to one of the parameters (for example $a$) when performing a sensitivity analysis, but I get stuck with…
1
vote
1 answer

How to crack a Linear Congruential Generator (LCG)

The full question is: How to crack a Linear Congruential Generator when a, c and m in the LCG formula. I googled this question and I found what I wanted: here is the question:…
1
vote
1 answer

If I have a set of numbers, how can I prove that they are random?

If someone gives me a list of numbers and says they are entirely and completely random, how I can I verify this? EDIT: Let's suppose that a well-known string theorist told me he can produce a list of numbers that is truly, genuinely random. If I…
Nick
  • 997
  • 1
  • 10
  • 21
1
vote
2 answers

Why do we even attempt to predict random numbers when they are by definition, "random"?

I've been given the task of writing an algorithm to predict the next value of the Mackey glass time series, given 4 past values using neural networks, so I want to understand how that makes sense. I know random number generators are pseudo random.…
Nav
  • 368