Doug Meade

 

Doug

---------------------------------------------------------------------
Douglas B. Meade <><
Math, USC, Columbia, SC 29208 E-mail: mailto:meade@math.sc.edu
Phone: (803) 777-6183 URL: http://www.math.sc.edu

MaplePrimes Activity


These are replies submitted by Doug Meade

This remnds me of two of my longstanding requests for improvements in Maple:

  1. multivariate limits
  2. discrete limits (sequences)

Mathematically, there is only one limit, but we have different techniques and tools depending on the specific domain and range: interval, integers, or multi-dimensional.

This is not an area where I can claim any expertise, so I ask:

  1. Is there any work being done in this area?
  2. What are thefundamental issues that make this difficult to implement?

In my mind, it appears that if this functionality existed (efficiently) it could be possible to greatly expand Maple's reliability. It might even make it easier to make Maple "smarter" about what it does in a "student" environment.

I look forward to any insights others can provide.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

Patrick,

I've never seen the behavior you describe. At first I thoughy maybe you were using an older version of Maple, but you say you are using Maple 12. Next, I thought maybe you did not have the entire proc definition in one executiion group. But, if I execute the uses statement on its own, I don't see the message you report. Are you, by chance, using a document with 2D input? I still could not reproduce your error message, but there are lots of possibilities.

