Trying to solve mathematical problem using programing skills

Started by
12 comments, last by Cagnazzo 11 years, 4 months ago
Python is great for this kind of thing. I just pull up the shell and hack a quick function together. Great for GCD, LCM, co-primality, etc. Quicker than C++ to compile and run.
I just rewrite the function every session I want to use it, which ends up with me learning the definitions of these things very thoroughly (and degrading my mental arithmetic).


Sigma notation can be difficult to read if you're not used to it. It's actually quite straightforward, but for some reason large Greek letters can stun the brain for several seconds. (This happens to me often and is probably a sign of poor nutrition or a brain injury resulting from sitting too close to the television as a kid.)


What scares you more, a sigma with a large expression or an integral sign with a large expression?
Advertisement
I love math notation for two reasons.
1) Being able to read it feels like translating hieroglyphics, which is kind of fun
2) It is incredibly condensed communication: throw 4 symbols down on paper and you've just described a vector space, or a specific group of values, or an entire relationship between values

Especially things like set notation descriptions, those looked like gibberish to me until I sat through a discrete math course.

Anyhow, Project Euler is interesting because there's groups of people who are so focused on the most elegant or minimalist answer, and there's people who want to use their language of choice to solve the problems in any means necessary (treating it as an art or a learning task, respectively). The bottom line is still the same though, so I never give someone crap for using a brute-force or messy algorithm: programming lets us solve problems and complete tasks in a fraction of the time it would take to obtain the answer in meat-space.

...Except that problem asking for the nth prime, looking up prime numbers on the internet is just way too easy.

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)


What scares you more, a sigma with a large expression or an integral sign with a large expression?

Depends if you're asking for series simplification or not. I loved calculus because it was algebra on steroids and felt like number alchemy. But I was always crap with series. The one place I loved seeing sigmas was in induction proofs.

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)


Python is great for this kind of thing. I just pull up the shell and hack a quick function together. Great for GCD, LCM, co-primality, etc. Quicker than C++ to compile and run.
I just rewrite the function every session I want to use it, which ends up with me learning the definitions of these things very thoroughly (and degrading my mental arithmetic).

Python is pretty good, but you'd be amazed at how well Haskell does with Project Euler.

There are tons of problems that it just chews through with no thought. Which is exactly what you'd expect from a purely functional language, really tongue.png

This topic is closed to new replies.

Advertisement