MCS 320 Quiz 5 Friday 23 September 2005
| > | restart; |
1. Type
| > | r := (x^2-1)^2/(y-1); |
followed by
| > | dismantle(r); |
PROD(5)
SUM(5)
PROD(3)
NAME(4): x
INTPOS(2): 2
INTPOS(2): 1
INTNEG(2): -1
INTPOS(2): 1
INTPOS(2): 2
SUM(5)
NAME(4): y
INTPOS(2): 1
INTNEG(2): -1
INTPOS(2): 1
INTNEG(2): -1
Use the output of dismantle to draw the directed acyclic graph of the internal representation of r.
Answer: see the handout.
2. Type
| > | subs(-1=Pi,r); |
Explain why you see Pi three times in the output.
Answer:
Every object in Maple is stored only once. The -1 occurs three times in r, twice as coefficient and once as the exponent for the division.