Questions tagged [random]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Random number generator and put that in my function

I want to have 100 random numbers from the range i=0.1 to 100. And then, I want to use them in a nonlinear model and extract the random number and the dependent variable in excel format. Is there any ...
4
votes
2answers
70 views

How to find random values of variable satisfying multiple conditions?

I have multiple conditions to be satisfied ...
0
votes
0answers
23 views

ItoProcess with WhiteNoiseProcess

Is there a way to use ItoProcess with a white noise process, instead of the usual WienerProcess? If I just naively use ...
0
votes
1answer
38 views

Can the WishartMatrixDistribution command be used for generating random density matrices?

I am interested in generating random members of two classes of $n \times n$ positive-definite matrices $A$ and $B$--the former symmetric in nature, the latter, Hermitian. The standard (Ginibre-matrix-...
0
votes
1answer
47 views

Obtain fairly sampled data set subject to a condition?

I need to obtain a random distribution of some parameters {t1,t2,t3} subject to a set of conditions. For example, ...
0
votes
0answers
51 views

Generating and operating with random number

I'm working basically with the creation of random numbers that represent the positions of $N$ electrons within a box. Later, I sum all the individual electric fields generated by the electrons, thus ...
0
votes
1answer
27 views

How to find multiple groups of solutions that meet the requirements

I want to find multiple nonzero real matrices A, B that satisfy $A.B=\mathbf{0}$ condition. ...
0
votes
1answer
62 views

Generate random matrix with specific eigenvalues [duplicate]

I want to generate some matrices of order 3 with eigenvalues 1,2, -2. ...
0
votes
1answer
35 views

How to quickly generate a nilpotent matrix?

At present, I want to generate some random matrices whose nth power is zero matrix. ...
0
votes
1answer
46 views

RandomReal inside a loop

I want to perform the following series summation: $$\sum_{j=1}^5 \exp\left[{-\beta \, \left(\text{En} + \frac{\Delta \, X}{Num} \right)}\right] \cos{\left(\text{En} + \frac{\Delta \, X \, T}{Num} \...
0
votes
0answers
37 views

Using RandomVariate in a NDSolve

I want to solve a version of the Langevin's equation using RandomVariante with a normal distribution. Therefore, I used the next code: ...
1
vote
1answer
28 views

Select a subsequence of a sequence according to tosses of a biased coin

I have a sequence, from which I would like to select a subsequence, each term of the original sequence being included in the subsequence with probability $p$, independently of the other terms. That is,...
2
votes
3answers
140 views

RandomPoint fails for any higher dimension

region = ImplicitRegion[x^2 + y^2 + z^2 + p^2 == 1, {x, y, z, p}]; RandomPoint[region] The result is RandomPoint[ImplicitRegion[x^2 + y^2 + z^2 + p^2 == 1, {x, y, z, p}]],and how can I attain two ...
6
votes
1answer
49 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 ...
4
votes
2answers
134 views

How to add Spheres[] sequentially from the surface of preexisting spheres?

I'd like to connect many spheres, by adding a new sphere at some point that's sitting on the surface of a previous sphere. How could we do this? Suppose I have a unit sphere and a point on it: ...
7
votes
1answer
111 views

How to distribute points on a Sphere[] cap from a normal distribution?

I was wondering if one could distribute points on a "cap" of a sphere, following a normal distribution of the points instead of a uniform distribution. This normal could be centered at the ...
2
votes
1answer
86 views

Dynamic Update for 2D Random Walk

I have code for a random walk ...
0
votes
0answers
28 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 ...
3
votes
2answers
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 ...
3
votes
2answers
135 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 ...
3
votes
1answer
75 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: ...
1
vote
1answer
45 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 ...
2
votes
1answer
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 ...
4
votes
1answer
129 views

RandomVariate cannot sample from a custom multivariate ProbabilityDistribution

Let us try to define 2D distribution through PDF: ...
1
vote
2answers
78 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 ...
0
votes
1answer
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: ...
2
votes
3answers
113 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 ...
0
votes
0answers
25 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 ...
3
votes
2answers
162 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. ...
4
votes
1answer
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 ...
2
votes
0answers
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 ...
1
vote
1answer
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 ...
2
votes
1answer
97 views

How to create random graph with certain properties?

My question consists of two parts. How to create a random undirected connected graph s.t. the probability of the event "The degree of a vertex equals k" is equal to $\frac{k^{-\gamma }}{\zeta (\...
0
votes
3answers
62 views

create a rank 1 matrix from two vectors

I've seen the answers 1 and 2 about the transposition and creation of rank $m$ matrices. What I'd like to do is first create a random vector, which I know how to do with ...
0
votes
1answer
106 views

Sampling two integer lists of given sizes from a distribution that have equal sums

(This question emerged from discussions in this post.) Context and code sample: I am trying to figure out if there is a way to generate two $a$ and $b,$ comprised of $n_a$ and $n_b$ integers which ...
4
votes
1answer
65 views

Generating vectors with small inner products in a large vector space

I want to generate a large number $k$ of vectors of norm 1 in a $d$ dimensional vector space such that $k>d$. I want these vectors to have inner products as small as possible. A crude way is to ...
0
votes
0answers
28 views

Simulation of a compound renewal process with copula dependency

I'm new to Mathematica and this is brief about my project that I would like to seek advice from this group about my coding. My project is to perform 100 simulations with 1000 iteration each based on ...
7
votes
0answers
262 views

Making cool animations of an accretion disk/planetary disk

I am trying to make an animation of an accretion disk or a planetary disk. For example, a cool disk showing below (created by NAHKS TR'EHNL): or in this link Here is what I have tried so far: step1:...
2
votes
1answer
136 views

Generating random vectors using Mathematica and an inequality

Consider $n$-dimensional vectors $c^i = \left(c^i_1, c^i_2 ...c^i_n \right)$ , whose entries are complex and generated at random. These vectors are normalized such that $$|c^i|^2 = 1.$$ Using ...
11
votes
2answers
667 views

How to generate a random integer array satisfying complex constraints

I want to generate several random arrays {x1,x2,x3,x4,x5} that satisfy the following complex constraints: ...
0
votes
0answers
44 views

How to add a number, say, 1 to a random real number in Mathematica? [duplicate]

I wish to add, say, 1 to a random real number, say between 1/3 and 1/6. I have used the following code in Mathematica, but it does not answer properly. code: p := RandomReal[1/6,1/3] q:=p+1 p ...
7
votes
3answers
134 views

Specifying range in RandomReal

Is it possible to define the specific range of a RandomReal array for each coordinate? For example, the code ...
10
votes
4answers
328 views

What is the optimal way to create a recombined version of two lists?

I would like to randomly recombine two lists of the following form: l1 = {a,b,c,d,e,f} l2 = {1,2,3,4,5,6} Where their recombination is similar to that of DNA, so ...
2
votes
0answers
76 views

Random Number Generation using LogNormalDistribution

I have a problem that I can't seem to figure out on my own due to limited knowledge of mathematics, and I was hoping I could seek help from the community. I would like to use ...
9
votes
1answer
317 views

How can I solve a nonlinear equation using a Monte Carlo method?

I know FindRoot can solve nonlinear equations, but now I'm interested in solving such an equation using a Monte Carlo method. Can somebody show how that could be ...
0
votes
1answer
62 views

Problem with iterations of Prepend/While

I am doing some work with black-scholes and am trying to find random interest rates based on some given information. This is my original code: ...
6
votes
4answers
358 views

How can I generate random matrices with certain requirements for the entries?

I would like to generate random 9x9 matrices, which contain only the digits 1-9, each one appearing exactly ...
2
votes
1answer
108 views

How to put a loop in a loop

I am doing some work with black-scholes. As commented within my code, I need my while loop to run 100 times. I am not sure if the best way to do this is with a nested argument or placing a for loop or ...
3
votes
2answers
72 views

Quickly generate random text

I am writing some tests and would like to introduce large chunks of random alphabetic text (just characters a-z) to the input. The way I am generating the text now is like this: ...
7
votes
2answers
227 views

Randomly generated coordinates

I want to code that will do the following: Write a Mathematica function called randomHop that takes as its argument a list containing two coordinates x and y; ...

1
2 3 4 5
15