Questions tagged [simulation]

A vast area which includes generating results from computer models.

Simulation is the imitation of the operation of a real-world process or system over time. The act of simulating something first requires that a model be developed; this model represents the key characteristics or behaviors/functions of the selected physical or abstract system or process. The model represents the system itself, whereas the simulation represents the operation of the system over time

(source: Wikipedia)

For understanding when to use simulation, refer to the following question:

When to use simulations?

648 questions
50
votes
2 answers

Why is this coin-flipping probability problem unsolved?

You play a game flipping a fair coin. You may stop after any trial, at which point you are paid in dollars the percentage of heads flipped. So if on the first trial you flip a head, you should stop and earn \$100 because you have 100% heads. If…
50
votes
7 answers

What is the optimal path between $2$ fixed points around an invisible obstructing wall?

Every day you walk from point A to point B, which are $3$ miles apart. There is a $50$% chance each walk that there is an invisible wall somewhere strictly between the two points (never at A or B). The wall extends $1$ mile in each direction…
46
votes
2 answers

Generate Correlated Normal Random Variables

I know that for the $2$-dimensional case: given a correlation $\rho$ you can generate the first and second values, $ X_1 $ and $X_2$, from the standard normal distribution. Then from there make $X_3$ a linear combination of the two $X_3 = \rho X_1 +…
jameselmore
  • 5,038
  • 3
  • 24
  • 36
41
votes
1 answer

What are ways to compute polynomials that converge from above and below to a continuous and bounded function on $[0,1]$?

Background We're given a coin that shows heads with an unknown probability, $\lambda$. The goal is to use that coin (and possibly also a fair coin) to build a "new" coin that shows heads with a probability that depends on $\lambda$, call it…
25
votes
2 answers

Implementing Ornstein–Uhlenbeck in Matlab

I am reading this article on Wikipedia, where three sample paths of different OU-processes are plotted. I would like to do the same to learn how this works, but I face troubles implementing it in Matlab. I think I have to discretize this equation…
15
votes
3 answers

Simulating uniformly on $S^1=\{x \in \mathbb{R}^n \mid \|x\|_1=1\}$

A scheme to generate random variates distributed uniformly in $S^2=\{x\in \mathbb{R}^n \mid \|x\|_2=1\}$ is well known: generate a standard normal variate in $\mathbb{R}^n$ and normalize it to unit norm. Is there a similarly simple and clever…
gappy
  • 709
  • 4
  • 14
14
votes
4 answers

Double obstructing wall problem, what is the optimal walk path and length?

Every day, you walk from point A to point B which are exactly $2$ miles apart straight line distance, however, each day, there is a $50$% chance of there being an obstructing wall perpendicular to the direct AB segment. The wall cannot be seen so…
David
  • 1,654
  • 1
  • 21
  • 40
14
votes
3 answers

Why can't you simulate isotropic fluid flow on a square lattice?

There are easy methods for discrete simulations of gas dispersion in two dimensions. If you take a large square lattice, each cell of which is assumed to contain at most one gas molecule, and you move the molecules from cell to adjacent cell at…
MJD
  • 62,206
  • 36
  • 276
  • 489
12
votes
3 answers

Probability that a quadratic equation with random coefficients has real roots

Consider quadratic equations $Ax^2 + Bx + C = 0$ in which $A$, $B$, and $C$ are independently distributed $\mathsf{Unif}(0,1)$. What is the probability that the roots of such an equation are real? This problem is from Chapter 3 of Rice:…
BruceET
  • 49,222
  • 8
  • 26
  • 59
11
votes
2 answers

Distribution of time spent above $0$ by a Brownian Bridge.

Let's say I have a Brownian motion, such that I know its value at time 0 (0) and time T (also 0). I am trying to evaluate the time spent above 0 between time 0 and T. Obviously I know that the average of this value is 1/2, but is there a way to know…
lezebulon
  • 1,264
  • 1
  • 13
  • 19
9
votes
2 answers

Numerical approximation of Levy Flight

I'm trying to produce a computer simulation of a Levy Flight in 2-dimensions; an approximation would be ok. Please excuse the simplistic level of this question: my maths is very rusty. My proposed method of plotting the Levy Flight is as follows:…
Richard Inglis
  • 429
  • 5
  • 12
9
votes
3 answers

Why is a simulation of a probability experiment off by a factor of 10?

From a university homework assignment: There are $8$ numbered cells and $12$ indistinct balls. All $12$ balls are randomly divided between all of the $8$ cells. What is the probability that there is not a single empty cell ($i.e.$ each cell has at…
9
votes
1 answer

Can you simulate from a cantor distribution?

Has someone run across a method for generating random variates from a Cantor Distribution? It seems like its abstract definition prevents this. In essence, can one "invert" the Cantor Function?
user76844
8
votes
0 answers

Proving that Markov Chain Monte Carlo converges

I am trying to understand how the very basic Markov Chain Monte Carlo approach works: We try to approximately calculate the expected value $E_{\pi(x)}[X]$ by drawing sequential samples from a Markov Chain $(x_0,x_1,...)$ with the stationary…
8
votes
1 answer

How to generate sample from bimodal distribution?

Is there any "classical" distribution that is considered bimodal? For example, "Normal" is unimodal, "Gamma" is unimodal. If I have to generate a sample of 100 numbers from a univariate bimodal distribution, how should I proceed with that? I think…
Vika
  • 427
  • 1
  • 4
  • 12
1
2 3
43 44