Question: Simple procedures and plots

Hello everyone, 

 

I'm currently taking a Chaos and Fractal Geometry class that did not have a pre-req of computer programming or knowledge of Maple, but I am apparently the only person in the class who has not taken a class/does not have this knowledge so my professor really flew by teaching the material. My sob story aside, I was hoping you great people would be able to help me out with (what are apparently) really basic procedures and plots while I try to read up on how to actaully do it myself (if anyone has a good supplement to recommend, I'm all ears!). Anyway, here are the one's that I'm stumped on:

  • "Write a Maple proc L that takes as input two lists and returns as output a set containing the terms they have in common (not necessarily in the same position). For example, L([1, 3, x, 5],[2, x, 5, 2, 1, 8]) should return [1, x, 5]."
    I'm thinking this is going to use some form of the intersection command, but I cannot for the life of me figure out how to set up the syntax
  • "Write a Maple program that implements the Euclidean algorithm to compute the gcd(x, y) for any natural numbers x, y (except x = y = 0). Your program should not just compute the gcd, but should do so by implementing the Euclidean algorithm directly (i.e. proc(x,y) RETURN(gcd(x,y)) end; is not what I am looking for here! :) )."
    If only he would've let me do the easy one :(
  • "Write a Maple program to plot the Pythagorean spiral. The program should take a single positive integer n as an argument and plot the spiral until the side of length n is reached"
    Not even a clue on how to approach this one. 

 

Thanks again to any and all help/recommendations you can make. I really appreciate it!

Please Wait...