Turn on thread page Beta
    • Thread Starter
    Offline

    2
    ReputationRep:
    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 \sigma):

    > 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?
    • Community Assistant
    • Study Helper
    Offline

    20
    ReputationRep:
    Community Assistant
    Study Helper
    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
    Offline

    2
    ReputationRep:
    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 \pm 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???
    Offline

    15
    ReputationRep:
    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?
 
 
 
The home of Results and Clearing

4,002

people online now

1,567,000

students helped last year

University open days

  1. Bournemouth University
    Clearing Open Day Undergraduate
    Fri, 17 Aug '18
  2. University of Bolton
    Undergraduate Open Day Undergraduate
    Fri, 17 Aug '18
  3. Bishop Grosseteste University
    All Courses Undergraduate
    Fri, 17 Aug '18
Poll
Will you be tempted to trade up and get out of your firm offer on results day?
Useful resources

Make your revision easier

Maths

Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

Equations

How to use LaTex

Writing equations the easy way

Student revising

Study habits of A* students

Top tips from students who have already aced their exams

Study Planner

Create your own Study Planner

Never miss a deadline again

Polling station sign

Thinking about a maths degree?

Chat with other maths applicants

Can you help? Study help unanswered threads

Groups associated with this forum:

View associated groups

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.