1090: "Formal Languages"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Prelates, Magistrates

User avatar
Quicksilver
Posts: 437
Joined: Wed Apr 29, 2009 6:21 am UTC

1090: "Formal Languages"

Postby Quicksilver » Fri Aug 03, 2012 4:00 am UTC

Image
Alt Text:"[audience looks around] 'What just happened?' 'There must be some context we're missing.'"
Yeah, structuring your sentences is important.

User avatar
rhomboidal
Posts: 801
Joined: Wed Jun 15, 2011 5:25 pm UTC
Contact:

Re: 1090: "Formal Languages"

Postby rhomboidal » Fri Aug 03, 2012 4:03 am UTC

Grammar fanboys have no sense of social syntax.

HonoreDB
Posts: 161
Joined: Tue Feb 06, 2007 4:32 pm UTC
Contact:

Re: 1090: "Formal Languages"

Postby HonoreDB » Fri Aug 03, 2012 4:08 am UTC

Scaling Everest was, by far, the most amazing and transformative experience of my life.

User avatar
TheGrammarBolshevik
Posts: 4878
Joined: Mon Jun 30, 2008 2:12 am UTC
Location: Going to and fro in the earth, and walking up and down in it.

Re: 1090: "Formal Languages"

Postby TheGrammarBolshevik » Fri Aug 03, 2012 4:08 am UTC

That pun hurt so bad I felt it last Tuesday.
Nothing rhymes with orange,
Not even sporange.

User avatar
brakos82
Posts: 536
Joined: Tue Feb 24, 2009 12:06 am UTC
Location: My happy place :)

Re: 1090: "Formal Languages"

Postby brakos82 » Fri Aug 03, 2012 4:17 am UTC

This comic has Slightly Worse potential.... time to break out Photoshop!
I am Brakos, and I may or may not approve this message.

gormster
Posts: 233
Joined: Mon Jul 23, 2007 6:43 am UTC
Location: Sydney

Re: 1090: "Formal Languages"

Postby gormster » Fri Aug 03, 2012 4:17 am UTC

i...

don't get it. :(
Eddie Izzard wrote:And poetry! Poetry is a lot like music, only less notes and more words.

User avatar
TheGrammarBolshevik
Posts: 4878
Joined: Mon Jun 30, 2008 2:12 am UTC
Location: Going to and fro in the earth, and walking up and down in it.

Re: 1090: "Formal Languages"

Postby TheGrammarBolshevik » Fri Aug 03, 2012 4:20 am UTC

I believe this is the part where I abuse you and then spend the next page pretending that I'm actual being high-minded by being an asshole.

No, but seriously, the, err, context is here.
Nothing rhymes with orange,
Not even sporange.

User avatar
RebeccaRGB
Posts: 336
Joined: Sat Mar 06, 2010 7:36 am UTC
Location: Lesbians Love Bluetooth
Contact:

Re: 1090: "Formal Languages"

Postby RebeccaRGB » Fri Aug 03, 2012 4:21 am UTC

Is this about how natural language grammars tend to defy formalization? Did I win the comic?

Alt text burned my cheese.
Stephen Hawking: Great. The entire universe was destroyed.
Fry: Destroyed? Then where are we now?
Al Gore: I don't know. But I can darn well tell you where we're not—the universe!

jpk
Posts: 607
Joined: Sat Nov 13, 2010 7:33 am UTC

Re: 1090: "Formal Languages"

Postby jpk » Fri Aug 03, 2012 4:30 am UTC

Pun on "context-free grammar".

Anyone in the Cambridge/Somerville area up for a good lynch mob? 'Cause I could whip up a few torches, no problem.

jpk
Posts: 607
Joined: Sat Nov 13, 2010 7:33 am UTC

Re: 1090: "Formal Languages"

Postby jpk » Fri Aug 03, 2012 4:31 am UTC

gormster wrote:i...

don't get it. :(


Well, you're one of the lucky 10,000 for today!

bondsbw
Posts: 24
Joined: Mon Sep 19, 2011 6:37 pm UTC

Re: 1090: "Formal Languages"

Postby bondsbw » Fri Aug 03, 2012 4:33 am UTC

