# Tagged Questions

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

571 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 points,...
118 views

### Recursion when randomizing elements in a list

I want to randomize certain elements of a list; Since the code list = {a, b, c, d, e, f, g}; list[[{1, 3, 5}]] = RandomSample@list[[{1, 3, 5}]]; list works fine, ...
308 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 ...
493 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.
51 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 ...
599 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 : ...
694 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 ...
371 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 $x$-...
135 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: ...
343 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 ...
87 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: ...
177 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). ...
310 views

### When does a list contain only ones?

I am starting with a list of length n that contains all -1's. For instance, when n = 6 the list is {-1, -1, -1, -1, -1, -1}. I ...
397 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 ...
58 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 ...
20k views

### How to generate a random snowflake

'Tis the season... And it's about time I posed my first question on Mathematica Stack Exchange. So, here's an holiday quest for you Graphics (and P-Chem?) gurus. What is your best code for generating ...
2k 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 \leq 1$ in the first octant: ...
672 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. ...
311 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: ...
124 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 ...
193 views

### Random filling of L-length line with l-length segments

I have discrete L-length line filled randomly with 2-length segments so its cover line with gaps 0 or 1. So we can describe cover configuration as sequence of gaps such as {0,0,1,0,1}. How I can ...
163 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
188 views

### Number theory: Problem involving rational numbers

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

### Uniformly distributed n-dimensional probability vectors over a simplex

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 ...
222 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 ...
2k 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 ...
664 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 ...
2k 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 ...
812 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 ...
423 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 ...
104 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 ...
851 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 <...
1k 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 ...
485 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 non-...
489 views

### random number visualization without generator (Spectral Test) [closed]

Does anyone have codes for using only numbers to make this kind of random-number visualization and not requiring a number generator? http://demonstrations.wolfram.com/...
107 views

### Random variation inside NMaximize

I am using NMaximize as following code. ...
310 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 ...
546 views

### Adding noise to nonlinear control system using NDSolve

I have a nonlinear control system ...
525 views

### Boundary condition for stochastic differential equation

I have a simple stochastic differential equation (SDE) with white noise: ...
1k views

### How can I randomize order of elements in a list?

Is there a straightforward way to go from an ordered list like: ord = {a, b, c, d, e, f, g, h} to a disordered list like: ...
250 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 ...
300 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 ...
240 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. ...
1k 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)$
230 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] ...
795 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 \$p(...
802 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: ...
405 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, ...