HN user

crntaylor

3,009 karma

http://www.linkedin.com/profile/view?id=19184234

Email at <my user name>@gmail.com

Posts20
Comments289
View on HN
www.cs.utexas.edu 12y ago

Dijkstra's specification for a million dollar computer in 1965 [pdf]

crntaylor
2pts0
lorenabarba.com 12y ago

12 Steps to Navier Stokes (Computational Fluid Dynamics in Python)

crntaylor
1pts0
en.wikipedia.org 12y ago

The Bethe-Feynman formula for the yield of a fission bomb is still a secret

crntaylor
1pts0
blog.erudify.com 12y ago

Erudify eLearning white paper: "Introducing Adaptive Learning for Enterprise"

crntaylor
2pts0
www.ft.com 13y ago

Big data meets the bard: using technology to study literature

crntaylor
2pts0
notebook.kulchenko.com 13y ago

Robot juggles two ping pong balls.

crntaylor
9pts0
math.stackexchange.com 13y ago

A naming scheme for blocks in Tetris, Pentris, Hextris, etc

crntaylor
2pts0
chris-taylor.github.com 13y ago

The Algebra of Algebraic Data Types, Part 3

crntaylor
7pts0
chris-taylor.github.com 13y ago

The Algebra of Algebraic Data Types, Part 2

crntaylor
8pts0
chris-taylor.github.com 13y ago

The Algebra of Algebraic Data Types

crntaylor
116pts24
chris-taylor.github.com 13y ago

Haskell I/O is pure

crntaylor
75pts32
www.sandia.gov 13y ago

You shouldn't use the rainbow color map for visualizations [pdf]

crntaylor
2pts0
izbicki.me 13y ago

The categorical distribution's structure (and why programmers should care)

crntaylor
1pts0
math.ucr.edu 13y ago

Math notes to take you from one year of college calculus to grad student level

crntaylor
217pts63
www.youtube.com 13y ago

The algebra of algebraic data types (London Haskell talk)

crntaylor
4pts0
bos.github.com 13y ago