I was like :(

Then like :?:

Then

TheGrammarBolshevik wrote:I believe this is the part where I abuse you and then spend the next page pretending that I'm actual being high-minded by being an asshole.

No, but seriously, the, err, context is here.


Then :shock:

Then I was all like :evil:

orangeperson
Posts: 117
Joined: Sun May 13, 2007 2:17 am UTC

Re: 1090: "Formal Languages"

Postby orangeperson » Fri Aug 03, 2012 4:51 am UTC

HonoreDB wrote:Scaling Everest was, by far, the most amazing and transformative experience of my life.

Based on the context I'm really afraid I'm missing a subtle pun.
spjork.

jpk
Posts: 607
Joined: Sat Nov 13, 2010 7:33 am UTC

Re: 1090: "Formal Languages"

Postby jpk » Fri Aug 03, 2012 4:56 am UTC

orangeperson wrote:
HonoreDB wrote:Scaling Everest was, by far, the most amazing and transformative experience of my life.

Based on the context I'm really afraid I'm missing a subtle pun.


Not so subtle. On this tree, he's picking the low-hanging fruit.
But I think we can raise the bar.

yedidyak
Posts: 954
Joined: Mon Apr 12, 2010 10:24 pm UTC
Location: Israel

Re: 1090: "Formal Languages"

Postby yedidyak » Fri Aug 03, 2012 5:00 am UTC

Oh wow. I have an exam on formal language theory, including context-free grammars in literally half an hour. This made my day!

CmdrFirewalker
Posts: 1
Joined: Fri Aug 03, 2012 4:57 am UTC
Location: Dresden, Germany

Re: 1090: "Formal Languages"

Postby CmdrFirewalker » Fri Aug 03, 2012 5:06 am UTC

Also, a language consisting just of grammar is pretty much "nude", so he is streaking ... sort of.

User avatar
phlip
Restorer of Worlds
Posts: 7573
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: 1090: "Formal Languages"

Postby phlip » Fri Aug 03, 2012 5:33 am UTC

TheGrammarBolshevik wrote:That pun hurt so bad I felt it last Tuesday.

Yeah, that was kinda harsh on the ol' thinking-meats.

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

vortighast
Posts: 30
Joined: Wed May 25, 2011 4:41 am UTC

Re: 1090: "Formal Languages"

Postby vortighast » Fri Aug 03, 2012 5:49 am UTC

The wiki page looks more complicated...can we get a layman's explanation?

eidako
Posts: 126
Joined: Wed Apr 06, 2011 10:24 am UTC

Re: 1090: "Formal Languages"

Postby eidako » Fri Aug 03, 2012 6:15 am UTC

First paragraph of the Wikipedia article:
In formal language theory, a context-free grammar (CFG) is a formal grammar in which every production rule is of the form

V → w

where V is a single nonterminal symbol, and w is a string of terminals and/or nonterminals (w can be empty).

I love explanations that assume the reader already understands what's being explained.

User avatar
TheGrammarBolshevik
Posts: 4878
Joined: Mon Jun 30, 2008 2:12 am UTC
Location: Going to and fro in the earth, and walking up and down in it.

Re: 1090: "Formal Languages"

Postby TheGrammarBolshevik » Fri Aug 03, 2012 6:21 am UTC

It's not an explanation, but a definition. If they started at the building blocks of formal language theory, the introduction would be far too long, and redundant across each class of grammar.
Nothing rhymes with orange,
Not even sporange.

User avatar
Djehutynakht
Posts: 1546
Joined: Thu Feb 10, 2011 1:37 am UTC

Re: 1090: "Formal Languages"

Postby Djehutynakht » Fri Aug 03, 2012 6:50 am UTC

jpk wrote:Pun on "context-free grammar".

Anyone in the Cambridge/Somerville area up for a good lynch mob? 'Cause I could whip up a few torches, no problem.



*Grabs sword off the wall*

If Bostonians are invited, I'm in.

Justine Kerenskij
Posts: 5
Joined: Sat Jun 02, 2012 8:21 am UTC

Re: 1090: "Formal Languages"

Postby Justine Kerenskij » Fri Aug 03, 2012 7:07 am UTC

These comics are getting simpler and simpler. I'm not sure if I like them anymore.

User avatar
TheGrammarBolshevik
Posts: 4878
Joined: Mon Jun 30, 2008 2:12 am UTC
Location: Going to and fro in the earth, and walking up and down in it.

Re: 1090: "Formal Languages"

Postby TheGrammarBolshevik » Fri Aug 03, 2012 7:14 am UTC

Yeah, to get the next joke you'll probably only have to be a nested word automaton, at best.
Nothing rhymes with orange,
Not even sporange.

Mithiwithi
Posts: 5
Joined: Wed Jun 23, 2010 8:23 am UTC

Re: 1090: "Formal Languages"

Postby Mithiwithi » Fri Aug 03, 2012 7:49 am UTC

vortighast wrote:The wiki page looks more complicated...can we get a layman's explanation?


I'm having a hard time coming up with an explanation that doesn't at least require a knowledge of programming languages. (Though, on that note, the reason that most programming languages use context-free grammars is that they're easier to parse.)

For the purpose of this comic, though, it's enough just to know that "context-free grammar" is a thing in formal language theory - knowing how context-free grammars work doesn't really contribute much to the joke. (It's just that you'd probably never have heard of context-free grammars if you hadn't studied formal language theory.)

User avatar
The Moomin
Posts: 359
Joined: Wed Oct 13, 2010 6:59 am UTC
Location: Yorkshire

Re: 1090: "Formal Languages"

Postby The Moomin » Fri Aug 03, 2012 8:00 am UTC

Crashing through the window like that seems pretty informal.
I'm alive because the cats are alive.
The cats are alive because I'm alive.
Specious.

solune
Posts: 121
Joined: Thu Jul 21, 2011 12:58 pm UTC

Re: 1090: "Formal Languages"

Postby solune » Fri Aug 03, 2012 8:10 am UTC

I'm eager to know what this definition will look like after the hordes of xkcd readers come on wikipedia

User avatar
flicky1991
Like in Cinderella?
Posts: 780
Joined: Fri Feb 11, 2011 3:36 pm UTC
Location: London

Re: 1090: "Formal Languages"

Postby flicky1991 » Fri Aug 03, 2012 8:24 am UTC

This joke makes sense to too few people. Randall needs to make his programming puns more BASIC.
any pronouns
----
avatar from chridd
----
Forum Games Discord
(tell me if link doesn't work)

carolineee
Posts: 17
Joined: Mon Nov 21, 2011 6:26 pm UTC

Re: 1090: "Formal Languages"

Postby carolineee » Fri Aug 03, 2012 8:36 am UTC

vortighast wrote:The wiki page looks more complicated...can we get a layman's explanation?

Ok, I'll try. We all know the word "grammar" from English class. It is a set of rules that tell us how we build sentences.
In Computer Science, we distinguish between several types of grammars which are more or less powerful. There are several types of context free and context sensitive grammars, the context sensitive ones being more powerful than the context free ones.

You don't really need to understand the technical details to get the joke. The point is, that a context free grammar has it's limitations, notably that you can not have rules that depend on what actual words you have already used in your sentence (i.e. the context). Thus, context free grammars can produce stuff that doesn't look like it belongs together in a sentence.

For example, the popular game, where you write a name on the first line of a sheet of paper, fold it back, give it to the next person who writes a verb, then an adverb, then a preposition, an adjective, a noun, and you get total junk sentences (my aunt Sally - runs - sleepily - in the - green - hot air balloon), which are grammatically correct, is a context free grammar. In fact, it is even a regular grammar.

For this comic, the joke is just that the word "grammar" doesn't really have a context here. Thus, it's a context free grammar ;)
Last edited by carolineee on Fri Aug 03, 2012 9:04 am UTC, edited 2 times in total.

User avatar
The Moomin
Posts: 359
Joined: Wed Oct 13, 2010 6:59 am UTC
Location: Yorkshire

Re: 1090: "Formal Languages"

Postby The Moomin » Fri Aug 03, 2012 8:52 am UTC

carolineee wrote:
vortighast wrote:The wiki page looks more complicated...can we get a layman's explanation?

Ok, I'll try. We all know the word "grammar" from english class. It is a set of rules that tell us how we build sentences.
In Computer Science, we distinguish between several types of grammars which are more or less powerful. There are several types of context free and context sensitive grammars, the context sensitive ones being more powerful than the context free ones.

You don't really need to understand the technical details to get the joke. The point is, that a context free grammar has it's limitations, notably that you can not have rules that depend on what actual words you have already used in your sentence (i.e. the context). Thus, context free grammars can produce stuff that doesn't look like it belongs together in a sentence.

For example, the popular game, where you write a name on the first line of a sheet of paper, fold it back, give it to the next person who writes a verb, then an adverb, then a preposition, an adjective, a noun, and you get total junk sentences (my aunt Sally - runns - sleepily - in the - green - hot air baloon), which are grammatically correct, is a context free grammar. In fact, it is even a regular grammar.

For this comic, the joke is just that the word "grammar" doesn't really have a context here. Thus, it's a context-free grammar ;)


Surely it's only context-free for the people within the actual comic though, for the people reading it the joke is in the context of being context-free, meaning it isn't?

It's like Randall is trying to entertain the people he has drawn, but not the people looking at the drawings?
I'm alive because the cats are alive.
The cats are alive because I'm alive.
Specious.

User avatar
Max™
Posts: 1792
Joined: Thu Jun 21, 2012 4:21 am UTC
Location: mu

Re: 1090: "Formal Languages"

Postby Max™ » Fri Aug 03, 2012 10:01 am UTC

flicky1991 wrote:This joke makes sense to too few people. Randall needs to make his programming puns more BASIC.

Oh, I C what you did there, plus the general joke, plus the informality subtext!

Nonetheless, I'm not sure whether I should Bash you in the head, or shoot you in the neck with a Dart full of Cobra venom before I get my pet Python to strangle you until your face turns a bright Ruby red.

Argh, I'm so mad I've developed a Lisp!

Bah, enough of this Smalltalk, wanna go get a cup of Java, then look at this awesome LilyPond I found through my Kaleidoscope?
mu

User avatar
peewee_RotA
Posts: 504
Joined: Mon Dec 12, 2011 1:19 pm UTC

Re: 1090: "Formal Languages"

Postby peewee_RotA » Fri Aug 03, 2012 10:08 am UTC

The audience did, having heard him shout "grammer", nazi this coming.
"Vowels have trouble getting married in Canada. They can’t pronounce their O’s."

http://timelesstherpg.wordpress.com/about/

NotAllThere
Posts: 146
Joined: Fri Aug 06, 2010 12:54 pm UTC

Re: 1090: "Formal Languages"

Postby NotAllThere » Fri Aug 03, 2012 10:45 am UTC

Max™ wrote:
flicky1991 wrote:This joke makes sense to too few people. Randall needs to make his programming puns more BASIC.

Oh, I C what you did there, plus the general joke, plus the informality subtext!

Nonetheless, I'm not sure whether I should Bash you in the head, or shoot you in the neck with a Dart full of Cobra venom before I get my pet Python to strangle you until your face turns a bright Ruby red.

Argh, I'm so mad I've developed a Lisp!

Bah, enough of this Smalltalk, wanna go get a cup of Java, then look at this awesome LilyPond I found through my Kaleidoscope?


Cobollers
yangosplat wrote:So many amazing quotes, so little room in 300 characters!

Kit.
Posts: 1117
Joined: Thu Jun 16, 2011 5:14 pm UTC

Re: 1090: "Formal Languages"

Postby Kit. » Fri Aug 03, 2012 10:49 am UTC

Google: No results found for "context free grammar nazi". :cry:

blowfishhootie
Posts: 486
Joined: Wed Sep 21, 2011 11:13 pm UTC

Re: 1090: "Formal Languages"

Postby blowfishhootie » Fri Aug 03, 2012 12:18 pm UTC

TheGrammarBolshevik wrote:I believe this is the part where I abuse you and then spend the next page pretending that I'm actual being high-minded by being an asshole.

No, but seriously, the, err, context is here.


No, it's the part where you passive-aggressively misrepresent an argument. VERY passive-aggressively, I might add. This question was nothing at all like the one that spawned the other argument. Sorry if you can't see that.

User avatar
ModestMouse
Posts: 45
Joined: Wed Aug 11, 2010 3:26 pm UTC

Re: 1090: "Formal Languages"

Postby ModestMouse » Fri Aug 03, 2012 12:38 pm UTC

I don't feel smart today. I thought the Grammar Nazi crashed a programming convention. Nobody likes the Grammar Nazi, especially when they critique your code.

VanI
Posts: 61
Joined: Mon Mar 19, 2012 2:54 am UTC

Re: 1090: "Formal Languages"

Postby VanI » Fri Aug 03, 2012 12:39 pm UTC

Kit. wrote:Google: No results found for "context free grammar nazi". :cry:

This seems like an oversight in need of rectifying. :twisted:
I swear, a fireball lied to me just the other day...

Kain
Posts: 1140
Joined: Wed Aug 27, 2008 4:29 am UTC
Location: At the center of the observable universe.

Re: 1090: "Formal Languages"

Postby Kain » Fri Aug 03, 2012 12:45 pm UTC

blowfishhootie wrote:
TheGrammarBolshevik wrote:I believe this is the part where I abuse you and then spend the next page pretending that I'm actual being high-minded by being an asshole.

No, but seriously, the, err, context is here.


No, it's the part where you passive-aggressively misrepresent an argument. VERY passive-aggressively, I might add. This question was nothing at all like the one that spawned the other argument. Sorry if you can't see that.


I don't mean to derail this thread (though of course since I had to say that I might very well) but people have been making similar "just google it" style arguments since I first joined these fora.

Anyways, thanks to everyone who explained the context sensitive grammar stuff. That would have been very hard to find through Google, what with not knowing what to look for in this case :)

edit: VanI, that sounds ominous...
Look, you know it's serious when a bunch of people in full armor and gear come charging in to fight a pond of chickens - Steax

User avatar
Yakk
Poster with most posts but no title.
Posts: 11129
Joined: Sat Jan 27, 2007 7:27 pm UTC
Location: E pur si muove

Re: 1090: "Formal Languages"

Postby Yakk » Fri Aug 03, 2012 12:53 pm UTC

TheGrammarBolshevik wrote:It's not an explanation, but a definition. If they started at the building blocks of formal language theory, the introduction would be far too long, and redundant across each class of grammar.
Yes, context is necessary in order to understand that definition.
...

Ok, what is a context-free grammar, or CFG?

The basic idea starts with a grammar. A grammar is a way of "breaking down" or "describing" phrases (or similar things), and we often use a "production" analogy.

For example, one might say that a sentence (in a really simple version of English) is of the form:
Sentence -> SubjectPart VerbPart ObjectPart "."
Ie, the symbol "Sentence" is a concatenation of a SubjectPart and a VerbPart and an ObjectPart, followed by a period.

We read this as "The symbol sentence can produce (ie, "->") the sequence SubjectPart followed by VerbPart follwed by ObjectPart followed by the literal character period".

We would then go off and say:
SubjectPart -> "I" | "You"
VerbPart -> "eat" | "love" | "jump over" | "dance with"
ObjectPart -> "a chicken" | "xkcd" | "an otter" | "a duck" | "Eve"

where | stands for "or". So now we have a simple context-free grammar that describes sentences like:
"I eat a chicken."
"You dance with xkcd."
"I love an otter."

This general form of grammar is useful for simple parsing, but it is less powerful than you need in other situations.

There are context-sensitive languages, where the substitution rules for things like VerbPart depends on their context -- ie, what comes before or after. These are harder to parse than context free grammars.
One of the painful things about our time is that those who feel certainty are stupid, and those with any imagination and understanding are filled with doubt and indecision - BR

Last edited by JHVH on Fri Oct 23, 4004 BCE 6:17 pm, edited 6 times in total.

CopaceticOpus
Posts: 7
Joined: Fri Jan 04, 2008 9:25 pm UTC

Re: 1090: "Formal Languages"

Postby CopaceticOpus » Fri Aug 03, 2012 1:04 pm UTC

VanI wrote:
Kit. wrote:Google: No results found for "context free grammar nazi". :cry:

This seems like an oversight in need of rectifying. :twisted:

Rectifying... Do you mean by posting the phrase in a popular forum where Google would pick it up? Done! :)

User avatar
TimXCampbell
Posts: 110
Joined: Wed Jul 27, 2011 4:26 am UTC
Location: Very Eastern Kentucky, USA
Contact:

Re: 1090: "Formal Languages"

Postby TimXCampbell » Fri Aug 03, 2012 1:12 pm UTC

carolineee wrote:For this comic, the joke is just that the word "grammar" doesn't really have a context here. Thus, it's a context free grammar ;)

Ah, thank you! Now I get it.

I find it hard to walk away from an xkcd comic I don't understand. Now I can saunter away in a relaxed manner.

justalurkr
Posts: 22
Joined: Fri Apr 27, 2012 3:12 pm UTC

Re: 1090: "Formal Languages"

Postby justalurkr » Fri Aug 03, 2012 1:23 pm UTC

One of the best things about xkcd is that it helps one to identify (with great alacrity) the kind of geek one is...not.

And here I thought "formal language" meant never splitting prepositions at the end of sentences.


Return to “Individual XKCD Comic Threads”

Who is online

Users browsing this forum: No registered users and 112 guests