You are Here: Home >< Maths

# Maple watch

1. I'm told that the following code can be used to automatically generate random numbers with the desired distribution (in this case a Gaussian distribution of width ):

> with(stats);
> with(stats[random]);
> x:= random[normald[0,sigma]](1,'default','inverse');

but whenever i try and obtain one of these random numbers by typing

x;

i get the output:

x := random_function ('default', 1, 0., 1., random[normald[0, 1]])

what's the craic with that?
2. It works for me.

Try restarting (> restart; ) and typing exactly what you have posted again (with sigma replaced by your chosen value).

If this doesn't work, try restarting Maple and try again.
3. got it working. thanks.
i had to use this to create an anti hermitian matrix and find its eigenvalues which was fine. i got the matrix to print and then the eigenvalues by

>e:=Eigenvalues(A) where A is my matrix and i'm working in the Linear Algebra package

as expected my eigenvalues are purely imaginary and come in pairs.

next i'm asked to use the commands Im, abs and sort to find the imaginary part of the smallest positive eigenvalue

any ideas on what to do here? i can use abs to make them all real but then i can't get them to sort properly. perhaps this has something to do with e being a vector???
4. You can change the type of e from a vector to a matrix or array or anything else you want really, can't remember the exact command but I did it several times last summer, shouldn't be too hard to find using the search tool. As for the eigenvalues thing, there's no concept of size with respect to one imaginary number to the next (I'm sure you probably knew that though) so I imagine that's why maple is having a problem sorting them, what exactly are you trying to do with the eigenvalues?

### Related university courses

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: January 28, 2010
The home of Results and Clearing

### 4,002

people online now

### 1,567,000

students helped last year
Today on TSR

### IT'S TODAY!

A-level results chat here

### University open days

1. Bournemouth University
Fri, 17 Aug '18
2. University of Bolton
Fri, 17 Aug '18
3. Bishop Grosseteste University
Fri, 17 Aug '18
Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams