# Questions tagged [simulation]

A vast area which includes generating results from computer models.

715 questions
Filter by
Sorted by
Tagged with
1 vote
46 views

### How to correctly simulate splitting in blackjack

I'm writing a probabilistic simulator for blackjack that returns the best action and expected profit for a given hand, dealer up card, and unseen cards (by calculating all possible scenarios, not ...
1 vote
53 views

### Economic elasticity from a continuous-time dynamical systems perspective

I note that in system dynamics (Forrester (1961) Industrial Dynamics; Sterman (2000) Business Dynamics), which is applying differential-equation models to the social sciences, the concept of ...
• 115
59 views

### Fractal Subdivision for Procedural Generation

This is my first attempt at creating a thread here, thus I'm not sure how much context I need to provide you. Please leave a commend if you need additional info. With that disclaimer out of the way, ...
18 views

### Benchmark Neural Networks on High-Dimensional Functions

For a personal project, I am interested in benchmarking certain neural network architectures in the context of high-dimensional function approximation. Specifically, I am interested in continuous, ...
• 1,257
1 vote
45 views

### How to correctly calculate Poisson's equation for electric potential using FFT with zero-padding?

I'm working on a program that simulates the electrostatic field in 3D using FFT to solve Poisson's equations based on the following formulas: $$\phi_{(k)} = \frac{\rho_{(k)}}{\epsilon_0 \times K^2}$$...
46 views

### Two SDEs that share a Brownian motion

I have the system \begin{align} dX_t & = \beta(\alpha - X_t)dt + Y_t dt + dB^1_t + dB^2_t \newline dY_t & = \beta(\alpha - Y_t)dt + X_t dt + dB^2_t + dB^3_t \end{align} Now, I am creating a ...
• 13
1 vote
141 views

### Calculating probability of an analogy in Francis Crick’s book Life Itself

