Christopher2222

5785 Reputation

24 Badges

16 years, 350 days

MaplePrimes Activity


These are questions asked by Christopher2222

Suppose I want a random sample of 500 numbers

RandomSample(Normal(0,1)),500);

Good, now if I am understanding properly [0,1) means positive values with a mean of 0 and standard deviation of 1.  However in Maple RandomSample(Normal[0,1)),500); is not allowed due to bracket mismatching. 

how do I get the RandomSample domain [0,1)?

I'm plotting some random points along a curve but I'm not sure of a couple of things so I have a few questions.

Using a simple curve like x for example.  First I'll choose some random numbers, 100, between -8 and 8, but I also want a couple of decimal points otherwise random integer values will only give me a maximum of 17 points.  So is the best way to do that like this?

with(plots):
a:=[seq((rand(-800..800)(i))/100,i=1..100]    # These will be my x point values;

When using Threshold on an image that has been converted to grayscale is it not the same as this loop?

a:=ToGrayscale(img);

for i from 1 to Width(a) do
  for j from 1 to Height(a) do
    a[i,j] := round(a):
  od:
od:

 

 

How can I round off the numbers in a random array or matrix?  Round or Trunc will not work on a random number.

with(ArrayTools):
a:=30*(ArrayTools:-RandomArray(8,8));

 

I was playing around with loops and came up with this simple while loop that is reacting different than I am expecting

a:=rand(1..10):
while a() <> 4 do print(a()); od:

the output includes 4's ??

First 83 84 85 86 87 88 89 Last Page 85 of 94