## 80 Reputation

9 years, 167 days

## writing procedures ...

Maple

1.  a procedure quadsumstats whose input is an integer n. This procedure should return a list of length

n whose kth  entry is the number of solutions to
x^2 + y^2 = k
for
1 <= k and k <= n

I am sort of confused as to how to construct that list of length n and how to obtain integer solutions to the equation in maple.

2.

a procedure firstCount(k) that finds the first integer
n
with
k
representations as
"x^2+y^2= n." What does it mean for an integer to have k representations?

## procedure that takes integer n and retur...

Maple

I need to write a procedure that does the following :

Write a procedure quadsum whose input is an integer n and whose output is a list of pairs of solutions [x,y] to the above formula.

Your procedure should implement the following algorithm.

1 Initialization
Set
"mylist = []."

Start at
x = 0
and
y = 0.

2 Phase A
Increment both
x
and
y
until
"x^2+y^2 >=n."

Phase B
Repeat the following until
x^2>n

If you are above the circle
x^2 + y^2 = n
then go down in unit steps until you are on or below the circle.

If you are on the circle, add the point to the list
"mylist. "

If you are on or below the circle
x^2 + y^2 = n
then go one step to the right. My procedure is as follows: but it runs into an infinite loop(most probably because of the while loop defined inside the while loop). What am I doing incorrectly?

I have atta

## how to determine the nature of an equili...

Maple

If I have the following system of first order diff eq's:

x'(t)=2x(t)+3y(t)

y(t)=-3x(t)-2y(t)

then can I consider the coefficient matrix A=<<2,-3>,<3,-2>> and compute the eigenvalues of A and infer as follows:

if the eigenvalues are of the same sign- eq point is a node

if they are of opposite signs- eq point is a saddle

if they are pure imaginary- eq point is a center

if they are complex conjugates- eq. point is a spiral

I've been given these conditions but my text says for a linear system of the form x'=Ax, the eigenvalues of A can be used to identify the nature of the eq. point. I am confused as to whether this applies to the given system as well; I have obtained 5 different trajectories and drawn the phase diagram for the system

## What does it mean for the recurrence rel...

Maple

I have the following :

with(powseries):
difeq:=diff(y(x),x,x)+x*y=0;
icval:=y(0)=1,D(y)(0)=0;
pow_soln:=powsolve({difeq,icval});
tpsform(pow_soln,x,30);
pow_soln(_k);

for which the  transformed power series

is : 1 -(1/6)y*(x^3)

and pow_soln(_k) returns 0. What does this mean?

## to show left null space and column space...

Maple

I have a matrix A for which the basis of the left null space using NullSpace() is the empty set {}  while the column space is {e1,e2,e3}. By definition, we need every vector in col space . every vector in basis of left null space =0 but how would I show that in this case? Can I determine another basis for the left null space?

 2 3 4 5 6 7 8 Page 4 of 9
﻿