My recommendation is to work with a Maple worksheet (not a document) and to use Maple Notation for the input. This is exactly what you are trying to avoid for your students, but for this programming this is the best way to use Maple. (Others would argue that it's even better to work with text files and command line Maple.) This is easy to do when working with maplets. You can export the worksheet (or document) as a .maplet file. This is just a text file whose last line starts the maplet. Here's the .maplet file for my version of the maplet:

Download 178_MMLeditor-demo.maplet
View file details

In this file I have modified the definition of DoIt to avoid using the uses clause. Here's the full content of the file:

with(Maplets[Elements]):
DoIt := proc()
  local expr, result, vars;
  expr := MathML:-Import(Maplets[Tools]:-Get( 'MMLed1' ));
  vars := MathML:-Import(Maplets[Tools]:-Get( 'MMLed2' ));
  result := eval( expr, vars );
  Maplets[Tools]:-Set( 'MMLv1'=MathML:-Export(result) );
end proc:
maplet := Maplet([[BoxCell("Enter your expression:"),
                   MathMLEditor(reference='MMLed1', 'value' = MathML[Export](x+y=3), outputformat=content)
                  ],
                  [BoxCell("Enter the substitutions:"),
                   MathMLEditor(reference='MMLed2', 'value' = MathML[Export](x=0), outputformat=content)
                  ],
                  [BoxCell("Result:"),
                   MathMLViewer(reference='MMLv1', 'value'="")
                  ],
                  [BoxCell(Button("Do It!", Evaluate('function'=DoIt))),
                   BoxCell(Button("Quit", Shutdown()))
                  ]]):
Maplets[Display](maplet);

I hope you are able to get further with this.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

Patrick,

I've never seen the behavior you describe. At first I thoughy maybe you were using an older version of Maple, but you say you are using Maple 12. Next, I thought maybe you did not have the entire proc definition in one executiion group. But, if I execute the uses statement on its own, I don't see the message you report. Are you, by chance, using a document with 2D input? I still could not reproduce your error message, but there are lots of possibilities.

My recommendation is to work with a Maple worksheet (not a document) and to use Maple Notation for the input. This is exactly what you are trying to avoid for your students, but for this programming this is the best way to use Maple. (Others would argue that it's even better to work with text files and command line Maple.) This is easy to do when working with maplets. You can export the worksheet (or document) as a .maplet file. This is just a text file whose last line starts the maplet. Here's the .maplet file for my version of the maplet:

Download 178_MMLeditor-demo.maplet
View file details

In this file I have modified the definition of DoIt to avoid using the uses clause. Here's the full content of the file:

with(Maplets[Elements]):
DoIt := proc()
  local expr, result, vars;
  expr := MathML:-Import(Maplets[Tools]:-Get( 'MMLed1' ));
  vars := MathML:-Import(Maplets[Tools]:-Get( 'MMLed2' ));
  result := eval( expr, vars );
  Maplets[Tools]:-Set( 'MMLv1'=MathML:-Export(result) );
end proc:
maplet := Maplet([[BoxCell("Enter your expression:"),
                   MathMLEditor(reference='MMLed1', 'value' = MathML[Export](x+y=3), outputformat=content)
                  ],
                  [BoxCell("Enter the substitutions:"),
                   MathMLEditor(reference='MMLed2', 'value' = MathML[Export](x=0), outputformat=content)
                  ],
                  [BoxCell("Result:"),
                   MathMLViewer(reference='MMLv1', 'value'="")
                  ],
                  [BoxCell(Button("Do It!", Evaluate('function'=DoIt))),
                   BoxCell(Button("Quit", Shutdown()))
                  ]]):
Maplets[Display](maplet);

I hope you are able to get further with this.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

This is exactly my experience, and understanding, as well.

Inside an embedded component, the palettes are inactive. The only way to come close to this functionality is to use a maplet, with an MathMLeditor element. This has its own limitations, but that's the best I can come up with at this time.

With hope for improvements in this area in near future,

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

This is exactly my experience, and understanding, as well.

Inside an embedded component, the palettes are inactive. The only way to come close to this functionality is to use a maplet, with an MathMLeditor element. This has its own limitations, but that's the best I can come up with at this time.

With hope for improvements in this area in near future,

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

I finally had some time to play with this one. I did not seet Robert's posts until now, but my solution is similar. I used MathMLeditors and viewers for all of my fields.

Here's my code:

restart;
with(Maplets[Elements]):
DoIt := proc()
  local expr, result, vars;
  uses Maplets[Tools], MathML;
  expr := Import(Get( 'MMLed1' ));
  vars := Import(Get( 'MMLed2' ));
  result := eval( expr, vars );
  Set( 'MMLv1'=Export(result) );
end proc:
maplet := Maplet([[BoxCell("Enter your expression:"),
                   MathMLEditor(reference='MMLed1', 'value' = MathML[Export](x+y=3), outputformat=content)
                  ],
                  [BoxCell("Enter the substitutions:"),
                   MathMLEditor(reference='MMLed2', 'value' = MathML[Export](x=0), outputformat=content)
                  ],
                  [BoxCell("Result:"),
                   MathMLViewer(reference='MMLv1', 'value'="")
                  ],
                  [BoxCell(Button("Do It!", Evaluate('function'=DoIt))),
                   BoxCell(Button("Quit", Shutdown()))
                  ]]):
Maplets[Display](maplet);

Robert is correct that there are real limitations to the MathMLeditor. I avoid using it in my work. I prefer to require standard 1D Maple Input notation, and provide a Preview button that displays the user's input in a pretty-printed format (MathML) as a way for the user to confirm the correctness of their input. If you are interested in this, and need some help, let us know and I expect we can provide a simple example.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

I finally had some time to play with this one. I did not seet Robert's posts until now, but my solution is similar. I used MathMLeditors and viewers for all of my fields.

Here's my code:

restart;
with(Maplets[Elements]):
DoIt := proc()
  local expr, result, vars;
  uses Maplets[Tools], MathML;
  expr := Import(Get( 'MMLed1' ));
  vars := Import(Get( 'MMLed2' ));
  result := eval( expr, vars );
  Set( 'MMLv1'=Export(result) );
end proc:
maplet := Maplet([[BoxCell("Enter your expression:"),
                   MathMLEditor(reference='MMLed1', 'value' = MathML[Export](x+y=3), outputformat=content)
                  ],
                  [BoxCell("Enter the substitutions:"),
                   MathMLEditor(reference='MMLed2', 'value' = MathML[Export](x=0), outputformat=content)
                  ],
                  [BoxCell("Result:"),
                   MathMLViewer(reference='MMLv1', 'value'="")
                  ],
                  [BoxCell(Button("Do It!", Evaluate('function'=DoIt))),
                   BoxCell(Button("Quit", Shutdown()))
                  ]]):
Maplets[Display](maplet);

Robert is correct that there are real limitations to the MathMLeditor. I avoid using it in my work. I prefer to require standard 1D Maple Input notation, and provide a Preview button that displays the user's input in a pretty-printed format (MathML) as a way for the user to confirm the correctness of their input. If you are interested in this, and need some help, let us know and I expect we can provide a simple example.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

And, what about InverseSurvivalFunction?

I'll guess it has some connections, but the help page tells me nothing about it's meaning. It tells me how to use it, but no hints to why I would use it or what it means.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

And, what about InverseSurvivalFunction?

I'll guess it has some connections, but the help page tells me nothing about it's meaning. It tells me how to use it, but no hints to why I would use it or what it means.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

By coincidence, I came across the SurvivalFunction in the Statistics package. This does exactly what you want, finding P(X>x).

with( Statistics ):
X := RandomVariable( Normal(m,s) ):
SurvivalFunction( X, x );
                                  / (1/2)         \
                         1   1    |2      (-x + m)|
                         - + - erf|---------------|
                         2   2    \      2 s      /
int( PDF(X,t), t=x..infinity )assuming m>0, s>0;
                              / (1/2)         \    
                         1    |2      (-x + m)|   1
                         - erf|---------------| + -
                         2    \      2 s      /   2

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

By coincidence, I came across the SurvivalFunction in the Statistics package. This does exactly what you want, finding P(X>x).

with( Statistics ):
X := RandomVariable( Normal(m,s) ):
SurvivalFunction( X, x );
                                  / (1/2)         \
                         1   1    |2      (-x + m)|
                         - + - erf|---------------|
                         2   2    \      2 s      /
int( PDF(X,t), t=x..infinity )assuming m>0, s>0;
                              / (1/2)         \    
                         1    |2      (-x + m)|   1
                         - erf|---------------| + -
                         2    \      2 s      /   2

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

I don't recall seeing any message about the file being too large. All I saw was a window presenting me with the option to insert the links to the file in my post. I noticed this only because the picture it showed me was one that I had uploaded a week or two ago.

The file I was uploading was an animated GIF file so it's possible it was too large.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

 I don't know how I missed it in the online help - immediately after the entry for legend  (in ?plot/options)

Thank you!

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

 I don't know how I missed it in the online help - immediately after the entry for legend  (in ?plot/options)

Thank you!

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed

The rand command has been updated and upgraded with the introduction of the RandomTools package. You really should check it out.

Here's how I would approach your problem. The general idea is similar to Thomas Unger's. In my implementation, the arguments to the procedure are the number of distinct elements and the set from which they are to be chosen. This needs some checking to be sure the set has enough elements to choose n unique members, otherwise it would be an infinite loop.  You can do that for yourself (or ask again if you need more help). Anyway, here's my code and a couple of examples:

f := proc( n, S )
  uses RandomTools;
  local A;
  A := Generate( set(choose(S),n) );
  while nops(A)<n do
    A := A union Generate( set(choose(S minus A), 8-nops(A) ) )
  end do;
  return A;
end proc:
f(8,{$1..2^4});
                        {4, 6, 8, 10, 11, 13, 14, 15}
f( 3, {red,blue,green,brown,yellow,gold,bronze,silver,orange} );
                             {red, blue, green}

I hope this is helpful,

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed
First 32 33 34 35 36 37 38 Last Page 34 of 76