# Items tagged with randomrandom Tagged Items Feed

### Fast random generation...

July 15 2014
2 2

It says at

http://www.maplesoft.com/products/maple/new_features/maple18/Language_Programming.aspx#random

"When generating matrices and vectors of floats and integers, these flavors are very fast. "

But when I compare the new

time[real](Generate(('Matrix')(float, 300, 300)))

and

time[real](RandomMatrix(300, 300))

I find RandomMatrix over 300 times faster. Am I doing something wrong, or is RandomMatrix still the fastest way to generate random numbers?

### how to generate random numbers with normal distrib...

June 12 2014
2 4

I want to generate random numbers following the normal distribution within a fixed interval.

For example, I want generate 10 random numbers in the interval [2903.5-5, 2903.5+5]. These random numbers should follow the normal distribution with mean 2903.5 and  standard deviation \sigma=3.

How can I do this?

Thanks.

### How to save values stored in the variables in a wo...

June 01 2014
0 2

My problem is i am working with a very large randomly generated output, generated using maple's builtin in random generating functions. I have the output which i want to investigate but i want to be able to reproduce this result when i save and close the worksheet. Since the list of generators is very long copy pasting is not very nice and i donot know the seed of these generaters. I want to ask if i can store the values in variable in the worksheet so that when i open the worksheet i can get the same random generates stored in the variable.

### Is there a function to generate random numbers wit...

May 13 2014
0 15

Hello guys,

I think that the title explains the question very well. Is there any function in MAPLE that allows me to generate N random numbers considering a mean value, standard deviation and a percentile?

Thank you,

### How do I generate a random matrix of this form?...

May 11 2014
2 3

I want to generate a random matrix of size m x n as follows: for each i between 1 and m, take a random p_i number according to some fixed distribution (for example, uniform distribution in [0,10]). These numbers p_i are independent. Then I'll form a random matrix whose (i,j)-entry is chosen according to a probability distribution that depends on the parameter p_i (for example, it could be Poisson(p_i)). So entries in the same row are independent.

How can I do that?

February 19 2014
1 4

Hi,

I tried to use generated random as following

***

for j from 1 to 5 do
c:=rand(0..1):
d:=c();
print(random number,c(),d);

if c()=1 then

print(Y)
else
print(N);
end if;
end do:

***

The output is

****

random number, 1, 0

Y

random number, 1, 1

Y

random number, 1, 1

N

random number, 1, 1

N

random number, 0, 0

N

****

Why the output numbers in one line are different? And Using "if" sentence seems do not correspond to the printed "c()" value..

Thank you very much in advance!

### obtaining c.d.f from probability mass function...

December 28 2013
2 1

How to calculate c.d.f from probability mass function. Suppose that the pmf of a discrete random variable is given : f(x)=(2*x+1)/25, x=0,1,2,3,4

### How do I randomize 19 particular items in maple?...

November 19 2013
1 1

I have a set of 19 different items I need randomize, lets call them A-S. I tried the Random command, Random(19,A-S) listing all of the possiblities. I want each letter to be used once in that 19 times and using this way does not do that. Is there another command I can use to achieve this?

### randomize a subset...

November 05 2013
0 10

Suppose I broadcast a game show where every episode there is 5 randomly chosen topics from 8 possible topics (A,B,C….). how can I get maple to do this automatically?

I thought I could use

> with(combinat):

> choose([A,B,C,D,E,F,G,H], 5);

of course the output comes out ordered. is there some way to randomize it? or another way? rgds

### How do I get randomize(#) to work in Maple 17...

September 02 2013
0 3

If I put in the randomize(#) command with the same actual number each time before generating a sequence of random numbers,  I would expect to get the same sequence of results from repeated use of

round( Generate(distribution(DiscreteUniform(5,10))) )

each time. Actually, I get completely different sequences of numbers.

This also happens with the alternative method of SetState in RandomTools

This is not only annoying...

### random sample testing...

April 27 2013
0 3

I am trying to get Maple to calculate this for me:

Let X1,X2,...X81 be a random sample from a distsribution (not necessarily normal) with mean µ=49 and standard deviation σ =8. Let ¯X = (1/81)* ∑i=181 * Xi

I need to find the mean, the standard deviation and the approximate distribition of ‾X,

BTW, the 81 goes directly...

### Help with Maple Equations...

March 14 2013
0 3

helpw#8.mw

THis is what I have so far.. is there anyone who can help me with this?

Let f(x) = 1/9*x^2, o<x<c

Find c so that f(x) is the pdf of a random variable X.

I have come up with this and was wondering if I could get some help. I cant get it to paste in, but I have

### How do I use Maple to construct a stem and leaf di...

March 12 2013
0 4

Twenty five observations of a random variable X are :130.8  129.9  131.5  131.2  129.5  132.2  133.7  127.8  131.5  132.7  134.8 131.7  133.9  129.8  131.4  132.8  132.7  128.8  130.6  131.1  133.8  130.5 131.4  131.3  129.5  //.. How do I construct a stem and leaf display using stems of 127, 128, 129, ... 134? I also need to find all quartiles.. Thank you to anyone...

### shaded area in plot and 95% confidence intervals...

February 20 2013
0 6

Hello,

I am trying to get a shaded area in my plot but I could not.

First we solve ODE without randomness:

ode := diff(U(t), t) = -(A+B*U(t))*U(t);

Then we add randomness to ODE and solve:

ode2 := diff(U(t), t) = -(A+r(t)+B*U(t))*U(t);

A with randomness for r in R=( - 0.0001/365, 0.0001/365) is:

A(t,r)= A+r

Where A is constant =  0.0001/365

We plot both solution. For the plot I...

### Is it Maple or my Computer?...

November 06 2012
1 2

I want to model this game (I want an ensemble average and a time average)

50% chance you get head=win 50%
50% chance you get tails= lose 40%
Starting capital =100

First of all I need a very large binary matrix(1..100000,1..100000) however not
even that I can do fast enough in maple!

I tried:

rtable(1 .. 1000, 1 .. 2000, frandom(0 .. 1, .5), subtype = Array, datatype = float[8], fill = [0, 1])

it is somewhat fast but it does not do what I want ie binary ...

 1 2 3 4 Page 1 of 4
﻿