133 Reputation

2 Badges

14 years, 303 days

MaplePrimes Activity

These are questions asked by bongiman

How do i plot both A & B on the same set of axes where

A={z:1<=|z+2i|<=2}; & B={z:1<=|Arg(z+2i)|<Pi/3}.

I'm struggling to plot A on it's own nevermind B!

restart; g:= x^2+(y+2)^2<=2; plots[implicitplot](g,x=-5..5,y=-5..5,y=-5..5,filled = true, scaling = constrained)

I'd have thought when |z+2i|=2 my circle should should go through the origin but with the above code it does not. Am i completely wrong here?

And how do i plot it with 1<= and >=2?

Any pointers would be very much appreciated.


Can someone help me with figuring out what the following error means:

"Error, (in F) final value in for loop must be numeric or character"

I've obviously done something wrong but have no clue where to start!!

This comes up when i'm trying to plot a graph using the following code:

I want to plot a graph of the following sequence

x[n]=p*x[n-1]+q*x[n-2] where x[0]=0 and x[1]=1. Also p & q are independ random variables with values +1 or -1.

This is what i've done so far

> with(Statistics):
> x[0]:=0: x[1]:= 1:
> for n from 2 to 10 do
> S:=Sample(Bernoulli(0.5),2):
> p:=S[1]: q:=S[2]:
> x[n]:=p*x[k-1]+q*x[k-2]: od;

But the output is not tallying up the x[n]'s. Also i just realised my code selects +1 or 0 for p & q......


I've written the following procedure and seem to have completely forgotten how to code in Maple!!

> restart:
> p:=proc(n,int)
>   local k,s,i;
> for k from 2 to n do
> s[n]:= 2*sum(s[i]*s[n-i],i=1..n-2)+s[n-1]; end do:
> eval(s[n],n=k);
> end:
> p(2);p(3);p(4);p(5);p(10);

The above code yields results in terms of the expression s[i]. How do get my procedure to actually add it all up. For example p(10) should equal 103049? Many thanks.

1 2 3 Page 1 of 3