Expressing the Liar Paradox in Ruby

I was reading about the Liar paradox and thought it might be interesting to try to evaluate it as a Ruby expression. The Liar paradox is usually expressed in English with something like:

"This sentence is false."

The reason it's called a paradox is:

If "This sentence is false." is true, then the sentence is false, but then if "This sentence is false." is false, then the sentence is true, and so on.

You can read more about it on the Wikipedia article.

So the most literal way to express the sentence in Ruby would be:

> this_sentence == false

This of course raises:

NameError: undefined local variable or method `this_sentence'

Ruby doesn't know what this_sentence is, so it can't evaluate it. But really we do know what "this sentence" is. It's the sentence. "This sentence" is "This sentence is false." The sentence is, the sentence is false. Sounds kind of like a method definition doesn't it? Let's define it for Ruby:

def this_sentence
  this_sentence == false
end

Now what do we get?

> this_sentence == false
SystemStackError: stack level too deep

So it seems to me that the Liar paradox expressed in Ruby (and most other programming languages) is just a recursive method that doesn't terminate, causing an infinite loop. It can't be evaluated.

From what I've read about the Liar paradox in the field of logic, for some reason the problem doesn't seem to be quite that simple to resolve. Why is that? I don't know, I'm not a logician. Maybe someone can shed light on this in the comments.



Transcript: Paul Graham in Conversation with Nathan Blecharczyk

This is a transcript of an Airbnb video, "Paul Graham in Conversation with Nathan Blecharczyk" in which Airbnb co-founder Nathan Blecharczyk interviews Y Combinator founder Paul Graham, published on May 8, 2014. I did my best to transcribe but it's not perfect. A lot of like's, yaknow's, right?'s and rephrasings were omitted. Please correct me in the comments if you find something egregious.



Nathan:

We chose Paul Graham to talk about growth because it's a piece of advice that he gave us that was our turning point in starting to grow our marketplace at Airbnb. He told us that it's OK to do things that don't scale. Prior to that we had been working on Airbnb for a year and despite everything we did we couldn't earn more than $200 a week. And then he gave us this piece of advice, we really took it to heart, we went to New York, photographed people's properties, met every single user, invited them for beer, told them our story, and really built evangelists out of them. And that was the beginning of how Airbnb grew first in New York and then cross-pollenated globally very quickly thereafter.

Paul has a lot of interesting things to say, he has a very well developed left and right side of the brain. He studied philosophy, computer science and painting. So some diverse interests. I actually first became aware of Paul reading his book on Lisp programming, it was required reading back in college, but he's also written the book Hackers and Painters.

Before that he started a company Viaweb which he sold to Yahoo, which became yahoo stores. and of course as you all know he is founder of Y Combinator and also runs Hacker News. So why don't we welcome Paul up to the stage.

Paul:

I'm very happy to say I do not run Hacker News anymore.

N:

Let that be known. So Paul, your advice to us: that it's ok to do things that don't scale. Give me a sense for how you've seen others apply that.

P:

Well you know the way I learned that this was a good idea, was that we did it ourselves in that startup you mentioned Viaweb. We didn't mean to, we had to, because we couldn't get enough users. We were desparate to get users. We made an online store builder, that's what Viaweb was, and we couldn't get enough people to build stores and so to get them to use our software we would say "We'll build your store for you, we'll do it for you" like we were web consultants or something like that. And we were humiliated to have to do this. We thought the ideal was you just write some software and post it on the web and everybody uses it and you make lots of money. But actually it was like wringing water out of something that was almost dry, to get users. And so we used our software, and we felt lame.

But later I realized that this had been great because it made our software really good. If there was anything annoying about it, or anything that we couldn't do, we would learn. So I would be building someone's website, selling pens or something like that, or shirts. I learned so much random stuff about retailing. Like I scanned all these images of shirts and then this shirt guy told me "No, no all we want is pictures of the collars" and I had to rescan them. Apparently people buy shirts from just like these detailed pictures of the collars. They don't want to see the whole shirt. All those shirts, I'm still annoyed that I had to rescan all those damn shirts.

N:

So how long did this go on for, how far were you scanning shirts for?

P:

Like a year, probably. We spent a year like making people's websites using our software as a way to get users, and it made the software really good. So that was how I learned this.

Very often there are things that you want that you're prevented from having, and it turns out to be good for you. I bet you can all think of cases in your life where there was something you wanted and you're sure glad now you didn't get it. So users were that for us. We were forced to do all this lame stuff to get users and it turned out to be really good.

N:

And this is advice that you continue to give. What's some favorite examples of how people have applied that more recently?

P:

Well there's you guys. That's a very famous example.

Almost every startup... You pretty much can't succeed without doing this, because the other alternative... Succeeding means you have tons of tons of users, right? But it's very unlikely that you're going to make something and launch it and just suddenly have tons and tons of users, which means there's two alternatives: you will have to initially do things that don't scale as a way of getting users, or you won't get users and your company will die.

So if you want to figure out which YC startups have done things that don't scale, look at which ones are successful, because the ones that didn't do that have failed.

So Stripe, for example. Stripe does real time payments. You just have this API and you say I want to process a transaction and bang it works. Well the way that used to work in the very beginning was what Stripe called the "man behind the curtain" strategy. They had a merchant account and you do this thing and they would like call somebody up and do the transaction behind the scenes. It looked to you like it was happening in real time, but it was all essentially fake, with like humans in there. And it worked because they didn't have enough volume.

N:

So you've been know to say that growth can be basically a compass for product development, right? You know, find how to grow your business and do more of that, from a product standpoint. Are there particular examples where you've seen that work really well, or not work really well?

P:

Well it worked really well for you guys.

The surprising thing here is that you can safely hill climb. If you guys are programmers... What percentage of the people here are programmers? Ok, a lot of programmers, so you all know what hill climbing is. You just do this simplest growth algorithm, you just go wherever it leads up from here. And you don't plan for the future, you don't try and think about the global picture, you just think what's going to grow this week.

The surprising insight there is that that is safe to do in a startup, that you can hill climb your way into something big. It turns out the space of startup ideas--I didn't know this, this is something I learned empirically--but it turns out that there are not dangerous local maxima. You can safely hill climb without really thinking that much ahead, and you will grow. You won't even know what you'll grow into, right? Just week by week you see.

And this works for a lot of things besides starting companies too. This would work for writing. You know, you just like work on whatever interests you and every week you try and do something more interesting, and eventually you'll look back and say "Holy cow, look, we started out way down there." You know?

So who would it not work for? It's very dangerous but there are some startups where you have to go off and build something for some number of months before you can start this sort of cycle of interacting with users. Like if you want to build a new database company, you can't just like write a version 1 in a week.

N:

Enterprise software...

P:

Or anything that just takes a long time to build, right? You can't write a database in a week and say "OK, use our database" and like "Oh sorry it lost your data." A database has to have... Or like medical devices, right? You don't want to do prototyping with like medical devices. It's funny you imagine, but it would be bad.

N:

But for a while though we were making $200 a week and then came Obama O's and Cap'n McCain's and within a week and a half we made $30,000. Should we have become a cereal company?

P:

That's a really good question. I expected you would ask me easy soft questions here and you're asking me these hard ones.

N:

It's a trick question.

P:

You know, so that, yeah, you guys are so successful that I think we can safely say that cereal would have been a dangerous local maximum. So there's a counter example. That's actually the first counter example I've ever discovered.

N:

If only there were presidential elections every week. I think that was part of the success.

P:

Yeah but you could have gotten into like commemorative cereal and made like, you know, Giants cereal and stuff like that.

N:

Well we're saving that one.

P:

Until you got big enough and you started to get C&D'ed.

You got me there, I have to say. There are some dangerous local maxima. You know what it is? There are dangerous local maxima but most people are not as weird as you guys are and so they don't discover them, right? Only you guys in the middle of trying to run an accommodation marketplace would start making cereal, you know? So if you are as wildly imaginative as you guys, then there are dangerous local maxima, but not for anybody else. Most people don't have to worry about it.

N:

So when growth plateaus what are some stategies for breaking out and finding a new way to grow your company? I mean, have you seen companies break out?

P:

No. When growth plateaus, you pretty much have to start from scratch. You have to treat your situation as if you needed to come up with a new startup idea. You can't just sort of somehow revitalize things. It's very hard, it's very hard.

Usually startups start making something and they don't have growth in the beginning and then they work and work and work and growth starts to accellerate and then it continues to grow well and then eventually they grow into a giant company and you can't keep growing at like 10x a year, after a few years you're the whole GDP.

So when you reach a certain size growth has to taper off, but usually in the successful startups it's an S curve. It's not like up and down and up and down. I think if growth tapers off, you have to act as if, you have to treat it as seriously as if your initial idea had not worked, and you have to come with some new idea. Now, your new idea may incorporate big chunks of your old idea, but it would be better to think of it as like coming up with a new idea that incorporated big chunks of the old idea rather than simply like buffing up the old idea, you know?

N:

So one of the strategies for growing your company is to do things that don't scale, really roll up your sleeves. But are there any other strategies or patterns that one can employ for, basically identifying these growth hacks?

P:

Growth hacks. Well you know it's funny, someone asked this in the last batch--in the last questions. "What do you do to increase the demand side of a marketplace?" And the woman from Homejoy had the right answer, I was sitting there thinking to myself, "You make something people want!"

If you phrase it in this complicated way, "We've got this marketplace and we want to increase the demand side. How do you do that? Like how does Apple for example get so much demand for it's products?" They build really good products! So really honestly, it's better not to think too much about growth per se.

One thing I've noticed is, all, all, like seriously there are no exceptions to this, all the most successful startups that we've funded, and also that I've seen that we haven't funded, all of the founders are a little too obsessed with making the product good. And Apple is an example. Apple, they do stuff that you don't even care about, that you don't even know about, just because they're fanatics and Airbnb I'm sure too has a ton of stuff behind the scenes. Like I noticed, have you guys noticed they have two different shape lights in here? Look at this, there's some that come down like tulips and some that spread out. Why? Well it's not by accident right? Someone cares a little too much, right? You look at this whole building, this is what happens when you have a startup where two out of three of the founders are designers. I mean this whole place radiates "cares too much", you know? But that's good!

N:

That's a compliment I think!

P:

That's good, no seriously! It's rare that it's so visible.

Usually startups care too much about their product, like you know Dropbox cares too much and you can tell that because have you ever noticed like you never hear anybody losing data anymore, right? Because Dropbox is so damn reliable. You never hear "Oh my computer crashed." You used to hear this like 5 years ago. You would hear "Oh my computer crashed. No I wasn't backing it up. Oh I lost everything."
Right? Nobody ever loses anything anymore because everybody uses Dropbox and Dropbox is just so reliable.

This is like a startup turned inside out, that's what this building is. Most of you guys are not from Airbnb, right? Look at it on your way out, and just look at the details because any detail your look for, there will be something to see I guarantee you. And so this is like a startup turned inside out and made visible. But every really successful startup, the product is like this. You know? Your building is just like part of the product somehow.

N:

Yeah I mean we do try to design not just the product but the building, the employee experience, so...

P:

You guys are just insane fanatics, right? But like pretty much all...

N:

That's also a compliment.

P:

But "all in" does not begin to describe your attitude and that's actually another trait of the most successful founders. They are just so ridiculously committed.

N:

So when we actually interviewed at Y Combinator you thought our idea was crazy. Yet you still let us in. Why is that?

P:

Well, I'll tell you a trick if you ever find yourself in the very early stage funding business. The problem is, the very best ideas always seem crazy. And so if you judge people by their ideas, you will snip off the outliers which is where all the big successes are. And so there's a trick you can use which is, judge by the people instead. And the earlier your are in investing, the more it is the founders, and so we liked you guys.

You guys were one of the interviews where during the interview we were sort of looking at each other saying "OK these guys are in." I remember that, because you just seemed imaginative and determined. Those are the two things I remember. And like, the cereal! My God! I still remember how surprised I was. Like you made $30,000 from selling cereal? I mean talk about cockroaches.

Cockroaches, this cockroach thing, the cockroach thing. I used to use this term a lot back when economic times were bad. Now times are good so I don't have to talk about cockroaches so much. Cockroaches mean founders who are unkillable, like their startup is unkillable because they can survive on nothing. And it's a reference to the idea that after a sufficiently bad nuclear war nothing will be alive except cockroaches. Cockroaches survive nuclear winters, cockroaches survive everything.

You guys were cockroaches at the time. Fortunately you do well in good economic conditions too. People give you lots of money, you have taste and you can get really good lights somehow.

N:

Tell me where good ideas come from. I think you have some thoughts around the process of ideation.

P:

You know all these... I think the first example I think of is you guys, but I guess it's not surprising that you'd be the first example of everything because you're so successful. If you weren't so successful you wouldn't have a space this big where you could put on these events and I wouldn't be being interviewed by you.

"Ideation" is a misleading term. When airbnb started, did it start from ideation? Not really! You know? They weren't sitting thinking "Hmm what would be a good idea? I know, we'll let people rent out their places." No! It just like, "Oh we need money. There's a conference, let's rent out some airbeds."

So actually, beware of this term "ideation." The best ideation is implicit. If you think about it, a surprising number of the most successful startups were not even supposed to be businesses in the very beginning! They were just projects, right?

So if you think to yourself, if you're thinking one day of starting a startup, the way to start a startup is by not trying to start a startup. It's just, you build stuff, you just build stuff, just do stuff, make stuff. And the very best ideas will be things that are so freaky that you yourselves don't believe them. You guys didn't know what you were onto in the very beginning! You thought you were on to something, right?

N:

Took over a year to figure it out.

P:

I bet you would have been surprised, if someone showed you a video of your building now five years ago, you would have been real surprised. So don't try to think about ideas, just make stuff, and make stuff that you yourself want, like you guys did. That's one of the things YC looks for in startups, ideas that grow organically out of the founders' lives.

N:

Let's talk a little bit about the sharing economy. That clearly includes Airbnb, I think it includes some other companies that we heard from earlier today. What are your thoughts about this space?

P:

There's definitely something real there. I think I tweeted about this, that people may one day regard ownership of stuff as a hack that was forced upon us because of limitations that no longer exist. Right?

And so arguably Uber is an instance of the sharing economy even, right? You don't drive your car, you just, when you want a car you press a button on your phone and your car comes and takes you somewhere.

There always have been shared things but they tended to be publicly owned. What's happened now is, the network is smart enough for things to be shared but privately owned. And so that means you don't have to do things at government speeds. It used to be the sharing economy meant buses and train systems and stuff like that. Now it could mean anything. I think anything's up for grabs.

So there was a startup, actually two startups in the most recent YC batch that are doing marketplaces for used furniture. It's a little awkward sometimes we have two startups working on the same idea in the same batch, and they're both good actually. And arguably that's an instance of the sharing economy, too. Like right now you buy all this crap when you're in college, you buy some stuff and then you move and you have to get the stuff to your new place, right? If you can sell stuff more easily then that's sort of like sharing too, like you buy stuff for a while and then you sell it and then you move and when you get to the new place you buy new stuff, right? And since you also bought that used, it's probably cheaper than moving right? Instead of paying a company to move stuff, you pay a marketplace to sell your old stuff and buy new stuff, and if stuff is sufficiently liquid then that's an instance of the sharing economy too.

N:

These marketplaces though are incredibly hard to start, right? Once they have momentum they're great businesses but getting them off the ground, you have the chicken and the egg problem. How do you think about that?

P:

You've got to do it yourself! This above all is a place where you want to do things that don't scale.

So for example, if you want to be a used furniture marketplace, initially you don't just sit back and say "OK we're a marketplace, anybody want to sell? Anybody want to buy? Post your stuff." What you've got to do is you've got to find people, go out and find people who need furniture.

For example, one of the two startups is in New York and I suggested they go and find people coming to New York for medical residencies.
As you know, medical residents have no time, right? But they have some amount of money, they want furniture, they don't just want to have a bare apartment. So they could go out and find medical residency programs and say "We will just get furniture for you, at cost." Right? And now they've got the demand side, "the demand side" of their marketplace, right? Now all they have to do is just go find some furniture.

So they can do it manually, they can manually be like this sort of, what would to the residents be like a godsend. That's the thing, that's one of the tests, if you're doing things that don't scale right, your initial users are just the luckiest people in the world. They feel like "This is just so great! Someone is just like bringing me furniture, I didn't have to do anything, it was great, it didn't cost any more than regular furniture."

N:

Magical.

P:

It's interesting because that means... I never thought of this but you said the word "magical" but you have always had, Airbnb has always had this attitude of trying to make like a magical experience for users. And it's partly an artifact, it's partly because you believe in magic, but it's partly an artifact I bet of how early on you had to because it was the only way to get any users, right? So that means another advantage of doing things that don't scale is you end up with this company tradition of making people super, super happy, which is a good thing.

N:

Have you seen marketplaces or sharing economy companies that you just think, that's not a viable model? I mean it's hard to judge ideas, like you mentioned

P:

I mean, do you have any idea how many applications Y Combinator gets every batch? Most of them, terrible. And so I have seen huge numbers of terrible ideas, you know? No one has seen more terrible startup ideas in the world, I'm sure. God yes, I'm sure I've just seen tons of them but I can't remember them.

N:

Are there other spaces or trends that you're seeing that you think are exciting?

P:

OK so there's a bunch of ways to figure out what might be good trends. One is to look for things that are now like microcomputers were in the 1970's. Back in the 1970's if Hacker News had existed, everyone would have been talking about microcomputers, microcomputers, microcomputers, and the people at Digital and Data General would be like, "Microcomputers, why does everyone care so much about these crappy little computers? You can't do anything with them." And the hackers were just like, would have been unreasonably excited about microcomputers. Hackers like Bill Gates and Paul Allen, you know? Like that issue of Popular Electronic comes out with the Altair on it, and they're like "It's happening! It's happening!" They're like Bitcoin people. Which is one of the things, right?

So one way you can tell topics, because these people, they're like animals that can sense an approaching storm. And they don't know exactly what the storm's going to be like, but they know something's going on.

So you just go look at Hacker News and see the things they seem almost annoyingly excited about, like Bitcoin, Bitcoin, Bitcoin. Drones, drones, drones. You know, if the NSA was a business opportunity there would be a great one. Maybe there is.

N:


P:

That's true...

N:

Just kidding.

P:

That's true. Or you could make something that would make it hard to snoop on people, for tinfoil hat wearers.

So you can go look at things that people who sort of live in the future seem unreasonably excited about, that's one.

I've noticed some general trends, one is startups are reaching out into the world. Like startups started out, in the 80's startups meant making wafer fabs, you know? You're like making hardware. And then they started to make software, and then they started to make consumer stuff, right? And now they're like cleaning people's houses, and picking them up at the airport and stuff like that. So it seems like, reaching out into the world more. That's a class of ideas that seem like "Wait, can that be a startup? A cleaning service? Could that be a startup?" Yeah, it turns out. So reaching out into the world.

I think mobile has a long way to go yet. Like everyone is walking... I was explaining this to my 5 year old son, I was saying "Phones are not really phones! They are computers! They're just small computers that you can talk on. And everyone's carrying around..." -- he's like "Oh, phones are computers. Wow they're the same thing," I could see he was mulling this over.

N:

He's four right?

P:

Five now.

So the implications of everyone walking around with a powerful computer in their pocket at all times connected to the internet. We have still just begun to see all the changes that will happen as a result of that.

Like Uber for example. Uber is the child of this. Uber couldn't work without everybody having phones. The passengers need to have phones and the drivers need to have phones for Uber to work.

So there's all kinds of things that will become possible now. We may not even have seen the most exciting ones yet either.

N:

Well I think we're out of time. Thank you Paul.