I have some knowledge of the mathematica language from my undergraduate studies in mathematics. I am more interested in mathematics than programming and don't really want to learn another language just for these problems.

Does anyone know if that will hinder me from solving them? Does the one minute rule apply to all languages? or just c++ or java or something?

## Mathematica

### Re: Mathematica

You should be able to solve most (if not all) problems with Mathematica. As for the one-minute rule, you may not be able to meet it for all the problems. That "rule" is primarily intended for compiled languages.

When you assume something, you risk being wrong half the time.

### Re: Mathematica

When you say not meet the one minute rule. Does that mean I should expect some problems to take a few minutes. Or several hours or something...

### Re: Mathematica

That will depend very much on the particular problem.

If you mainly use some built in mathematical functions it will be reasonably fast.

However, if you use it as a programming environment, it might be about 600-800 times slower than a compiled language.

And 600 minutes equals 10 hours....

I must confess that some problems were designed for programs like Mathematica to be very slow.

For others it might be a very useful tool.

If you mainly use some built in mathematical functions it will be reasonably fast.

However, if you use it as a programming environment, it might be about 600-800 times slower than a compiled language.

And 600 minutes equals 10 hours....

I must confess that some problems were designed for programs like Mathematica to be very slow.

For others it might be a very useful tool.

### Re: Mathematica

I've used Mathematica to solve the first 100 or so problems. Each was solved in less than 5 minutes run time.

* Mathematica supports parallel processing quite easily (ParallelDo, ParallelMap etc) which can reduce run time;

* Mathematica also supports "compilation". That is, it creates more efficient pseudocode for evaluating functions.

* The wealth of special functions (eg Prime, next prime etc) can often help

Many of the problems involve designing a test function then applying it over a large (but much reduced) search space so these hints hints do bring the runtime down significantly.

* Mathematica supports parallel processing quite easily (ParallelDo, ParallelMap etc) which can reduce run time;

* Mathematica also supports "compilation". That is, it creates more efficient pseudocode for evaluating functions.

* The wealth of special functions (eg Prime, next prime etc) can often help

Many of the problems involve designing a test function then applying it over a large (but much reduced) search space so these hints hints do bring the runtime down significantly.

### Re: Mathematica

I can confirm earlier claims: Mathematica is armed in pretty powerful parallelization tools and vast library of special functions. Just like all other turing-complete languages it allows solution of all classes of problems that are possible to solve in C (just using it as example, it is pretty much lingua franca for computers). But it can run sluggishly and not always operations can be done in parallel. This is when advantage of Mathematica diminishes.

What you gain in exchange is far less verbose code then most other languages. Most of my solutions above problem 100 take about five to ten times more code in C then in Mathematica.

If you would change your mind about learning another language, you could try Sage. Basically a Python framework with most of the Mathematica utilities. Runs faster in quite a lot of cases when compared to Mathematica. If you are not sure, you can make an account on their cloud computing platform and mess around for a while, preferably going through basic tutorial (easily done in about two hours on average per part, total would be around of 10-12 hours).

What you gain in exchange is far less verbose code then most other languages. Most of my solutions above problem 100 take about five to ten times more code in C then in Mathematica.

If you would change your mind about learning another language, you could try Sage. Basically a Python framework with most of the Mathematica utilities. Runs faster in quite a lot of cases when compared to Mathematica. If you are not sure, you can make an account on their cloud computing platform and mess around for a while, preferably going through basic tutorial (easily done in about two hours on average per part, total would be around of 10-12 hours).

- self-demoted from 357, I want to return to this score by solving everything in C/C++.