Christopher2222

MaplePrimes Activity


These are replies submitted by Christopher2222

@acer I didn't even see you had posted a solution until this morning.  I must have been compiling and submitting while you submitted yours, of course the caveats of dialup internet doesn't allow me to see things immediately.  Funny we arrived at something similar. 

I'm not sure the O.P. had DE in mind.  It could make sense though. 

@acer I didn't even see you had posted a solution until this morning.  I must have been compiling and submitting while you submitted yours, of course the caveats of dialup internet doesn't allow me to see things immediately.  Funny we arrived at something similar. 

I'm not sure the O.P. had DE in mind.  It could make sense though. 

Aren't Maplesoft and RIM practically next door neighbors?  However a blackberry being more business audience focussed I can see why you opted to the ipad, because it plays out to a much bigger audience.  I do not own anything apple/mac .. at least not yet, I heard a business commentator mention after Steve Jobs passed away that he would be surprised if Apple was still around in 10 years ... just something I heard in the last week but also to be taken with a grain of salt.  Will the maple player work on the blackberry? 

@Joe Riel 

The command to reproduce the error using a very simple proc to illustrate

a:=proc(L)
  global i:
  i:=nops(L):
  if i<50 then print("Small list") else print("Large list") end if:
end proc:

a := subs( (i < 50) = (i < 30), eval(a))
             Error, `=` unexpected

@Joe Riel 

The command to reproduce the error using a very simple proc to illustrate

a:=proc(L)
  global i:
  i:=nops(L):
  if i<50 then print("Small list") else print("Large list") end if:
end proc:

a := subs( (i < 50) = (i < 30), eval(a))
             Error, `=` unexpected

That seems similar to the knapsack problem.

Unless of course I renamed a built-in proc in order to substitute - then crtl-z won't matter.

Thanks for the global declaration.  But why should local declarations matter when I'm trying to sustitute into the proc itself?  But I guess the eval in the subs command is the precursor for the reason.

Unless of course I renamed a built-in proc in order to substitute - then crtl-z won't matter.

Thanks for the global declaration.  But why should local declarations matter when I'm trying to sustitute into the proc itself?  But I guess the eval in the subs command is the precursor for the reason.

Thanks, I'm using the GUI actually.  By clearing the screen, I mean Crtl-A <Delete>

Never thought of print copy and pasting back in.  It doesn't look too bad however I get error, unterminated procedure but it looks okay.  but the printproc should prove useful.

pnew := subs((i=30) = (i=50), eval(p));  doesn't work for me, it returns the original proc without substitution

And when I substitute for an i<50 case, I get Error, `=` unexpected

 

Thanks, I'm using the GUI actually.  By clearing the screen, I mean Crtl-A <Delete>

Never thought of print copy and pasting back in.  It doesn't look too bad however I get error, unterminated procedure but it looks okay.  but the printproc should prove useful.

pnew := subs((i=30) = (i=50), eval(p));  doesn't work for me, it returns the original proc without substitution

And when I substitute for an i<50 case, I get Error, `=` unexpected

 

convexhull can be used.  Building on Markiyan's suggestion.

with(simplex):
a:=convexhull(B00,output=[hull])
plot(a);

 

 

convexhull can be used.  Building on Markiyan's suggestion.

with(simplex):
a:=convexhull(B00,output=[hull])
plot(a);

 

 

subs, okay thanks. 

This is a global change, correct?  So just to be clear if I changed it to Normal(0,3) I would need to -

unprotect(ArrayTools[RandomArray]);
ArrayTools[RandomArray]:=subs(Normal(0,3)=Normal(0,1), eval(ArrayTools[RandomArray]));
protect(ArrayTools[RandomArray]);

 ... to return it back to the original, right?

 

subs, okay thanks. 

This is a global change, correct?  So just to be clear if I changed it to Normal(0,3) I would need to -

unprotect(ArrayTools[RandomArray]);
ArrayTools[RandomArray]:=subs(Normal(0,3)=Normal(0,1), eval(ArrayTools[RandomArray]));
protect(ArrayTools[RandomArray]);

 ... to return it back to the original, right?

 

@acer Incidentally, I came up with almost the exact approach as you last night, and also I think you are right that, that is what Herclau had intended.  But I didn't divide the RandomArray by 10 (never thought really if that would change the distribution relatively or not) but instead slightly changed the size of the circle to make the distribution more apparent.

t :=  (same as before)
x := Vector(N, i-> 5*sin(10*t[i])+5*I*cos(10*t[i]) + RandomArray(distribution = normal) + I * RandomArray(distribution = normal) ):
plots:-complexplot(convert(x,list),style=point,symbol=point);

Also I didn't include the datatype=complex[8] because it appeared to work the same without it.

Without adding noise on the imaginary component, I see that the noise is only generated in the x direction as pagan had earlier asked what type of distribution I wanted since I was very unclear about it.

First 109 110 111 112 113 114 115 Last Page 111 of 162