Geek Humor

LoganCapaldo: your welcome
LoganCapaldo: s/your/you're
LoganCapaldo: see Regexp's can fix grammar
lectrick: that's not regex, that's sed.
curi42: "your" was a regex
kreaturr: lectrick: you can make LoganCapaldo's example a bit more readable (like abolish the $& variable in it)
LoganCapaldo: yar
LoganCapaldo: but no one saw the _meta_ joke?
LoganCapaldo: where "Regexp's" was grammatically incorrect
LoganCapaldo: I give up
LoganCapaldo: I was obviously not meant for geek stand up ;)
curi42: oh. heh. i thought it had to do with grammers for languages being parsed with a regex based engine.
zenspider: geek humor is NEVER funny.
zenspider: it is a law of nature
curi42: yes it is!
zenspider: no, it isn't... ever.
curi42: People just sometimes don't laugh until the next day if the joke was O(2^N) or something.
zenspider: and it is grammars </peeve>
zenspider: curi42: you keep believing that...
curi42: my best joke ever people are due to laugh next year... :)
kreaturr: curi42: it got a chuckle, but it was somewhat immediate - so I guess it was low N.
curi42: hehe
lectrick: kreaturr: how to replace the $& to something more legible?
LoganCapaldo: { |same_as_funny| same_as_funny.scan ... }
lectrick: curi42: LOL

Elliot Temple | Permalink | Messages (0)

Elliot Temple | Permalink | Messages (0)

Cheap Global Warming Solution

