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 ):
> x:= random[normald[0,sigma]](1,'default','inverse');
but whenever i try and obtain one of these random numbers by typing
i get the output:
x := random_function ('default', 1, 0., 1., random[normald[0, 1]])
what's the craic with that?
- Thread Starter
- 28-01-2010 16:20
Offline20ReputationRep:Community AssistantStudy Helper
- Community Assistant
- Study Helper
- 28-01-2010 16:53
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.
- Thread Starter
- 28-01-2010 17:20
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???
- 28-01-2010 20:25
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?