Posted on Jan 14th, 2011 in
Books,
Mathematics |
5 comments
There’s exciting news in Computer Science-land this week, as the 4A volume (on Combinatorial algorithms) of The Art of Computer Programming by Donald Knuth is now complete and is available for preorder on Amazon.
To make things even more intriguing, and to really get all of us CS/programming/math enthusiasts salivating, the boxed set is also made available for preorder (it’s slated to ship out next...
Posted on Jan 1st, 2009 in
Mathematics,
Python,
Ruby |
27 comments
Reading Jeff Atwood’s post The Problem of the Unfinished Game, reminded me of a similar problem. The Monty Hall Problem is a well known probability puzzle that has tricked many people. In fact, if you are not familiar with it already, chances are that you’ll get it wrong. And you would be in good company along with many mathematicians and physicists, including the great mathematician, Paul Erdos. This...
Posted on Feb 5th, 2006 in
Mathematics,
Quick Tips |
3 comments
INPUT: a string containing decimal numbers.
OUTPUT: an array containing all the decimal numbers within the given string.
You can accomplish this task very quickly with the String#scan method and the right Regular Expression (regex).
Given a string s, you can use:
numbers = s.scan /[-+]?\d*\.?\d+/
numbers will be an array whose elements are the decimal numbers within the string s. Note how the regex considers the...
Posted on Jan 30th, 2006 in
Mathematics |
Comments Off
A couple of weeks ago I’ve discovered a very interesting and addictive website MathsChallenge.net . They have a section called Project Euler where participants can try to resolve more than 100 mathematical problems. The scoring system is really well done and the discussion forum for each problem is accessible only after having solved the given problem.
It’s interesting to see how other people try to...