The Mathematical Hacker
101–110 of 135 posts
Re: The Mathematical Hacker
#102Picking on Fibonacci of all things? The goal of fibonacci and factorial examples are to teach recursion. Both fibonacci and factorial are good starting points for a beginner. It can be followed by discussions of dynamic programming where the student can be introduced to recurrence relations and solving them top-down and bottom-up. EDIT: Adding some background on dynamic programming For dynamic programming, the proble…
I think you sort of answered your own question. Fibonacci and factorial functions have closed forms that can be computed efficiently than implementing the recurrence relation both in terms of clock cycles and developer time. While there are a lot of dynamic programming problems that do not easily reduce to closed form expressions, there are a lot that do. Maybe there are better examples for students to learn that of…
It doesn't matter. The purpose of fibonacci is to understand recursion and dynamic programming. I have never ever encountered a practical problem where I need the value of nth fib. How does it matter it has a closed form and it takes less clock cycles when I almost never need it?
> While there are a lot of dynamic programming problems that do not easily reduce to closed form expressions, there are a lot that do.
The practical dynamic programming problems which have closed form and we need the value and not workout the whole series are rare. Fibonacci is a learning tool, so is factorial. The practical dynamic programming problems viz. longest common subsystem, interleaving, alignment, travelling salesman, matrix multiplication etc either don't have a closed form, or the closed form isn't useful.
"How many ways to change 100 using 1, 5, 10, 20, 50" does have a closed form, but more often than not, if I encounter a practical variant, the closed form is useless as the "how many ways" is not interesting, but the actual combinations are.
> Maybe there are better examples for students to learn that of similar difficultly, but lack closed form solutions. The Fibonacci one still seems useful since you might be on a system that doesn't provide the lgamma function.
The existence of closed form is immaterial. Closed form exists for Fibonacci doesn't affect learning recursion and dynamic programming.
Also, Fibonacci's closed form isn't defined in terms of lgamma.
> However, this sort of knowledge is exactly the kind that, in large enough occurrences, leads to game changers and serious disruption in industries.
I don't have to know the closed form beforehand to find one when I need it.
Re: The Mathematical Hacker
#103Earlier quoted context omitted.
I respectfully beg to differ that "mathematics isn't about numbers or even proofs." Why are the math books on my shelves full of numbers and proofs? What was it I was wasting my time on in graduate school? This sort of definition (really a non-definition) is so vague that it robs mathematics of its character. Is mathematics important merely because many people believe that mathematicians are clever?
Mathematics itself is about structures and operations, properties of mathematical objects (like closedness and completeness) a.s.o. Numbers and proofs are just the tools of mathematics to work with those things.
Philosophers of mathematics spent the 20th century what mathematics is all about and they did not settled on any potential definition.
Re: The Mathematical Hacker
#104I'm in the Yegge school, so far as I think that the mathematical ignorance and, more generally, anti-intellectualism of our industry is its downfall. We see it in the lack of design sense and the awful code that is produced. VisitorFactory nonsense is something that was invented by people who hated math and wanted to tear programming away from its mathematical/problem-solving roots with a bunch of junk complexity tha…
The part about us being teachers more than engineers or programmers jumped at me. I've long held the belief that code should be written far more for those reading it than for the machine executing it. Your comment builds on that and made me think of this mantra: "The machine executing my code to produce an application is a side-effect. The main purpose of my code is to teach others how I control the machine into prod…
From here http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-7.html , second paragraph. The second part also responds to the original topic.
Re: The Mathematical Hacker
#105Re: The Mathematical Hacker
#106Earlier quoted context omitted.
When one first encounters factorials, it often is the case that one uses them to calculate ratios of factorials, the simplest bing n!/(n-1)! = n. This example is a natural one to think about recursively. The comparable examples for sums would be the difference of two sums ... and this is rarely done (except perhaps in the case of proofs of the sum of integers from 1 to n, etc.)
n(n+1)/2 also exists as a simple direct method of summing a series of 1..n. There's no similar (obvious) shortcut for n! (I don't count lgamma as obvious...)
Re: The Mathematical Hacker
#107I think it's also easy to stare oneself blind on low-level stuff. We need people that have higher skills in the domain that the code should solve that can code. Having coders in one camp and then the "product owners" in another camp leads to solutions that doesn't work for either group.
Re: The Mathematical Hacker
#108Earlier quoted context omitted.
Mathematics itself is about structures and operations, properties of mathematical objects (like closedness and completeness) a.s.o. Numbers and proofs are just the tools of mathematics to work with those things.
This description defines abstract algebra and some topology well, but I am an applied mathematician and for me mathematics is about number crunching and stability of this number crunching. Without numbers or numerical structures like polynomials and matrices you'll only have set theory, some parts of algebra and some mathematical logic. Philosophers of mathematics spent the 20th century what mathematics is all about…
Ok, I have to disagree with you here. What Godel established is that there's no complete axiom system. Every mathematical formalism will have statements P for which neither P nor ~P can be proven. This was not an unexpected result. What makes Godel's Incompleteness Theorem awesome is that it proved incompleteness, which few people thought possible.
Same with Turing and the Halting Problem. Almost no one actually believed that such a program (that could determine, algorithmically, if a program halted) existed. If one did, it would blow open all of mathematics. Turing proved, in a very elegant way, that it didn't.
What 20th-century mathematicians agree upon is that mathematical statements aren't "true" or "false" in an absolute, platonic sense, but that they are products of the axiom systems that generate them.
Whether the Axiom of Choice or Continuum Hypothesis are "true" is meaningless. These aren't mathematical "controversies" that have people yelling at each other saying that the other is wrong. They're axioms about infinity (specifically, uncountable infinity) that, although they have no physical correlates (you can't actually Banach-Tarski an orange) are logically independent of the "obvious" axioms. What logically independent means is that neither L nor ~L will generate a contradiction, and therefore neither has any absolute high ground.
Most mathematicians use AoC and CH for typical mathematics, but there are alternative mathematical worlds in which they don't hold, and those are interesting in their own right.
Re: The Mathematical Hacker
#109^---So true.
Re: The Mathematical Hacker
#110Earlier quoted context omitted.
> A good network programmer should have at least passing knowledge about graph theory (the network is a graph), queueing theory (how else are you going to size your buffers?), and also some statistics (given these numbers, how much bandwidth will be taken by resends? How much data can we send per hour? How many 9s do we get for 'probability that a messages is handled within 10 seconds'?) Partial differential equation…
I am in love with Feynman. He's so captivating.