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

learn more… | top users | synonyms (1)

6
votes
1answer
189 views

Generating a (random) 2-dimensional cellular network

I want to generate a network of random cells like the following picture: The general idea is to generate some random points (x,y) as coordinate of a vertex and then randomly choose some of these ...
2
votes
1answer
106 views

Expectation of GeometricBrownianMotionProcess

I am trying to compute $$\mathbb E\left[\max\left(\frac{S_{1/2}+S_1}{2}-K,0\right)\right]$$ where $K=100$ and $S_t$ is a geometric brownian motion (with $S_0=100$, drift $r=0.05$ and volatility ...
3
votes
1answer
148 views

How can I selectively trigger computations in Manipulate?

I have a Manipulate that uses RandomVariate and Random that I would like to have redraw and ...
1
vote
1answer
105 views

Need help scoring randomly generated SEC football rankings

So my task is to score all the possible rankings of the 14 SEC football teams and find the best one, using who won in head-to-head games as the sole criterion (so not factoring in strength of schedule ...
8
votes
2answers
233 views

Counting and extracting hit circles/triangles for randomly chosen points

Below, you see a triangle in which the incircle was inscribed. As we know, the center of this circle is the intersection of the angle bisectors. At this point, one could go further and find the ...
6
votes
2answers
157 views

Generated Numbers under a constraint?

Let's say I have five four dimensional vectors $p_i^\mu=(p_i^1,p_i^2,p_i^3,p_i^4)$ with $i=1,2,3,4,5$. Now, I want to fill the entries of these vectors ($4\cdot5=20$ in total) with some numbers, but ...
1
vote
4answers
195 views

How do I create a list of 25 random quadratic equations in the form ax^2+bx+c?

My teacher suggests using the RandomInteger command along with the Factor command, but I cannot figure out the syntax. A, b, and c need to be non zero integers between -10 and 10.
0
votes
0answers
43 views

Using an Interpolating Function as a probability density function [duplicate]

I have seen a couple of similar questions but have not been able to figure out a solution for my particular problem. I have a probability density function of two variables ...
6
votes
3answers
452 views

How to randomly erode a 3D distribution of points with Mma 7.0?

Suppose we have a 3D distribution of points, like the spherical ball example below : ...
-4
votes
1answer
281 views

How to generate this fractal-like 3D distribution of points in Mma 7.0?

I would like to produce some 3D distributions of points using Mathematica 7.0, that look like the picture below : How could I do that ? What are your suggestions ? What Mma 7 codes could do a ...
4
votes
3answers
246 views

Creating a function with integral zeroes of the 0th, 1st, and 2nd derivatives

I would like to be able to randomly generate functions, each of which satisfies $f : [-10, 10] \rightarrow [-10, 10]$ All the zeroes, critical points, and inflection points have an integral ...
2
votes
2answers
77 views

Random Choice: List Format & Minimizing Memory Use

This is a two part question, and for that I apologize.. but they're related! Here's what I'm working with: ...
0
votes
2answers
182 views

Generating a random tree of given cardinality, depth, and labeling

For demo, exploration and teaching purposes, I would like to be able (and asking you for help) to generate these special instances of trees: For given: N - number of nodes in the tree D - depth of ...
3
votes
2answers
51 views

Avoiding RandomVariate update with use of Locator

I am preparing an activity that simulates the response from a noisy spectrometer. The function I use to generate the data has the form: ...
1
vote
1answer
77 views

RandomVariate[LogNormalDistribution] works not as expected

I currently simulate data with a lognormal distributed covariate. I used the following code to check the generated random numbers (with Mathematica 9). ...
1
vote
2answers
194 views

Fast randomization of a graph, while keeping the graph connected

I'm looking for a very efficient method for randomizing graph of a given size (N nodes, L links), but keeping them connected. Assume you have the adjacency matrix A of a given connected graph. You ...
2
votes
1answer
43 views

How to randomly select and open a notebook using CDFPlayer

I have a lesson notebook for a class I am teaching. I'd like to separate the lesson content and the practice problems. Students are using the CDFPlayer program, not Mathematica. I created a button ...
14
votes
3answers
859 views

Finding the volume of a sphere using the Monte Carlo algorithm

I used the following code to find the volume of the sphere $x^2+y^2+z^2 = 1$ in the first octant: ...
9
votes
4answers
331 views

Why is Poisson Random Deviate Generation so slow?

I am generating Poisson deviates for some numerical work. Mathematica 9.0.1 is very slow in generating these random numbers, as can be seen below. ...
2
votes
2answers
147 views

How to restore default seed generation in SeedRandom[] when specifying method?

I want to generate low-discrepancy sequences and for that purpose I use SeedRandom[], like: ...
-1
votes
1answer
54 views

map rational number [duplicate]

I am trying to map this function ((-1)^(1/Denominator[#]))^Numerator[#]==(-1)^#& to a fairly big list of random rational numbers I am trying to get this to ...
1
vote
1answer
83 views

Random number generation from a given distribution [duplicate]

Is there any way to obtain random numbers from a user defined continuous distribution in Mathematica? Thank you very much
1
vote
3answers
148 views

Number theory: Problem involving rational numbers

Use RandomRat to test whether ((-1)^(1/Denominator[q]))^Numerator[q] is identical with ...
8
votes
1answer
430 views

Uniformly distributed n-dimensional probability vectors

What's the right way to generate a random probability vector $p={p_1,\ldots,p_n} \in {(0,1)}^n$ where $\sum_i p_i=1$, uniformly distributed over the $(n-1)$-dimensional simplex? What I have is ...
6
votes
1answer
142 views

RandomVariate does not fill range of PDF of distribution

I've declared my own probability distribution as follows dist[a_, b_] := ProbabilityDistribution[Cos[(b x)/2]^2 Sinc[a x]^2, {x, -400, 400}]; When I try to ...
8
votes
2answers
663 views

How could I generate words starting with P,h,D?

A friend of mine is a PhD candidate and posted a picture on Facebook with funny words starting with 'p', 'h' and 'd' like "Please hire. Desperate" or "Permanent head Damage". I thought I could try and ...
8
votes
3answers
396 views

Create sine function with random increase in phase

I am trying to simulate a signal that randomly increases its phase, so far I have tried two thing but neither worked. I usually use matlab but I want to learn some Mathematica so I thought I would try ...
15
votes
3answers
671 views

Generate a Random Polygon

Does some package exist with a function that takes a parameter $n$ and generates a random 2D $n$-sided simple polygon (convex or non-convex), possibly within a certain bounding box? It does not ...
22
votes
4answers
429 views

obtaining random element of a set given by multiple inequalities

I try to obtain random elements from a set given by multiple inequalities. This is of general interest to me, but let me present one example here: I have multiple inequalities specifying half spaces ...
15
votes
8answers
380 views

Is it possible to use RandomChoice to choose without other choices being evaluated?

I'm trying to do this: i1 = 1; i2 = 1; RandomChoice[{ (i1 = i1 + 1), (i1 = i1 - 1), (i2 = i1 + 1), (i2 = i2 - 1)}] In order to chose randomly which ...
1
vote
2answers
90 views

HoldForm and RandomChoice

I'm trying to get random expressions displaying. For that, I'm starting with addition, multiplication, substraction and division. When trying out this code ...
2
votes
1answer
195 views

How do I get a list of unique random integers? Avoiding numbers being drawn twice [duplicate]

I am trying to get a set of random integers for which I used the function RandomInteger[{1, 50}, 5]. That way, however, there is the chance to get doubles such as ...
1
vote
2answers
518 views

How to generate a random matrix with specific parameters?

I want to use Mathematica to generate a random matrix with given dimensions, entries coming from a finite set, and with a determinant also coming from a finite set. (It's very important that the ...
12
votes
1answer
219 views

Randomness test suites that can be invoked from Mathematica

There are several test suites referenced at csrc.nist.gov designed to test a (pseudo-)random byte sequence for randomness, and discover possible skews, correlations, patterns, or other hidden ...
-5
votes
1answer
229 views

random number visualization without generator (Spectral Test)

Does anyone have codes for using only numbers to make this kind of random-number visualization and not requiring a number generator? ...
0
votes
1answer
95 views

Random variation inside NMaximize

I am using NMaximize as following code. ...
1
vote
2answers
196 views

Problem in simulating discrete time stochastic

I have been playing with some stochastic questions and specially the problem here.It seems no matter for the first time in bet, gambler is going to lose the first bet.Am I right?How can we correct the ...
5
votes
2answers
268 views

Adding noise to nonlinear control system using NDSolve

I have a nonlinear control system ...
1
vote
0answers
189 views

SDE boundary condition

I have a simple SDE with white noise: ...
8
votes
1answer
200 views

Have the Random functions changed?

I re-ran a program I wrote for Mathematica v8, now on v9, and it appears to generate different RandomInteger numbers, even though I use the same ...
0
votes
2answers
184 views

Random variates in Recurrence Function

I'm completely new to Mathematica and can't seem to find an answer elsewhere so hopefully I can get some help here. I'm trying to plot a recurrence relation, where a random variate is generated at ...
2
votes
2answers
169 views

Bounds on random number

I have a Markov Chain Monte Carlo code that uses a chi squared function to fit some data. I am running into an issue now with getting unrealistic values for some of the free parameters in the code. ...
3
votes
1answer
562 views

White noise $\eta(t)$

How to make a random function $\eta(t)$ to insert in a differential equation for NDSolve? Edit: example: to solve equations like $\frac{dx}{dt}=\eta(t)$
1
vote
1answer
188 views

Safe values of $\mu$ and $\sigma$ when randomly sampling from a Log-Normal Distribution?

I believe I'm obtaining overflow errors when randomly sampling from a log-normal distribution with the command: RandomVariate[LogNormalDistribution[μ, σ], 1] ...
2
votes
0answers
523 views

Calculate variance of random walk?

How can I symbolically calculate the variance of the following random walk in Mathematica? Given several discrete random variables such that $p(Z_i=1-2k)=p$, where $k$ is a small real number, and ...
14
votes
1answer
605 views

Mathematica giving infinity as a random number!

I am trying to generate several random numbers from normal distribution using Mathematica. The following is the relevant code: ...
1
vote
2answers
233 views

Help with 1-dimensional random walk [closed]

I would like to simulate the evolution of a bankroll of a 2 player game where you have the probability of winning p. If a player wins, the bankroll grows by 1 unit minus a fee that each player pays, ...
12
votes
1answer
428 views

Simulating discrete time stochastic dynamic systems

What is the canonical way of simulating discrete time stochastic dynamical systems in Mathematica using the new functionality of Random processes? To take a concrete example, lets consider the ...
2
votes
2answers
170 views

Illustrating half life

I'm teaching some lessons on negative exponents and one application listed was half life since the rate of decay can be written as 2^-1 every __ years. I found this nice animation on the net. ...
3
votes
2answers
264 views

Colors associated to parts of a 3D distribution of points

Suppose we have a long list of random points (cartesian coordinates) in 3D space. coords := ...; Until now, I was associating colors in a radial way, from the ...