High performance in Python and Haskell (Bryan O'Sullivan presentation slides)

crntaylor
8pts5
stackoverflow.com 13y ago

For extremists only: containers, calculus, comonads and combinatorics ahoy

crntaylor
6pts1
chris-taylor.github.com 13y ago

Physics in Javascript - Synchronization

crntaylor
2pts0
www2.eng.cam.ac.uk 13y ago

What keeps a bicycle upright?

crntaylor
2pts0
class.coursera.org 13y ago

Functional Programming Principles in Scala course starts today

crntaylor
1pts1

The part that really surprised me was this:

  We only had 23 years of Python interpreter development,
  how would things look like when Python is 42, like C?
C, which I always think of as an ancient venerable systems language, is less than twice as old as Python, which I think of as a hot new kid on the block.

In thirty years, when my career will probably be drawing to a close, Python will be 53 years old and C will be 72 years old. Barely any difference at all.

It was a reference to the Hemingway app. If you paste acqq's comment into Hemingway, it suggests "Four adverbs used. Try to aim for two or less."

As humour goes, it's a few levels of indirection away from Seinfeld. But you're on a forum full of people who spend all day thinking of abstractions for their abstractions, so what do you expect?

The Book of Graham 12 years ago

You might not work any less hard, but you'll certainly take more risks if you don't experience the downside.

Answer quickly - how much of your net worth would you risk on a bet with 1% chance of a 1000X payout? Now how much would you risk if you can hand off 90% of any loss you take to someone else?

The difference is what we call moral hazard: http://en.wikipedia.org/wiki/Moral_hazard

The Book of Graham 12 years ago

The investment banking industry basically invented the concept of OPM (other people's money) in the 1980s (okay, I'm sure it existed before that, but the 1980s was when it became a buzzword).

A great read if you're interested in learning more about the history and operating procedures of the sales & trading side of investment banking is Traders, Guns and Money by Satyajit Das. Its sections on credit default swaps and collateralized debt obligations are particularly interesting when you consider that they were written in 2006, pre-crisis (around the same time that Leveraged Sell Out was getting started, in fact).

In case it's not clear to you, there are two reasons that you are getting downvoted: 1. snark, and 2. you are committing the logical fallacy of affirming the consequent. [0]

In particular, dijit asserted that "Not ACID => Not secure" (which is debatable, but that doesn't matter here) from which you can also validly deduce the contrapositive "Secure => ACID". However, you then (sarcastically) asserted that dijit is saying "ACID => Secure", whereas in fact he said nothing like that.

[0] http://en.wikipedia.org/wiki/Affirming_the_consequent

You tend to hear high frequency traders refer to the code that makes pricing and trading decisions as a system, or signal, or model, or (very occasionally) algo (all refer to slightly different things) but I have never heard them refer to the code that makes trading decisions as a bot or algobot.

Source: I used to work in high frequency trading.

The Egg (2009) 12 years ago

This would have been a significantly more enjoyable experience if the title of the submission didn't give away the ending.

The pattern will break down once you get past 8192, which is 2^13. That means that the pattern continues for an impressive 52 significant figures (well, it actually breaks down on the 52nd digit, which will be a 3 instead of a 2).

The reason it works is that 9998 = 10^4 - 2. You can expand as

    1 / (10^n - 2) = 1/10^n * 1/(1 - 2/10^n)
                   = 1/10^n * (1 + 2/10^n + 2^2 /10^2n + 2^3 /10^3n + ...)
which gives the observed pattern. It breaks down when 2^k has more than n digits, which happens approximately when
    2^k > 10^n   =>   k > n log(10) / log(2)
which comes out to 4 * log(10)/log(2) = 13.28 when n = 4.

---

Another pattern can be generated from the power series expansion

    x / (1 - x)^2 = x + 2x^2 + 3x^3 + 4x^4 + ...
setting x = 1/10^n gives the infinite series
    1/10^n + 2/10^2n + 3/10^3n + ...
which leads to the neat fact that
    1 / 998001 = 0.000 001 002 003 004 005 006 007...
---

Another example is the fraction

    1000 / 997002999 = 0.000 001 003 006 010 015 021 ...
which goes through the triangle numbers[0] in its expansion, or
    1 / 998999 = 0.000 001 001 002 003 005 008 013 021 ...
which goes through the Fibonacci numbers[1].

---

Getting the squares is harder, but you can do it with

    1001000 / 997002999 = 0.001 004 009 016 025 036 049 ...

[0] http://en.wikipedia.org/wiki/Triangle_number

[1] http://en.wikipedia.org/wiki/Fibonacci_number

"Turning your code inside out" is a great piece of advice, as it often opens up abstractions and refactorings that you didn't realize where there to begin with. The same idea is behind several common object-oriented design patterns (Command, Mediator, Strategy, Visitor) but it's baked into to many functional programming languages.

For example, say we want to write a function to compute square roots. A common approach to computing sqrt(n) is to start with a guess of x = 1.0, and keep replacing x with (0.5 * (x + n/x) until the relative difference between subsequent guesses is small enough.

  sqrt n = loop x0 x1
   where
    loop x y = if converged x y
      then y
      else loop y (0.5 * (y + n/y))
    converged x y = abs (x/y - 1) < 1e-10
    x0 = 1.0;
    x1 = 0.5 * (1.0 + 1.0/n)
That's good, but it has the test for convergence all mixed up with the logic for generating the guesses. What if we could factor out the code that generates an infinite sequence of guesses?
  sqrtGuesses n = go 1.0
   where
    go x = x : go (0.5 * (x + n/x))
Note that this works in Haskell because of laziness, but it's simple in any language that has a mechanism for delaying computations. Now we've decoupled the method for generating a sequence of guesses, we can write a function that checks for relative convergence
   converge (x:y:rest) = if abs (x/y - 1) < 1e-10
     then y
     else converge (y:rest)
and define the square root function in terms of these
   sqrt n = converge (sqrtGuesses n)
The logic of the program is now much cleaner, and we've got a useful function 'converge' which can be re-used in other parts of the program.

This kind of 'turning inside out' is often possible in functional languages, often leads to more compact and more compositional code, and is one of the reasons that I enjoy programming functionally so much.

Money and wealth 13 years ago

Disclaimer - I've never played Starcraft or Magic: The Gathering.

But I expect that in both of them, just like in real life, there is some value to having unspent liquid assets, in that they give you optionality. Unspent liquid assets can be converted at a later time into marines/computing hardware/other 'real' assets, depending on what is most needed at the time. If you turn all of your liquid assets into illiquid assets as soon as you get them, you lose that optionality.

I know an accounting joke:

An engineer and an accountant are on a train when they pass between two fields of sheep.

"Boy, there are a lot of sheep in those fields." says the engineer.

"There are 1,005" says the accountant.

"How do you know?"

"Well, there are about 1,000 in that field, and there are 5 in the other one."

Anyone thinking about taking this course should be aware that Bruno Latour is not, and has never been, a scientist. He is in the same camp as Derrida, Lacan and Foucault, in that he has a great deal to say about science but very little experience of it.

He is the creator of 'Actor-Network Theory'. I summarize the introductory paragraphs from Wikipedia, to give you a flavor.

  Actor–network theory is an approach to social theory and
  research, originating in the field of science studies, which treats
  objects as part of social networks. It can technically be described
  as a "material-semiotic" method. This means that it maps relations
  that are simultaneously material (between things) and semiotic 
  (between concepts). It assumes that many relations are both 
  material and semiotic.

  Broadly speaking, ANT is a constructivist approach in that it 
  avoids essentialist explanations of events or innovations (e.g. 
  explaining a successful theory by understanding the combinations 
  and interactions of elements that make it successful, rather than 
  saying it is “true” and the others are “false”). However, it is 
  distinguished from many other STS and sociological network theories 
  for its distinct material-semiotic approach.

Completely shameless plug for a tiny probabilistic programming language that I wrote as an embedded DSL in Haskell:

https://github.com/chris-taylor/hs-probability

The code that solves this problem is:

  solve = do
    coin   <- choose (999/1000) fair biased
    tosses <- replicateM 10 coin
    condition (tosses == replicate 10 Head)
    nextToss <- coin
    return nextToss
   where
    fair   = choose (1/2) Head Tail
    biased = certainly Head

I would also REALLY hope that somebody who is applying for a job in finance understands the bond prices and interest rates.

You'd be surprised at how many people can't answer instantly. Or how many people can't give a convincing description of what a share is, and what rights it gives you.

These are all easy questions, which to my mind is the point. The fact that someone can answer them doesn't tell you much, but if someone can't answer them then you need to think very hard about whether to hire them.

Sure. The slick answer is

The chance of picking the biased coin is 1/1000. The chance of seeing 10 heads from a fair coin is (1/2)^10 = 1/1024. These are nearly equal, so given that you've seen 10 heads, there is a 50/50 chance of having a biased coin. So the probability the next flip shows a head is

  P(H) = P(biased) * P(H|biased) + P(fair) * P(H|fair)
       = 0.75
The long answer -

Yo want to figure out P(biased | 10H). Using Bayes rule this is

  P(biased | 10H) = P(10H | biased) * P(biased) / P(10H)
                  = P(10H | biased) * P(biased) / (P(10H|biased) * P(biased) + P(10H|fair) * P(fair))
                  = 1 * (1/1000) / (1 * 1/1000 + 1/1024 * 999/1000)
                  ~ 0.5
and you now compute the probability of the next toss being a head as above.

Interesting. I think the proof of Wilson's theorem is easy enough to be accessible for a non-mathematician - for non-prime n you can find a pair of numbers in the product (n-1)! that are congruent to 0 (mod n), and if n is prime then you pair up numbers in the product with their inverses until you are left with ±1.

But I can't think of a similarly low-level proof of Fermat's Little Theorem. Is there an obvious one I'm missing?

I was a mathematician, and now work in finance (systematic trading). I've found a reasonable negative filter is

  A jar has 1000 coins, of which 999 are fair and 1 is double
  headed. Pick a coin at random, and toss it 10 times. Given
  that you see 10 heads, what is the probability that the next
  toss of that coin is also a head?
That tests their ability to turn a problem into mathematics, and some very basic conditional probability. Another common question (that I don't use myself) is to ask what happens to bond prices if interest rates go up.

The author's main problem stems from his desire to use Stack Overflow as a mechanism for gaining internet points - as is illustrated by his confession that

  "I saw a simple Java question, hit Google, read briefly, then
   synthesized an original answer."
Why bother? Instead, I use Stack Overflow predominantly for three reasons --

1. To ask interesting questions that I think will get a better answer there than anywhere else (eg [0,1,2]).

2. To help educate other programmers about languages that I like very much, and would like to see in wider use. I endeavour not to just give a "how to do X" answer, but instead explain what the different approaches are, and why some approaches are better than others (eg [3,4,5])

3. To stay in touch and build a reputation among the wider community of Haskell programmers - not by amassing internet points, but by asking interesting questions and giving interesting, thoughtful answers.

If you just game Stack Overflow for imaginary internet points, it's no wonder you don't find it very fulfilling.

[0] http://stackoverflow.com/questions/9190352/abusing-the-algeb...

[1] http://stackoverflow.com/questions/10753073/whats-the-theore...

[2] http://stackoverflow.com/questions/19177125/sets-functors-an...

[3] http://stackoverflow.com/questions/11684321/how-to-play-with...

[4] http://stackoverflow.com/questions/12968351/monad-transforme...

[5] http://stackoverflow.com/questions/20857165/move-or-copy-in-...

This is really interesting - I didn't know about that snippet of Lisp history. So the expression we'd write today as

  (car
    (append
      '(a b c)
      '(d e f)))
Would originally have been written in M-expression form as
  car[append[(a b c); (d e f)]]
Programming in Lisp might be a very different experience if M-expressions had caught on!