# Questions tagged [random]

Questions about random number generation and the properties of numbers so generated.

693 questions
Filter by
Sorted by
Tagged with
46 views

### Generate a random list that have 2 different ranges in 2 dimensions

Here is my thing. Each element in the list has its own range. {RandomReal[{0, 1}], RandomReal[{0, 2 Pi}]} This code alone can only generate a point. Is it ...
80 views

### Dynamic Update for 2D Random Walk

I have code for a random walk ...
25 views

### Correlated random variables

Assume we have a random variable $X(t)$ that changes as a function of time satisfying a correlation $\left\langle X(0) X(\tau) \right\rangle=e^{-\tau/\tau_c}$. Is Mathematica able to generate random ...
66 views

### Random Sample from Very Large Table

I'm currently trying to create some test data to check a numerical implementation against Mathematica's implementation of some functions. In order to do this, I've been generating a broad range of ...
123 views

### Adding noise to the data

I am trying to write a Kalman Filter for airplane radar tracking, so I generated testing data and now I want to add some white noise to this data. I have tried doing this, but it didn't help. So far I ...
70 views

### CURAND library import error to Mathematica/Wolfram 12.1

I used Mathematica/wolfram 12.1 IDE and installed CUDA toolkit 10.2. All installed correct. I try to use library CURAND with #include with random integer generator on CUDA, but get a error: ...
44 views

### How to get a RandomFraction in (0,M)?

The following code M= 5/10; A = ImplicitRegion[0< x < M, {x}]; RandomPoint[A] gives a random decimal $x\in(0,M)$. How can I get an exact fraction ...
26 views

### RandomPrime inside Manipulate gets evaluated multiple times

Manipulate[ m = RandomPrime[d]; {m, d}, {d, {20, 50}, SetterBar} ] Basically, I expected the code to generate a random prime m (under the upper bound d) for me ...
124 views

### RandomVariate cannot sample from a custom multivariate ProbabilityDistribution

Let us try to define 2D distribution through PDF: ...
77 views

### How to run 1000 examples of matrices

I have two functions of matrices, let say $f(A,\,B)$ and $g(A,\,B)$, where $A,\,B$ are positive semidefinite matrices. I want to check if $f(A, B)$ is greater than $g(A,\,B)$ for any $A,\,B > 0$. I ...
16 views

### Calculation time differs between segmented loops and one whole loop

I stumbled on a strange issue while simulating a large number of random values, $10^8$ to be precise. I generated the numbers at first by the following code: ...
91 views

### Compute volume of ellipsoid using Monte Carlo methods

I have following code in Mathematica: https://pastebin.com/zRB9vEx8 and I need to compute volume of ellipsoid with given parameters: $$\frac{x^2}{9} + \frac{y^2}{4} + \frac{z^2}{4} = 1$$ Can anyone ...
21 views

### Conditional Loops with Random Samples

I would like to simulate the following process: Pick a random number between 0 and 1. Choose a final time $t_f$. Evolve a (complicated) function $f[t]$ from $t=0$ with small timesteps $\delta t$ (the ...
94 views

### Finding 36 integer solutions to a set of 14 equations using various boundary conditions

What is good way to solve this system of equations? I have it run now for quite some time and it does not spit out a solution. ...
98 views

### Conditional Random Walk

I am attempting to model a physical process I'm observing in the lab with a random walk generator. I need to find a way to impose a condition such that when the random walk runs into a point in the ...
44 views

### How is a Lévy stabile process pdf normalized?

I'm interested in how to deal with α-stabile probability density functions, for example one with the Laplace image like: $\phi(s) = s^{(\alpha-1)}*e^{-\nu s^{\alpha}}$ I can work with this ...
30 views

### Can I sample from a distribution whose parameters depend on the current iteration?

Let's say I want to sample from 100 Beta distributions, and in each successive one, the first parameter increases by 1. So given a current iteration number n, I ...
94 views

123 views

### Evaluate a parametric function dependent on a random number of parameters

This is a question related to the evaluation of a parametric function dependent on a random number of parameters. Consider a "blackBox" that returns a parametric function dependent on time (t) and, ...
2k views

### Efficiently finding furthest two nodes in a graph

I am trying to learn how in an efficient way can one find the diameter of a random graph, that is, the longest shortest path, and its corresponding end-nodes. The direct built-in function ...
24 views

### Optimizing and Parallel Computing for Large Dyadic Intervals

I need help with the efficiency of my code i.e. less time so I can compute for large range of values. My function n[x] takes in a number x and outputs the ...
245 views

### Manipulate a list: replace random position of a specific integer n times by 0

I have this matrix with 3 sublists: d = {{1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0}, {0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1}, {0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0}}; For ...
662 views

### How can I shorten the calculation time effectively?

I try to do a big simulation like below. (However, I do not change the sizes I want to 10 ^ 5, 10 ^ 7, 10 ^ 9.) ...
935 views

### Better random (unique) file name

In order to avoid conflict with file names produced by some code running in multiple instances of Mathematica I append the date and a random string at the end hoping to create a unique filename. The ...