Doug Meade's blog

My oldest son, Stuart, recently completed a Science Fair project on sudoku puzzles. While I am fairly good at solving sudoku puzzles, the mathematics is something that is completely outside my area of expertise. After seeing the paper by Hurzberg and Murty in the Notices of the AMS (June/July 2007) and additional papers by Felgenhauer and Jarvis (http://www.afjarvis.staff.shef.ac.uk/maths/felgenhauer_jarvis_spec1.pdf)  and Russell and Jarvis (http://www.afjarvis.staff.shef.ac.uk/maths/russell_jarvis_spec2.pdf) and Jarvis' sudoku webpage (http://www.afjarvis.staff.shef.ac.uk/sudoku/), I felt that I had a reasonable understanding of some of the basic ideas involved in counting unique sudoku puzzles. While I had nothing to add to the mathematical ideas, I did see the potential to create a tool to visualize these ideas. The result is the worksheet I just uploaded to MaplePrimes:

View 178_Sudoku3-20-03-08.mw on MapleNet or Download 178_Sudoku3-20-03-08.mw
View file details

Doug Meade's picture

Interesting Improper Integrals

A colleague showed this to me earlier this afternoon. I can explain, and accept, most of Maple's responses. I do have one case where I believe Maple could do better.

This arose during the creation of some Maple materials to support the derivation of the Integral Test for series convergence. Consider:

restart;
I1 := Int( 1/x^p, x=1..infinity );
                                /infinity      
                               |          1    
                               |          -- dx
                               |           p   
                              /1          x    

My previous blog entry was a real success.

Even though my original idea about multi-part MIME has not gotten anywhere, I do now have a concise way to package a maplet with supplemental files in a single package that can be downloaded via the WWW and automatically extracted and executed.

Most of the ideas were presented by acer.

acer first suggested that I look at the interactive interface to the InstallerBuilder. The idea here was to embed the maplet in a worksheet saved in a help database (hdb).

This did work, but was not suitable for actual use due to the overhead of the installer. In the attempt to reduce this overhead, acer then supplied some code that used march and LibraryTools.

To test the product of this interaction, download the file at the URL http://www.math.sc.edu/~meade/TEST/SimpleTest.mla.

Increasingly, I see the need to distribute a Maple worksheet with some auxiliary files. These extra files typically contain additional Maple code. These extra files could be a command file, a Maple libray archive (mla) or an image (for use in a maplet, say).

I can create my own ZIP archive to e-mail, but I would like to be able to post some of these resources on my website in a format that they can be automatically executed when downloaded. I understand that there are some potential security issues here, but I still like to see if there cannot be some support for this functionality.

What I have in mind is something very similar to the way attachments are handled in e-mail with multi-part MIME.

Doug Meade's picture

Detecting decreasing functions

In my work developing Maplets for Calculus, there are many instances when I want to determine that a function is monotone (decreasing or increasing or non-decreasing or non-increasing) on an interval. If I can do one of these, I can do them all. So, let's focus on decreasing.

I have no problem assuming f is continuous and differentiable on the interval. The interval could be unbounded, and I am not terribly concerned about endpoints (at least now).

Given a function f, how would you use Maple to determine that f is decreasing on an interval (possibly unbounded)?

Doug Meade's picture

bug in iscont?

Can anyone explain why Maple has so much trouble deciding if sqrt(2^x+x^4) is continuous for k>=1?

f := 2^x+x^4;
                                      x    4
                               f :=  2  + x 
iscont( f, x=1..infinity );
                                    true
iscont( sqrt(f), x=1..infinity );
                                    FAIL
iscont( sqrt(f), x=1..100 );
                                    FAIL
solve( f>0, x );
                                      x

Accoring to the online help for solve,inequal, the last result means Maple understands that f>0 for all real values of x.

So, given all of this, what is the problem deciding that sqrt(f) is continuous for x>=1?

OR, is this a bug?

Doug Meade's picture

Displaying Functions: A Request

As new features are being built into upcoming releases of Maple, here is one request that would be very helpful for those of us who use Maple to teach lower-level (Calculus) students.

Maple can work nicely with functions, but students are not always so comfortable with this language. Here's a current example.

Suppose you want to find the tangent line to a function. We might work as follows.

> f := x -> sqrt(4-x^2);
                                      /     2\
                             x -> sqrt\4 - x /
> df := D( f );           # typed, or from context-menu
                                         x      
                            x -> - ------------
                                       /     2\
                                   sqrt\4 - x /
> TL := f(1)+df(1)*(x-1); # tangent line at (1,sqrt(3))
                           (1/2)   1  (1/2)        
                          3      - - 3      (x - 1)
                                   3               

This works nicely and looks fine. Now change the function.

f := x -> sin(x);
                                 x -> sin(x)
df := D( f );           # typed, or from context-menu
                                     cos
TL := f(1)+df(1)*(x-1); # tangent line at (1,sin(1))
                           sin(1) + cos(1) (x - 1)

This works fine, but does not LOOK good. The problem is that Maple is TOO SMART. It knows that the derivative function (x->cos(x)) is simply the cosine FUNCTION. Instead of the abbreviation (cos) I want to be able to tell Maple to show this result as (x->cos(x)).

Doug Meade's picture

More solve curiosities

It's a new day, but not a new problem.

Yesterday I asked about solving inequalities with abs. Today I am looking at solving an equation with abs.

Try the following:

restart;
q :=  sin(x)/x - 1:
test4 := y -> [ y,
                solve( q=y, x ),
                [solve( abs(q)=y, x )],
                fsolve( q=y, x ),
                fsolve( abs(q)=y, x ) ]:
test4(  0  );
test4( 0.1 );
test4( 0.5 );
test4( 1/2 );
test4(  1  );

[                         /sin(x)           \                -13]
[ 0,   0, [0],      fsolve|------ - 1 = 0, x|, 1.869896012 10   ]
[                         \  x              /                   ]

Quick, what numbers x satisfy:

abs( x-2 ) < 1

How does Maple answer this?

solve( abs( x-2 ) < 1, x );
                         RealRange(Open(0), Open(2))

Now, change the RHS to 1. (floating-point 1):

solve( abs(x-1) < 1., x );
           RealRange(1., Open(2.)), RealRange(Open(0.), Open(1.))

Of course, these two intervals can be combined to the one interval. Maple 10 did not have this problem. (I will explain what Maple 11 is doing later, I want the next paragraph to appear in the truncated version of this post.)

This issue is important for those of us trying to use Maple in the classroom. While it's not difficult to explain what is going on, the point is that this is not the mathematics I am trying to teach and these issues are a distraction.

Simplification of trigonometric expressions is one area where computer algebra systems have yet to catch up with human experience. Experienced Maple users know that Maple prefers powers of cosine to powers of sine and powers of secant to powers of tangent. This is adequate for many situations. There are a variety of tools available within Maple that can be used to put expressions into another form.

One example is convert( ..., sincos ). This conversion replace all trigonometric terms with an equivalent term involving only sine and cosine (and all hyperbolic terms with equivalent terms involving only sinh and cosh). Until now, there has been no analog for secant and tangent.

Syndicate content
}