3,009 karma · joined May 6, 2009 (17y ago) · 324 submissions
Email at <my user name>@gmail.com
comment 12y ago · link · parent
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.
comment 12y ago · link · parent
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?
comment 12y ago · link · parent
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
comment 12y ago · link · parent
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).
comment 12y ago · link · parent
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.
comment 12y ago · link · parent
Source: I used to work in high frequency trading.
comment 12y ago · link · parent
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_numbercomment 12y ago · link · parent
Which, by the way, is an excellent paper and totally worth reading.
http://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pd...
comment 12y ago · link · parent
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.
comment 12y ago · link · parent
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.
comment 12y ago · link · parent
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."
comment 12y ago · link · parent
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.20.
Dijkstra's specification for a million dollar computer in 1965 [pdf](cs.utexas.edu ↗)
2 points · by crntaylor · 12y ago · discuss
comment 12y ago · link · parent
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 Headcomment 12y ago · link · parent
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.
comment 12y ago · link · parent
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.