Live data from Hacker News

Ask HN: What is the big idea with algorithms?

news.ycombinator.com

11–20 of 28 posts

Re: Ask HN: What is the big idea with algorithms?

#11
post #6

"I'm a non-CS major and am much unlike many of you mathematical whiz kids who make up this board" Are there any math whiz kids on HN? (other than cperciva) There are many smart people on HN, but I don't think there are math whiz kids. This is a hacker forum, not a math forum like AoPS. Sometimes we discuss stuff like complexity and algorithms, but most of the time, we rant on Ruby x Python or why kids these days want…

> Whoever says that HN is made of math whiz kids probably knows very little math.

To generalize that: the term "whiz kid" is only used when you know so little about something that you believe it to be a black.

Re: Ask HN: What is the big idea with algorithms?

#13
Really I'd say the earliest machine "algorithms" was the operation of the abacus (http://wiki.answers.com/Q/How_do_you_use_an_abacus), such that moving certain beads around gave you certain numbers - this can be viewed as a rough input/output calculating system. This originated in China I believe thousands of years ago. All an algorithm really is is a sequence of steps to go from an input to an output - a finite, discrete, numerical sequence of steps. A trivial example would be:

Input X, Output 0

Algorithm:

while x is not equal to 0, subtract 1 from x

When x equals 0, return x.

This is a finite series of step to go from input (x) to output (0). I just subtract 1 from x over and over until I have 0.

No matter how complex algorithms can get they are basically the same thing, at least in sequential programming - I don't know too much about other more recent stuff to be honest - but traditional programming is just taking an input, applying a set of operations on the input, one at a time, until the set of operations is completed and you have an output. An algorithm is just a "recipe" or a set of operations. A recipe is a series of steps to be done to food to make a meal. Similarly an algorithm is a series of steps to be done to an input to make an output. Most languages are basically like this in programming: FORTRAN, C, ASSEMBLY are all basically this same idea of sequential, finite operations on inputs.

Re: Ask HN: What is the big idea with algorithms?

#14
When I first learned to program coming up with the algorithm was everything. I thought of how to move the data, compare it, and finally compute and represent the solution. As I grow more experienced the algorithms come naturally.

I now think in terms of rules, context and complexity. I mostly think about distributed algorithms and the key to me is always a small set of rules that all nodes must follow. Rules are generally reactions to events, involving communication and/or state changes. Much of the time the rules follow from some constraint, such as complexity requirements or limited information. There are often different possibilities so you consider the trade-offs based on your context. I approach computational problems in the same way. I figure out data elements need to interact and then come up with some reactive rules. The computation is the chain-reaction of those rules.

The algorithm follows from the rules. Essentially it is a formalization of the ideas into an iterative instruction framework. The algorithm can then be implemented on a computer by any competent engineer and may be analyzed mathematically (e.g. for formal proofs).

Re: Ask HN: What is the big idea with algorithms?

#15
post #6

"I'm a non-CS major and am much unlike many of you mathematical whiz kids who make up this board" Are there any math whiz kids on HN? (other than cperciva) There are many smart people on HN, but I don't think there are math whiz kids. This is a hacker forum, not a math forum like AoPS. Sometimes we discuss stuff like complexity and algorithms, but most of the time, we rant on Ruby x Python or why kids these days want…

What is a math whiz kid? I know there are a few professional mathematicians here -- professors, post-docs, etc.

...not a math forum like AoPS

AoPS seems to be about math competitions. Math competitions have about as much in common with real math as the space marines from DOOM (demons, plasma guns) have in common with real marines (marching, painting stuff, acronyms). Real math is about building theories that are as general and powerful as possible, or making tools, or finding and solving interesting problems in the real world.

Math competitions are about how many reductive insights you can come up with in two hours' time while sitting at a desk you're not allowed to leave except perhaps to go to the bathroom.

Re: Ask HN: What is the big idea with algorithms?

#16
To understand why algorithms are important, and how they are used, it might help for you to give up your mental model, described in your original question, of the link between physics and algorithms. They are not both attempts to represent some set of quantities. Rather, think in terms of physics as stating the equations (describing how the values relate to one another), and algorithms as methods for solving the equations (calculating the values).

So for example, physics describes the answer to "where will this spacecraft be five years from now?" while to compute a numerical answer you need to apply some particular algorithm (like a differential-equation solver).

Most of the algorithms in "Nutshell" are what you might call core-level methods of figuring things out. For example, the book describes different sorting algorithms. From your question, you sound more interested in what kinds of problems demand sorting (for example). For that, you might try a bigger-picture book, for example Steven Skiena's "Algorithm Design Manual." It goes into less detail about actual implementation, and more detail about what the algorithms do for you, and when you might apply them.

Re: Ask HN: What is the big idea with algorithms?

#19
post #6

"I'm a non-CS major and am much unlike many of you mathematical whiz kids who make up this board" Are there any math whiz kids on HN? (other than cperciva) There are many smart people on HN, but I don't think there are math whiz kids. This is a hacker forum, not a math forum like AoPS. Sometimes we discuss stuff like complexity and algorithms, but most of the time, we rant on Ruby x Python or why kids these days want…

What is a math whiz kid? I know there are a few professional mathematicians here -- professors, post-docs, etc. ...not a math forum like AoPS AoPS seems to be about math competitions. Math competitions have about as much in common with real math as the space marines from DOOM (demons, plasma guns) have in common with real marines (marching, painting stuff, acronyms). Real math is about building theories that are as g…

I agree with everything you wrote. However, it seems to me that AoPS is populated with math enthusiasts, while HN is populated with hackers. AoPS is indeed mostly about math competitions, and yes, math competitions have little to do with real math, but just count the number of great mathematicians who performed amazingly well in the IMO: Terry Tao, Misha Gromov, Grisha Perelman, etc. My point was not that AoPS is about real math, but rather that it's more likely to have math whiz kids than HN.

Re: Ask HN: What is the big idea with algorithms?

#20

http://artemis.cs.yale.edu/classes/cs460/Spring98/contents.h... is a very good resource on the parent science of algorithmic information theory. AIT and computational complexity theory arguably underlay all other sciences. They allow us to define randomness ( http://www.cs.auckland.ac.nz/~chaitin/georgia.html ), pattern, probability ( http://www.scholarpedia.org/article/Algorithmic_probability ), inference ( http://w…

References and a sincere, open answer. You deserve a lot more karma than the sophomorish comment currently leading the thread.
Post reply on HN