John May

Dr. John May

3026 Reputation

18 Badges

17 years, 316 days
Maplesoft
Pasadena, California, United States

Social Networks and Content at Maplesoft.com

Maple Application Center
I have been a part of the Mathematical Software Group at Maplesoft since 2007. I have a Ph.D in Mathematics from North Carolina State University as well as Masters and Bachelors degrees from the University of Oregon. I have been working on research in computational mathematics since 1997. I currently work on symbolic solvers and visualization as well as other subsystems of Maple.

MaplePrimes Activity


These are Posts that have been published by John May

I recently ran into an interesting twist on the infamous Maple anti-pattern:

# A very garbagey way to build a list
l := [];
for i from 1 to 10000 by 100 do
l := [op(l), isqrt(abs(floor((5000-i)/2)))];
end do;

A lot of users fall prey to this method of building a list rather than using :

# generate a list without extraneous garbage
l := [seq(isqrt(abs(floor((5000-i)/2))),i=1..10000,100)];

To celebrate 3.14 for 2009, I made the attached worksheet with an interactive Pi Chart (also a pie chart) to plot the relative frequency of the digits of pi in various bases.  Enjoy.


View 5480_PiFreq-component.mw on MapleNet or Download 5480_PiFreq-component.mw
View file details

 

The guts of the worksheet is the following:

basesymbols := Array(0..35, ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]):

n := 200; # number of digits
k := 10; # base 
N := ceil(log[10](k)*n)+1;

approxPi := round(evalf[N+1]((Pi-3)*10^(N))):

PiList := map(x->basesymbols[x],convert(approxPi, base, k)): 

PiString := cat(op(map(convert, PiList[1..n], string))):

T := [StringTools:-CharacterFrequencies(PiString)]:

Statistics:-PieChart(T, color=blue..magenta);

 

The Maplesoft office is currently in the process of being burried in snow and many of us are getting ready to head off for the holidays.  Before leaving, I wanted to share this great animated GIF created using 3d plots.  It was sent to me by Bruce Char at Drexel University. The greeting and the Maple script to generate it are after the break.

In my previous post, I was parsing data out of HTML tables so that I could glean some trivia from it.  My true goal was to compile data out of dozens of such tables and so I needed a way to do the whole process in Maple.   So, now, here is how I used Sockets and StringTools to automate the whole process.

Recently there was some discussion in the Maplesoft office about unisex baby names (that is, names that nearly as likely to belong to males as females). Whenever discussing names, I usually head to the US Social Security Administration's wonderful baby names site. They have data on the top 1000 male and female names for children born in the US each year for more than the last century (that includes about 80% of names). They slice the data a little by US state, and popular names for twins and such, but they do not include data on unisex names. So, I applied Maple to the task.

First 7 8 9 10 11 Page 9 of 11