Robert Israel

6577 Reputation

21 Badges

18 years, 217 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

Hmm... Did you by any chance have the student package loaded, or some other package that defines Sum ?  
Normally Sum is not a defined procedure, so that error message couldn't occur.

 

Hmm... Did you by any chance have the student package loaded, or some other package that defines Sum ?  
Normally Sum is not a defined procedure, so that error message couldn't occur.

 

More memory is better than less, but problems tend to expand to fill the resources available.  An extra couple of gigabytes may not get you much improvement, especially if your memory is being filled up due to a "combinatorial explosion".

Note that if x is congruent to y mod n, then x^k is congruent to y^k mod n.  So all you need to check is one member of each congruence class mod n.

Your code could be cleaned up a little, e.g. you might want to use  andmap, but basically it's fine.

 

Note that if x is congruent to y mod n, then x^k is congruent to y^k mod n.  So all you need to check is one member of each congruence class mod n.

Your code could be cleaned up a little, e.g. you might want to use  andmap, but basically it's fine.

 

What you've done, Alex, is change the problem: instead of plotting -abs(x-y) you're plotting -abs(x+y).

The point is this: plot3d(f(x,y),x=..., y=...) actually plots triangular patches:  [x[i],y[j],f(x[i],y[j])], x[i],y[j+1],f(x[i],y[j+1])], [x[i+1],y[j],f(x[i+1],y[j])] and
[x[i],y[j+1],f(x[i],y[j+1])], x[i+1],y[j],f(x[i+1],y[j])], [x[i+1],y[j+1],f(x[i+1],y[j+1])]

For -abs(x+y), with equal numbers of grid points in both directions the "ridge" x=-y
falls on the edges of this triangulation, while for -abs(x-y) the "ridge" x=y does not.

You might try 

>  plot3d([-s,y,-abs(-s-y)], s=-1..1, y=-1..1, axes=box,
      labels=[x,y,z]);

 

 

 

What you've done, Alex, is change the problem: instead of plotting -abs(x-y) you're plotting -abs(x+y).

The point is this: plot3d(f(x,y),x=..., y=...) actually plots triangular patches:  [x[i],y[j],f(x[i],y[j])], x[i],y[j+1],f(x[i],y[j+1])], [x[i+1],y[j],f(x[i+1],y[j])] and
[x[i],y[j+1],f(x[i],y[j+1])], x[i+1],y[j],f(x[i+1],y[j])], [x[i+1],y[j+1],f(x[i+1],y[j+1])]

For -abs(x+y), with equal numbers of grid points in both directions the "ridge" x=-y
falls on the edges of this triangulation, while for -abs(x-y) the "ridge" x=y does not.

You might try 

>  plot3d([-s,y,-abs(-s-y)], s=-1..1, y=-1..1, axes=box,
      labels=[x,y,z]);

 

 

 

This may seem like a logical order to you, but to me it's not so clear.  For example, infinity is separated from its subtypes by a large gap.  If a list is in alphabetical order, it's pretty easy to search for something (as long as you know the name you're searching for).  If it's in a "logical" order, it's difficult unless my logic happens to fit with yours.   A linear list is not much good at presenting a hierarchical structure, unless there are pointers from each item to its parents and children.  And this structure is more complicated than a strictly hierarchical one.

I get

ans := {vg = 4.883283447, vl = 4.883283361}

which satisfies the constraints (up to roundoff error).

Why do you say it's wrong?

I get

ans := {vg = 4.883283447, vl = 4.883283361}

which satisfies the constraints (up to roundoff error).

Why do you say it's wrong?

That wasn't my point at all.  Whether on one line or several, your code

> F := proc(L) local LL; LL:=subsop(1=NULL,LL); end proc;

will not work.  The result of F(anything) is just NULL.  Note that you haven't used L at all in the procedure.

The version you had before

> F:=proc(L)
>local LL;
>   LL:=subsop(1=NULL,LL);
>L:=LL;
> end proc:

won't work either, because the additional statement L := LL will generate an error " illegal use of a formal parameter".

 

 

That wasn't my point at all.  Whether on one line or several, your code

> F := proc(L) local LL; LL:=subsop(1=NULL,LL); end proc;

will not work.  The result of F(anything) is just NULL.  Note that you haven't used L at all in the procedure.

The version you had before

> F:=proc(L)
>local LL;
>   LL:=subsop(1=NULL,LL);
>L:=LL;
> end proc:

won't work either, because the additional statement L := LL will generate an error " illegal use of a formal parameter".

 

 

What you wrote won't work at all.  Perhaps you meant something like

> F := proc(L) subsop(1=NULL, L) end proc;

  L := [x,y,z,d];
  L := F(L);

etc.

 

What you wrote won't work at all.  Perhaps you meant something like

> F := proc(L) subsop(1=NULL, L) end proc;

  L := [x,y,z,d];
  L := F(L);

etc.

 

Use the option gridlines = true (in Standard GUI: does not work in Classic).

First 110 111 112 113 114 115 116 Last Page 112 of 187