Items tagged with blog blog Tagged Items Feed

Birthday Post...

August 05 2010 John May 1827 Maple

Today is my birthday, and in fact it is also the birthday of at least one other Maplesoft employee (not surprising since more than 23 people work here - considering the generalized birthday problem, I even know of 3 people here who share the same birthday).  Of course, it turns out that birthdays are not evenly distributed through out the year and so I wanted to know if someone with an August birthday is more likely to share than someone with an April birthday. 

Continuing on in this series of posts, here is a way to test the randomness of a sequence of bits from a PRNG that is the appropriate to the first morning back after the August long weekend.  It is a very fast, and not very formal test done by checking how well a sequence compresses. This is really easy in Maple 14, with the new commands ?StringTools:-Compress and StringTools:-Uncompress which use ...

Monte Carlo Pi...

July 28 2010 John May 1827 Maple

In a previous post, I promised to write about testing the quality of pseudo-random number sequences.  I'll post later about some of the statistical tests often used, but I first wanted to mention a sort of practical test one can do. One of the many things you might want to do with pseudorandomly generated numbers is Monte Carlo integration/simulatation/etc.  As mentioned by acer in this comment, Monte Carlo integration can be shown to work better with some of the pseudorandom number generators (PRNGs) which are considered inferior in a statistical sense.  In this post, we will play with a simple Monte Carlo approximation of π.

There are two pieces of extended functionality that I quite often want from the Maple Compiler. The first (task A) is to be able to link in and use an arbitrary function from some other external ("3rd party") shared library, within my Compile'd Maple procedure. The second (task B) is to directly call the compiled Maple procedure from within some computational routine in a 3rd party shared library (which I would then access using define_external). This post is about the first of those, task A.

It always makes me happy to see people using Maple for interesting things.  So I was pleased to see this blog post on Technology Review about this paper on arXiv on quantum randomness.  In this case, they are just comparing random numbers generated from lasers (this is why physicists get better press than mathematicians: LASERS!) with pseudo-random numbers generated using Meresenne Twister implemented in Maple, pseudo-random numbers generated using a Celluar Automata method implemented in another computer algebra system, and then binary digits of π treated as a pseudo-random sequence.  (Spoiler: the lasers win)

While not a particularly interesting use of computer algebra systems, it did inspire me to revisit my old blog post on pseudo-random numbers in Maple and now I am working on a follow up that talks about some of the mathematical and statitical tests used to test the quality of pseudo-random number sequences which I hope to post soon.

There is a probem in the Optimization package's (nonlinear programming problem) NLPSolve routine which affects multivariate problems given in so-called Operator form. That is, when the objective and constraints are not provided as expressions. Below is a workaround for this.

Usually, an objective (or constraint) gets processed by Optimization using automatic differentiation tools ...

Here is yet another finesse (new to me) in getting better performance for some floating-point computation involving the Statistics package.

> restart:

> X:=Statistics:-RandomVariable('Normal'(0,1)):

st:=time():
seq(Statistics:-Quantile(X,1/i,numeric),i=2..10000):
time()-st;[%%][-1];
6.786
-3.719016485

> restart:

> X:=Statistics:-Distribution(Normal(0,1)):

A recent announcement: ViennaCL, an OpenCL (GPU) based linear algebra library.

It would be interesting to see how it might be used from within Maple via external_calling (even if only for some simple examples).

If you're interested in scientific fonts, the 1.0 version release of the Scientific and Technical Information Exchange (STIX) fonts was announced today (May 28, 2010).

See here for its main page, or here for wikipedia's point of view.

Our previous article described the design of fast algorithms for multiplying and dividing sparse polynomials. We have integrated these algorithms into the expand and divide commands of Maple 14. In this post I want to talk a bit about what you might see when you try Maple 14. Keep in mind that the product isn't released yet and I don't work for Maplesoft, so general disclaimers apply. Nevertheless, one of the first things you may notice is this.

task manager with maple 14

In our previous article we described a packed representation for sparse polynomials is designed for scalability and high performance. The expand and divide commands in Maple 14 use this representation internally to multiply and divide polynomials with integer coefficients, converting to and from Maple's generic data structure described here. In this post I want to show you how these algorithms work and why they are fast. It's a critical stepping stone for our next topic, which is parallelization.

sdmp multiplication

Simon Plouffe has started an interesting thread on the usenet newsgroup comp.soft-sys.math.maple (viewable here, for those without good nntp server access).

They are discussing the speed of computation of exp(1.0...

There was some recent discussion about Maple's Standard GUI having two parsers. (See here, and its parent.)

I've been accumulating a list of some differences between the parsers of 2D Math and 1D Maple notation, for the same given pasted input.

In particular, I'm interested here in differences...

The program mint, bundled with Maple, is a very useful syntax checker and program analyzer.

As provided, `mint` works best with Maple program source when contained in plaintext files. Inside Maple itself there is a command maplemint which does some of the same tasks as the stand-alone program `mint`. Unfortunately `maplemint` is quite a bit weaker than `mint` is, for quite a selection of procedures. Also, `maplemint` doesn't have the sort of flexible control that `mint` provides through its optional calling parameters.

I had previously posted a Maple language procedure for the purpose of calling out to `mint` while inside Maple (Standard GUI, or other). Here it is below, cleaned up a little. Hopefully it now works better across multiple operating systems, and also provides its optional parameters better.

Our first article introduced Maple's polynomial data structure and explained how Maple spends a lot of time working with monomials. To multiply polynomials having n and m terms, Maple must construct, simplify, hash, and sort all nm pairwise products to determine what monomials are equal. This work is performed even if the result has far fewer than nm terms, making it a rather inefficient way to multiply large multivariate polynomials. This article describes a new data structure for multivariate polynomials that is being added to Maple for a future release.

sdmp packed arrays

9xyz  -  4yz  -  6xyz  -  8x  -  5

2 3 4 5 6 7 Page 4 of 7