Sunday, December 28, 2008

Comp: Factoring integers in Matlab and Mathematica

Problem: Obtain factors for a very large integer, such as (2^227-1)

Answers (from Mma):
  • 26986333437777017
  • 7992177738205979626491506950867720953545660121688631

Mathematica V7 computes the exact factors in about 11 seconds (Mma V5 was 550 seconds) on my hardware. It has always amazed me that Mma can compute this at all.

Matlab R2007A cannot perform this factorization at all. The Matlab help command explains that TMW has decided to disable [i.e. integer factorization] for numbers greater than 2^32! The Matlab doc entry does not list this restriction at all.


Roger Williams
Franklin Laboratory
This post was originally posted on 7/15/2007 at:

Saturday, December 27, 2008

Tutorial: Automatic Annotation

This tutorial is about how to automate the annotation of a graphic created in Mma. This can be viewed with Mma Player.


Roger Williams
Franklin Laboratory

Friday, December 26, 2008

Correction: NDSolve plotting page contains invalid source input

On this Howto page, there is some clickable input listing a differential equation to be solved numerically and plotted.

The input has been URL-encoded, so it looks like:

ode1 = {y''[x] + Sin[y[x]] == 0, y[0] == 2, y'[0] == 1};

Where it should contain:

ode1 = {y''[x] + Sin[y[x]] == 0, y[0] == 2, y''[0] == 1};

The NDSolve[] invocation which follows this erroneous input understandably complains. Of course it does this in an unintelligible way.

There is more than one equation on this page with the same affliction.


Roger Williams
Franklin Laboratory

Correction: highlight issues where I find them

I use many Wolfram Research Inc (WRI) pages that contain Mathematica (Mma) input that you can click on, copy and paste/run in the product. On a very small number of these pages there are small errors that can frustrate users.

If I figure out the correction, I will post it here. I do not know if anyone at WRI has time to worry about these crumbs.


Roger Williams
Franklin Laboratory

the motivation

I have just started using Mma V7. My head is exploding since I never really got caught up to the V6 version.

I am very excited to be using this new version and it served as the motivation for this blog to help more people use this amazing piece of software.

So the main the word that will be the common thread to this [and any good software] is: consistency of design. In software engineering this is the highest compliment and the main attribute to help the mind combat the complexity of any powerful piece of software.

Now to the journey....