There is, in fact, a vanishingly small hope of even a billion monkeys, on a billion typewriters, ever typing correctly even one sonnet of Shakespeare’s during the present lifetime of the universe.(see ...
17 views

### Predicting simulated data for a known curve

I am a newbie here seeking advice on a mathematical problem I am currently having in my research. I have a pre-existing curve created by extrapolating known fitted experimental data. As shown below, ...
• 1
35 views

### Circular Breakout Game: time or collisions needed to reach nth layer

Shower thoughts... A tiny ball starts inside a unit circle, surrounded by fixed concentric circles of increasing integer radius length. So it starts in is the 0-th "level". The ball moves in ...
• 406
25 views

### Understanding Perimeter of Infected Area in Chessboard Virus Puzzle

In the Chess Board Virus Simulation found here: https://ves.ac.in/wp-content/uploads/sites/11/2015/12/Mangala_Gurjar_-_Use_of_invariants.pdf, I'm trying to understand the following statement: "...
1 vote
53 views

### How to check if a set of randomly generated data matches a given distribution?

I have a random number generator that should generate values based on a Beta 4,4 distribution and some minimum and maximum. (IE, values between 0.9 and 1.1) I can generate a large set of numbers using ...
22 views

### How to factor in skewness when multiplying distributions

I am trying to simulate compounding interest on an investment modeled as a distribution. In the interest of efficiency I want to do this directly, but to test I ran a monte carlo simulation to ...
38 views

### Exit time squared of 3D Brownian motion

I am running simulations of 3D Brownian motion (starting at the origin in $\mathbb{R}^3$), recording the exit time from the unit-sphere, and plotting them all in a normalized histogram in order to fit ...
• 81
1 vote
36 views

### Stable timestep criterion for variable density acoustic wave equation

As part of my PhD, I am implementing the isotropic variable density acoustic wave equation numerically with finite-difference and I have a question regarding its stable timestep criterion. The ...
• 11
30 views

### Number of distinct urns given randomly selected balls

Suppose, we have N distinct urns each having some number of balls $\ge$ 1. The distribution of balls in the urns follows a zero-truncated Poisson distribution with given $\lambda$. If we take out all ...
70 views

### Getting closest relative position of a point in a toroidal space [closed]

I am writing a boid simulation in a toroidal space. The boids wrap around from the left to right edge and the top to bottom edge. To calculate what boids are visible, I need to find the minimum ...
• 21
76 views

### What is the correct MSD function for a biased random walk on a triangular grid?

I am trying to determine the mean squared displacement $\langle r^2\rangle$ as a function of time for a discrete random walk process on a triangular grid, where each step is of size $\ell$ over a time ...
• 341
56 views

### calculating the probability of winning a streak, what approach should I take? [closed]

Here is the game: $A$ plays against $B$. Each round, $A$ has probability $a$ of winning, $B$ has a probability $b$ of winning, and the probability of a draw is $d$. So $a+b+d=1$. Each round is ...
67 views

### Simulating an ODE

I am trying to simulate a ODE system written in the caption of Fig. 4 in the paper on Contraction of monotone phase-coupled oscillators. $$\dot\theta_i=\sum_{j}A_{ij}\cdot\eta(\theta_i-\theta_j)$$ ...
• 1,052
1 vote
31 views

### Metropolis Hastings with proposal of different support

I've been studying Metropolis Hastings and there is category of problems that troubles me. One approach that I usually use is the following: Given a previous accepted sample $x_t$ I generate a new ...
106 views

### The stationary distribution of a rook's random walk

Let us consider a classic $8\times 8$ chessboard (grid), where a lone rook is doing a random walk. We assume that the rook starts its journey from the $(7, 0)$ square ($A1$), and that there are no ...
• 1,170
1 vote
69 views

### Simulation of a pendulum without using the angle with the Euler-Cromer method.

I am trying to create a computer simulation of a simple pendulum with a mass $m$ hanging from an inextensible and negligibly massless string, but without using the angle, only using the positions of ...
• 31
27 views

### Quaternion derivation and integration for attitude representation in common simulators

I have been checking the derivation and integration of quaternions to implement in my simple drone simulator. The problem is that I'm not sure if I can use a simplification for my case or not. The ...
19 views

### How to use cumulative distribution functions within an interactive simulator

I am building a simple simulator in python that should simulate an event taking place based on its ...
• 101
37 views

### State how inverse-transform sampling produces one random sample of $X$.

Let $0 < p < 1$. Let $X$ be a random one of two objects, coded as $1$ and $2$ , where $\mathbb{P}(x=1)= p$ and $\mathbb{P}(x=2)=1-p$. State how inverse-transform sampling produces one random ...
100 views

### How to simulate from $dY_i=Y_i( \mu dt$ $+ \sigma_{(2)}( \alpha dB^{(1)}_i + \sqrt{1- \alpha ^2} dB^{(2)}_i))$ for $\mu, \sigma>0, \alpha \in [-1,1]$?

I am studying numerical methods from the textbook Monte Carlo Methods in Financial Engineering by Paul Glasserman and have encountered the following exercise: I want to simulate from the stochastic ...
• 4,343
38 views

### Simulate sum of correlated and uncorrelated variables with uncertainty

This is surely a simple question for many. Suppose a sum S of linked variables must be simulated: x: independent variable sampled from empirical pdf. a = f1(x); f1 is a function with uncertainty ...
18 views

### How can I use the Metropolis Hastings Algorithm to sample from a posterior distribution

$$p(x) \propto \exp\left(-\frac{x_1^2}{10} - \frac{x_2^2}{10} - 2(x_2 - x_1^2)^2\right),\\ p(y|x) = \mathcal{N}(y; x_2, 0.1)$$ I want to sample from the posterior arising from this likelihood and ...
• 163
130 views

### Simulating Random Multiples

I was running a statistical simulation, where I'd generate random numbers from 1 to $N$, where $N$ varies from 1 to $10^6$. I would keep generating random numbers until the current random number was a ...
57 views

### Understanding correlation in the context of a time series, simulation and brownian motion

I have the doubt of calulating and meaning of correlation. I know it is from my incapacity to grasp a concept, specially regarding time series but would appreciate any comments on it. I think I ...
53 views

### Point in use of Taylor Series to approximate functions in an age with computers?

I hope this doesn't sound too vague or like I'm dismissing the use of Taylor Series entirely, I'm just curious about any proper real-world applications. Many times Taylor Series are shown-off as a ...
• 73
23 views

### Time step agnostic simulations - is there a general rule?

I'm working on a videogame where part of the logic involves increasing a value each render frame (a render frame is equivalent to a simulation step where the result is drawn on the screen). Frames can ...
35 views

### Mean speed in a network

I am new to this community so I hope this is the rigth place for this question. I am working on traffic simulations on a certain area, and I need to know which is the average speed in the area during ...
• 123
15 views

### Mathematical modelling of resources vs population vs wealth generation and other factors

I was experimenting with ways to model population of some country given its initial population, initial resources and some coefficients to have a control on the population and resources, and I have ...
169 views

### How to tell if a problem has no analytical solution?

Consider the following mathematical problem: Fish Pond: Suppose there is a pond that has $n_1$ fish on the first day ($n_1$ is a positive integer greater than 0) Generate a random number $x_1$ from ~...
• 3,252
29 views

### Discrepancy in Calculating Stationary Distribution of a Markov Chain

I'm studying a Markov chain problem question 15 where a rat runs through a maze with the following transition matrix P: ...
• 91
426 views

• 2,482
1 vote