Tom: i need a fan
Tom: will buy tomorrow maybe.
Elliot: fan > no fan
Elliot: (i'm smart)
Tom: i seem to remember that the curi fan will solve global warming crisis
Elliot: i dunno. if there is enough global warming i'll prolly get a second fan
Tom: lmao
Elliot: if a fan costs $10 (a good, big one), and there are 6 billion ppl, (when u mass produce this much i bet they cost much less than $10 .. let's say $5) ... then global warming will cost ....
Elliot: 30bil (max)
Elliot: plus electricity and fan maintanance
Elliot: that sounds like a lot less than kyoto's 500 thousand trillion

Elliot Temple | Permalink | Messages (2)

Being Sympathetic To Children

I'm going to tell a short story about what it's like to be young. It's about food, but it could just as well be about homework or cleaning or all sorts of other things. Then I'm going to make some suggestions about how to talk to young people in a sympathetic way by keeping the perspective in the story in mind.

Suppose your parents are constantly pressuring you: you must eat more beef and lettuce, and less lamb and carrots. It's for your health. And will make you skinny. But dammit you like lamb with carrots and you're tired of beef. And lettuce tastes like dirt. You'd get annoyed with them and you'd pick up they have no real arguments/reasons behind their crap. Well, you might pick that up. But it's hard. Parents bluff. A strong willed independent person will pick it up and ignore them. But that's rare, especially in young people. Not that most people are docile. Many will be unsure and conflicted. Many will sometimes ignore parents but sometimes think they might know something or have a point.

Parents would have hard time doing this alone. If TV was constantly explaining how good for you carrots are, it'd never work. Parents are thus known to complain incessantly about influences (ie sources of information that might reveal their bluffs and lies). But on a lot of issues, the TV isn't going to help much. There are other sources of information as well. Teachers, friends, books, magazines, internet

Overall a young person gets a lot of pressure on the side of your parents. Random adults he meets for dinner will make comments in support of the same bluffs his own parents made. His own friends will face similar lies from their parents, and also be unsure. And the strong independent friends will seem reckless and not good role models.

So, what he really really needs is not one more person saying that maybe his parents are right about carrots. It is someone encouraging him to make up his own mind

Conventional wisdom is true sometimes. So let's pretend you agree with the conventional wisdom about a particular issue. It doesn't matter very much which one. You still face the issue of how to communicate this while remaining sympathetic. Even if the parents are correct now and then, that doesn't mean you should be on their side. So what can you say?

Here's my suggestion:

Before you can rightly say the same thing his parents said you need to comment about how much you agree with him that they are nasty bastards and he shouldn't listen to them. They lie. Then say if they are right it's only by pure luck. Then add stuff about how he should make his own choices and only take your advice if you are persuasive. Then add stuff about how this is not a matter of life and death and he can always change his mind later and this whole issue really shouldn't be a very big deal. *Then* say you happen to think carrots are bad, and give real reasons. (Only do this if he has not heard your set of reasons before. If he is familiar with them, do not repeat, just refer to them and ask what he thinks is wrong with those reasons)


One flaw with the above is that you can't actually tell many children that their parents are nasty bastards. They rightly don't want to fight with their parents. So if you say that, they may be alienated from you. So a real statement often has the even harder task of simultaneously distancing from the parents and being sympathetic to them.

So one possible approach is to say (it really really depends on the person, and your relationship with him):

I saw you arguing with your parents about food again yesterday. Your parents mean well, but they care about you so much that they are over-zealous and over-protective. They are biased and it effects their judgment. So as much as they are trying to help, if your wellbeing is involved ... Their advice is probably perfectly safe but not necessarily the most rational. There are sometimes other choices that'd be good too. So you shouldn't feel compelled to do everything they say. You know that already. That's why you want to eat lamb and carrots, and be a chess player not a lawyer. And I agree with you about chess: being a lawyer is definitely not for everyone and you should try doing something you like. But I wanted to let you know that I actually avoid eating carrots myself (but lamb I do eat now and then). I have a book with me if you're curious about my reasons. It is about zen philosophy and explains why we shouldn't eat carrots. So if you want you can read it and make up your own mind. It's not too big a deal either way, but I thought you'd like to know there are serious reasons people don't eat carrots.

So note some of the key elements:

- Agrees with parent's conclusion (no carrots) without endorsing parents
- Shows seriousness of thinking child should make his own choices by endorsing him in a different disagreement with his parents
- Not hateful towards parents but also says they may be wrong
- Not trying to pressure child, only trying to genuinely offer helpful information
- Has reasons for position and offers them to child so he can evaluate them himself

Elliot Temple | Permalink | Message (1)

Envelope Paradox

Here is an interesting math problem about a paradox with envelopes. The answers given there are incorrect so I've written better ones.

Problem
There are two envelopes each with a random number inside. You open one and guess if the other number is bigger or smaller. Can you do better than chance?

Problem 2
There are two envelopes with money in them. One has twice as much as the other. You open one and then choose to keep it or swap envelopes. Is there a strategy that makes more money than never swapping?

Wrong Answer 1
Before you open the envelope, choose a pivot number like 500. If the number you open is over 500 guess the other number will be smaller. If it's under 500, guess bigger. The following can happen:

Both numbers are over 500. You score 50%
Both numbers are under 500. You score 50%
One number is over 500 and the other is under 500. You score 100%

Therefore on average the pivot strategy scores over 50%!

Wrong Answer 2
Say you open 100. Four possible things can happen. The total money in both is 300 or 150 and we keep or swap.

total 300 swap get 200
total 300 keep get 100
total 150 swap get 50
total 150 keep get 100

Total for keeping: 200
Total for swapping: 250

Therefore swapping makes more money than keeping.

Answer 1
There is no such thing as choosing a random integer (with equal probability for all integers). You can't choose randomly from an infinitely large set. You can think of it as each individual number has a 1 in infinity chance to be chosen, which is zero.

Answer 2
Again, there is no such thing as choosing a random integer (with equal probability for all integers). So it's not possible to be presented with that situation.

But that's boring! And it's still hard to see why the wrong answers are wrong besides that the problems technically don't make sense. So I tried putting money into envelopes in some possible ways and then seeing what strategy would be best (if any).

I used ruby to help out. Here's the code. But first I'll try to explain why the wrong answers are false in English.

The pivot strategy only does better than chance if you can ever guess a pivot that is between the two numbers. There are infinite choices of pivot, but only finite integers between the two numbers. So your chance of guessing correctly is finite divided by infinite. It's zero.

The money strategy (always swap) can't be right because it doesn't use the information of how much money you opened. So you could swap without even opening an envelope. That can't possibly be profitable.

Now let's put some money into envelopes! We'll need a strategy for deciding what goes in the envelopes. Let's try this: take the numbers from 0-5. For each one, make the pairs [x, x*2] and [x, x/2]. So we'll get 12 pairs of envelopes and each pair will correctly have one envelope with twice as much cash. Here are all the pairs:

[[0, 0.0], [0, 0.0], [1, 0.5], [2, 1.0], [2, 1.0], [3, 1.5], [4, 2.0], [4, 2.0], [5, 2.5], [6, 3.0], [8, 4.0], [10, 5.0]]

If we look closely we can figure out what we might get if we swap each number. All you do is imagine you open a 4 and then look for all the envelopes that have a 4 paired with them. There's two 2's paired with 4, and an 8. Here's all of them:

0: 0 0 0 0
.5: 1
1: .5 2 2
1.5: 3
2: 1 1 4 4
2.5: 5
3: 1.5 6
4: 2 2 8
5: 2.5 10
6: 3
8: 4
10: 5

So you can see you don't wanna swap any high numbers (6-10), swapping 0 and 4 breaks even, and swapping 1, 2, 3, 5 and fractions gains. So there is a strategy to make extra money, but it's not "always swap". You have to look at what number you open and only swap certain numbers.

Now suppose the envelope filling scheme is to take all the numbers from 1-1000 and make pairs of x,x+2 and x,x-1. The edge cases only have a small effect instead of being many of the numbers. So suppose you open the number 500.

500 is in the following pairs:

x = 498 => 498,500
x = 500 => 500,502, 500,499
x = 501 => 501,500

So if you swap you can get: 498 499 501 502

So despite the imbalance that a 10 can turn into 9 or 12 which average to 10.5 ... away from the edges swapping doesn't matter, swapping breaks even. Yay, the world is sane again! It's because and 8 and 11 can turn into a 10, which balances it out.

Now lets go back to having one envelope with double the money using x,x*2, x,x/2

500 is in the following pairs:

x = 250 => 250,500
x = 500 => 500,1000, 500,250
x = 1000 => 1000,500

So if you swap you can get 250 250 1000 1000. So swapping non-edge cases seems to be profitable! Is that really weird? Indiscriminate swapping can't be right!

Well, it's not as counter-intuitive as it seems. Think of it this way: there are some really big jackpots you can get. If the numbers range from 1-1000 before halving and doubling then there is an envelope with $2000. If you get a low number then it's worth shooting for doubling. But if you get a really high number then you should obviously keep it. So it's not crazy if we should swap more than half the time.

Now let's look at some more detailed results. Here is the half the output to my ruby program:

Results for *2 and /2 envelopes
sum simple swap results 11361136.0
sum smart swap results 13177840.0
avg of envelopes 113.0625
avg simple swap results 113.61136
avg smart swap results 131.7784
count of envelope pairs is 400
total envelopes is 800
swap 550
keep 100
tie 150
total unique values you can open is 400
unique swap 250
unique keep 100
unique tie 50
first swap index is 0 val is 0.5
last swap index is 696 val is 199.0
first keep index is 700 val is 202.0
last keep index is 799 val is 400.0
first tie index is 452 val is 102.0
last tie index is 699 val is 200.0


So what does all that mean in English? The envelope creation process used range 1-200 and made envelopes with x,2x and x,x/2 for a total of 800 envelopes we could open. And the results are: for 550 we should swap, 100 we should keep, and 150 it doesn't matter. Of the 400 actual different numbers we could open, we should swap 250 of them, keep 100, and for 50 it doesn't matter. We should swap 68.75%, and only keep 12.5% of the time!

From some extra output I disabled here (it's 800 lines long) I was able to see how the keep/swap/tie decisions were distributed (the summary of how they are distributed is above). All numbers up to 100 we should swap. All numbers over 200 we should keep. In the middle some should be swapped and some don't matter either way. It alternated 2 swaps then 3 ties.

So a new way to think about what happens if the numbers are chosen from an infinite range is: there are three sections: always swap, swap or tie, and always keep. Two are near the edges. In an infinite range there are no edges, so you get a biased set of envelopes with only the middle cases. But that's not possible.

If you use an envelope stuffing strategy with simple addition then the entire middle is ties, one end is swaps and the other end is keeps. You can see output for this at the bottom of my ruby code here.

By the way, I included a method in my script to make the ruby program learn how to play correctly and then play. I also had it play randomly. At the half/double envelopes game, the random program makes $113 per play and the smart one makes about $132. So it works! Soon I'll be rich...

Update I meant that you can't choose a random integer *with equal probability for all integers*. I've corrected the text above.

Elliot Temple | Permalink | Messages (3)

Quality of Argument

In discussions about Israel like this one I see a huge difference in the quality of argument employed by each side. There are some trolls and flames by each side. But the pro-Israel side makes more attempt to reference or summarise history (I mean an overview instead of just one specific thing used to cherry pick a point). And the anti-Israel side does things like claim the President of Iran was misquoted about wiping Israel off the map. And that's standard fair, not unusual. Then you see a reply "yeah, the real quote was 'wipe from the sands of time'". And oh, by the way, the original topic was an article about how Hamas finally decided to recognise Israel. Except, oh wait, it turns out that the pro-Israel side read the translation and it doesn't say that. And now some other articles have said Hamas still won't recognise Israel. (Which BTW is a bit insane. It'd make a lot more sense of Israel wouldn't recognise Hamas than vice versa.) This is far from the first article that makes things up about Israel. I hope there will be a full investigation (there won't be). Shouldn't any observer of this conversation be able to easily see which side has a higher quality of argument?

Update: Look at this and think about the quality of argument.

Update 2: nokilli hadn't posted so much when i wrote this. i'm not referring just to him. also if you think this is unusual please show me some examples of good/sane discussion about Israel.

Elliot Temple | Permalink | Messages (0)

Conquering Iraq

source

which calls for a Palestinian state in the West Bank, Gaza Strip and east Jerusalem, said Sallah Zeidan, an official from the Democratic Front for the Liberation of Palestine, a group in the talks. The areas were conquered by Israel in the 1967 Six-Day War.

that is a terrible summary of what happened.

imagine in 10 years when we're leaving Iraq and an article describes it this way:

For years critics have told the US that the war is won. Finally, they are moving towards peace by dismantling their military bases at Dog Village and Cow Point, Iraq. The areas were conquered by the US in the second Gulf War.

you'd want to shoot the author of the second article, wouldn't you?

but how is the first any less unfair?

Elliot Temple | Permalink | Messages (0)

courts without government

posted with Lulie's consent:

Lulie: How would the courts work in anarcho-capitalism?
Elliot: a court is just a group of people who you can hire to make a judgment about something
Elliot: this is useful b/c people will often both agree to let a court decide their argument and have that be binding
Lulie: who would hire them tho? wouldn't you hire who says you're innocent/should get money?
Elliot: courts that judge badly would have bad reputations. no one would agree to use them
Elliot: courts that you know in advance will rule one way .. the other people won't agree to it
Lulie: hmm
Elliot: there are a few ways courts would be used
Elliot: 1) people argue, then agree to use one
Elliot: 2) people agree to a contract that says if X happens then a court will resolve it
Elliot: it can say which court
Lulie: who would pay for it?
Elliot: in cases 1 and 2, the people hiring the court. they could both pay half sounds normal. or loser pays
Lulie: pays after ruling?
Lulie: why loser?
Elliot: the loser is the one who was wrong but made them go to court anyway
Lulie: ah
Elliot: it's not very important when they pay. if it's a problem, they could both put up the full money in advance, then winner gets his money back
Elliot: 3) criminals. this may sound tricky: what if the criminal refuses all courts except one w/ really shit reputation that always lets criminals off?
Lulie: ya?
Elliot: so you end up with the police force deciding.
Lulie: who's police?
Elliot: however, this is no worse a problem than the police force deciding who to arrest in the first place, or any of their other policies
Elliot: like any police company
Lulie: what if the criminal hired another police force that is in competition with the first, and his says what he did was fine?
Elliot: then the companies would have a dispute
Elliot: one thing they might do is fight. if one company spends their time helping criminals, hopefully others would want to fight them
Elliot: but if all the companies operate roughly in good faith, then it would be greatly in their interest to work out deals to avoid fighting each other
Elliot: deals -> general policies they all known in advance. such as that the following list of courts are all acceptable for trying people
Elliot: then if company X tries a person in one of those courts, company Y will refuse to interfere
Lulie: What if lots of people wanted to be criminals, so wouldn't hire police?
Lulie: so there wouldn't be as many police, or enough
Elliot: if lots of people wanna be criminals, your fucked, period
Elliot: in a democracy people can elect criminals to make crime legal!
Elliot: recently terrorists were elected to palestinian government. biggest party. they're in charge
Lulie: Would there still be one president or whatever who decides if we go to war?
Elliot: no. "we go to war" is collectivist. anyone who wants to goes to war (including anyone who wants to when paid/hired) is individualist
Lulie: so.. how would going to war work? (like if you wanted to help Iraq)
Elliot: raise/hire an army
Elliot: or persuade an existing one to do it
Lulie: ah
Lulie: Sounds like you'd need a lot of money
Elliot: for your own, yes
Elliot: although once set up it could be profitable to sell your armies services
Elliot: now, some people will be afraid of having lots of armies around run by leaders who could go bad
Elliot: and they are right that that would be scary
Elliot: it's unreasonable to make a big army and set yourself up as sole leader. (or it seems so today. i could be wrong)
Elliot: so, what to do?
Elliot: you need to set it up in such a way as to reduce your ability to do bad with it
Elliot: our society knows of a variety of ways to do this. there exist others as well
Lulie: *listening*
Elliot: like our government has 3 branches with different powers
Elliot: a very similar problem is: what if a guy wants to own nukes?
Elliot: again my answer is: sure ... as long as you make it safe. you need to have security systems in place
Elliot: how good do they need to be? how hard to bribe? well ... if they are better than present day US ones that must be good enough
Elliot: the army would probably want things like written policy documents, and to sign various treaties and human rights documents
Elliot: and then to have a chain of command and have ways lower people can say "no" if u try to break one of the rules
Lulie: cool ^^
Elliot: other mechanisms that help are having decision making processes be public so people know what's going on and it's hard for bad stuff to get started before people notice
Elliot: and letting the public vote on some policies increases legitimacy. and also then u get to use the knowledge of the voters so u get better policies
Elliot: so it's perfectly plausible that some armies would have public votes and go to iraq if the vote said to
Lulie: cool
Elliot: (or let public vote on person in charge of policy, and he decides)

Elliot Temple | Permalink | Messages (2)