Items tagged with homework


I have a homework ask you to find the first string of (at least)10, 50, 100 consecutive composites. I have no idea how to use maple. HELP

all i can think of is 


>ithprime(i+1) - ithprime(i) = 10

>print(i+1, i)


and combine it with some loop

i dont know how to set up a loop

 need a lot of help 


I have an SEIR model.

Equation 5 is for disease death but I would like to plot the cumulative numbers of disease death which will be the integral of Equation 5. I added the integral inside odeplot but it is not working. Any idea  about  how to compute the integral ?

Maple code is attached

Thank you



I was wondering how to go about plotting a Fourier Tranform in Maple.

My assignment is to plot a simple harmonic equation as a Fourier transform, depicting amplitude against fequency.

I've been given: x'' + w^2 x = 0

And want to obtain both the f(x) = a0 sin(wt) + b0cos(wt) form, and a graph of the the amplitude (c^2 =a0^2 + b0^2) against frequency.

I know how to do this on paper but not in Maple, so any help with line commands and layout would be very much appreciated.



I need to complete the definition of bcount so that bcount(n) returns the total number
of odd coefficients 
k , 0 ≤ k ≤ n. For instance, the values of 
k for n = 6, with odd values highlighted, are:
1, 6, 15, 20, 15, 6, 1,

description "Count odd binomial coefficients.";
end proc; # bcount

Any help appreciated

the binomial coefficient  n k  can be defined recursively as follows for all nonnegative integers n, k:

(n)  = {0,      k>0

(k)  = {1       k=0, k=n

         {(n-1)+(n-1), otherwise.

          (k-1)   (k)

I need to complete a deinition of binom so that m so that binom(n,k) returns  n k  for all n greater than 0, and k greater than or equal to 0 using the definition of the binomial above..Any help appreciated..

description "Compute a binomial coefficient";
option remember;
end proc; # binom


I have the following two PDEs:

PDE := diff(u(x, t), t) = diff(u(x, t), x, x)+sin(x+t)-cos(x+t);

IBC:= D[1](u)(0,t)=-sin(t),

pds := pdsolve( PDE, [IBC], numeric, time = t, range = 0 .. 1,
spacestep = 1/32, timestep = 1/32,


PDE2 := diff(v(x, t), t) = diff(v(x, t), x, x);
IBC2:= D[1](v)(0,t)=0,
D[1](v)(1,t)=-0.000065*v(1, t)^4,

pds1 := pdsolve( PDE2, [IBC2], numeric, time = t, range = 0 .. 1,
spacestep = 1/32, timestep = 1/32,


Now, what I want to do with these two PDEs is the following:


For each h=timestep=spacestep  = 1/16 , 1/32 , 1/64 , 1/128 , 1/256

Calculate the error norm ||E||_h = sqrt(sum_{j=0}^{1/h} h* |u(j*h,tval)-v(j*h,tval)|^2)

where tval is some chosen point between 0 and 1 (this value is fixed for each spacestep chosen).


And then plot the graph of log ||E||_h vs. log h above.


What I don't know is how to extract each time the spacestep and its PDE's two solutions, does someone have a suggested script to use here?



let γ be the root 

i have to apply taylor series on f(x) and then do some substitution like (helped by a member of Mapleprime)

taylor(f(x), x = gamma, 8);
f(x[n]) := subs([x-gamma = e[n], f(gamma) = 0, seq(((D@@k)(f))(gamma) = factorial(k)*c[k]*(D(f))(gamma), k = 1 .. 1000)], %)

then find the derivative of result from above output

i do

b := diff((x[n]), e[n])

basically i have to find the value of newton method which is


here we substitute xn=γ and D(f)(xn)=b

and then want to apply f on yn

there are to problem which i face 

1  f(xn)/D(f)(xn) is not in simplified form i-e O(e[n]^8) and O(e[n]^7) is appeared in numerator and denominator respectively. how we get the simplified result.

2 wht step should i do to find f(yn)

plx help me to do this 

thanx in advance



I am very beginner about Maple. How to get the general solution from the follwoing equations by Maple. Please help me. Its Urgent. Please help me out.

Hey guys! Can anyone help me with solving one of these Differential Equations ?


Explore the values of km digit(n,m) using km list for all m, 0 ≤ m ≤ 8.
Look at the output until you can make a conjecture that concerns the pattern
obtained for each fixed m, 0 ≤ m ≤ 8 using 

km := proc (n::posint, m::nonnegint)

local k,

mySum := 0;

for k to n do

mySum := mySum+k^m

end do;

return mySum

end proc

using a list km list(m,6,20) when m is not a multiple of 4, and km list(m,6,50) when m is a multiple of 4.


any help appreciated..THank you


Need to create a fibonacci defintiion using this form..Any help appreciated..thanks in advance

The Fibonacci numbers Fn are defined for all positive integers n as follows:

Fn = ( 1,                 n =1, 2 , )    

      (Fn−1 + Fn−2 , otherwise.)

 Complete the definition of fib so that fib(n) returns Fn for all positive integers n. You must compute Fn using the below definition! A recursive proc is most natural.

description "Calculate fib(n), the n'th Fibonacci number.";
option remember; # important for efficiency!
end proc; # fib

I need to complete the definition of P km using a for loop so that km(n,m) returns n k=1 k m whenever n, m ∈ Z, n > 0, and m ≥ 0.( You must use a for loop in the variable k, with k ranging from 1 to n, to do this question in the manner requested.)

km is defined as 

description "km(n,m) returns the sum of k^m as k ranges from 1 to n.";
end proc; # km

Not sure where tostart..Any help appreciated...thank you

hello all!

Pascal := proc (n::posint)

local x, y, i;

 for i from 0 to n do print(coeffs(expand((x+y)^i)))

end do end proc;


1, 1
1, 2, 1
1, 3, 3, 1
1, 4, 6, 4, 1

 How to create 


1  1
1  2  1
1  3  3  1
1  4  6  4  1


hello everybody!

I want to create a random symmetric matrix which have det=2. I just made it like this, no better than those ones. Thanks!

Doixung := proc (n)

local A, i, j; A := Matrix(n);

n := LinearAlgebra[Dimension](A);

for i to n do A[i, i] := RandomTools[Generate](integer(range = 1 .. 20))

   end do;

for i to n do

     for j to n do

           while j < i do A[i, j] := RandomTools[Generate](integer(range = 1 .. 20)) end do;

           while i < j do A[i, j] := A[j, i] end do

     end do

end do;

print(A) end proc

Hello! I have written a algorithm. Can you help me find errors? thank you very much. sorry, my English is not very good!

uses LA= LinearAlgebra;
local i, j, k, n:= LA:-RowDimension(A),
L:= Matrix(LA:-Dimensions(A));
for j from 2 to n do
end do;
for i from 2 to n-1 do
for j from i+1 to n do
end do;
end do;

3 4 5 6 7 8 9 Last Page 5 of 21