Live data from Hacker News

The Mathematical Hacker

evanmiller.org

91–100 of 135 posts

Re: The Mathematical Hacker

#91
post #77

i was amused by "calculus (the real kind)" to distinguish it from usages like "lambda calculus". don't think i've ever seen that one before, though it parallels usages like "a real doctor (not a phd)" and "anything with a science in its name isn't".

I think he just meant the calculus of real numbers i.e. calculus of infinitesimals.

Re: The Mathematical Hacker

#92
post #79
post #24

Picking 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…

Those problems which lack closed-form solutions might lack another attribute that the Fibonacci sequence has, namely, it's easy to wrap your head around the nature of the problem and to verify correct answers. It's purely a teaching tool.

It's also worth pointing out that someone who's taught about recursion, dynamic programming, and memoization using the Fibonacci sequence likely knows a lot more about those topics by the end than the person who's told "use lgamma and exp to calculate the nth Fibonacci number" knows about gamma functions. Unless, of course, you think that programmers should all take the necessary mathematics to know how to derive the relevant results themselves---maybe you do---but the author certainly doesn't present a case for that.

Re: The Mathematical Hacker

#93
post #87

Earlier quoted context omitted.

>anti-intellectualism of our industry is its downfall I just curious to find out, what downfall are you talking about ? Isn't software eating the world and Silicon Valley making billions ?

But there's an astounding lack of mathematical rigor in software. It may all call crumbling down like a house of cards. And it does. People don't know theory, nor do they want to learn it. They just want to get work done. Although all theory is dangerous too, I think a healthy mix is a good order.

All softwares are not created equal. Some are born as the law and some as graffiti on the wall. A lot of code these days is just disposable.Its only used for few months and thrown away for something new. The internet and mobile apps always stays in a fluid state as user requirements, devices and the environment keep changing. It would be unimaginably hard to provide mathematical rigor to every html page-scrapping script I write. Sure there must be mathematical rigor in software that has some serious uses like in real-time systems, rockets, cars etc. I would be very upset if my car vendor does not apply some serious math to their code for car's critical systems and I think they do. and as far as my mobile app is concerned I am happy with the Xcode's static analyzer.

Re: The Mathematical Hacker

#94
post #49
post #34

There's also the simple fact that programming literally is math. http://ncatlab.org/nlab/show/computational+trinitarianism

Programming is math, in the same way that accounting is. Doing programming all day will not make you a mathematician.

Programming is math, in the same way that accounting is.

If you read the link that's not what it says.

Doing programming all day will not make you a mathematician.

Sad truth. For now!

Re: The Mathematical Hacker

#95

I'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…

>>I think that the mathematical ignorance and, more generally, anti-intellectualism of our industry is its downfall.

For the kind of human scalability our industry is currently demanding, there is no other choice but to see this as a inevitable consequence.

Re: The Mathematical Hacker

#96
post #61
post #48

"If you are a systems and network programmer like Raymond, you can do your job just fine without anything more than multiplication and an occasional modulus." 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 rese…

> 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.

Re: The Mathematical Hacker

#97
post #90

" long int fac(unsigned long int n) { return lround(exp(lgamma(n+1))); } " Sounds great! What's the factorial of 40? Let's use some python: >>> int(math.exp(math.lgamma(41))) 815915283247882431423526575245034982027017846784L Huh, weird. I would've thought the factorial of 40 would be divisible by ten. Let's try it another way: Prelude> let fac n = foldr1 (*) [1..n] Prelude> fac 40 815915283247897734345611269596115894…

Well,

     lround(exp(lgamma(...)))
is just about the worst way to use lgamma. If long ints are signed 64 bit integers, then the largest factorial you can store is 20!. You might as well look it up in an array. But you frequently need ratios of factorials (and values of the gamma function more generally) when doing statistical computing and lgamma is invaluable.

Re: The Mathematical Hacker

#98

Earlier quoted context omitted.

I'm not sure why you think that math is somehow divorced from design patterns (in the abstract sense, not GoF). Some systems just need more moving parts than others, and math won't save you from that. Design sense and mathematical aptitude are complementary, not opposed, to one another. I think that "industrial get-your-boss-off-your-back-oriented development works" and "Complex work" is a false dichotomy.

Mathematics isn't about numbers or even proofs. It's about simplifying until you get that class of problems down to a conceptual "nub", while thinking in a very rigorous way. Instead of five oranges plus nine oranges being 14 oranges, you just say 5 + 9 = 14, and that applies to any countable quantity. It's because of these abstractions that we can predict the motions of planets or build computers. This also explains…

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?

Re: The Mathematical Hacker

#99
The case for relying on math more when programming is one pillar of a more general aim: for programmers to be more creative in their approach to solving problems programatically. IMHO, creativity can be learned, but not over night.

Creativity requires comfort with risk and can therefore be costly, which goes against the contemporary programmer's drive toward efficiency and optimization. Creativity requires bring a fresh perspective to each problem encountered, and can therefore be exhausting, which eschews the programmer's drive toward re-use and generalization. Creativity requires leaning on other disciplines for inspiration, which runs counter to the demands of being a language or technology expert.

With time, the grip of these convictions can be loosened and contextualized, allowing room to explore curiosities and creative impulses, many of which may be mathematical (or psychological, or involve re-framing), that arise naturally during the course of a project.

Re: The Mathematical Hacker

#100
post #98

Earlier quoted context omitted.

Mathematics isn't about numbers or even proofs. It's about simplifying until you get that class of problems down to a conceptual "nub", while thinking in a very rigorous way. Instead of five oranges plus nine oranges being 14 oranges, you just say 5 + 9 = 14, and that applies to any countable quantity. It's because of these abstractions that we can predict the motions of planets or build computers. This also explains…

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.
Post reply on HN