Evolving Intuition

Much of my intuition is wrong, or at least wrong at first.  Over time, I try to discard un-interesting or unhelpful intuition, and improve the fun stuff.

One area where my intuition consistently breaks down is the transition from a single item to a large set.  Evolution itself is a great example of this- it doesn’t make any sense to think about evolution in the context of a single organism.  Evolution is an emergent property of a massively-parallel system of organisms.  Simply put, individuals do not evolve, but massively parallel systems of individuals do.

That’s weird, right?

The same is true of bell curves.  It doesn’t make sense to think about an individual having a mean or a standard deviation.  Those are properties of a population, and only useful in thinking about a population (truth be told, they’re not even useful then).

I think maybe there’s a similar problem at play with code.  I think about control structures and return values, but those are traits of individual functions or closures.  Massively parallel computations have different characteristics.

For instance, it probably doesn’t make much sense to count CPU cycles in massively parallel computations.  Not that one couldn’t do that, but it just wouldn’t say much, I think.  It may not make sense to think about which way is faster at all- perhaps we should always try all the ways and just take whatever result comes back first.  There are other disconnects that I’m not getting yet, but my code is going to change when I start to.

Maybe the right way to think about parallel programming is to let a thousand flowers bloom and see what color the meadow is at the end.

Bell Curves: Not Standard, Not Normal, Still Awesome

I don’t usually tell people this, but I have a degree in sociology.

I am a sociologist.

My main reason for not telling people is this.  When people learn I’m a “computer guy” they always ask me for computer help.  I would hate for someone to hear I’m a “sociology guy” and ask me to fix their society.

That being said, the high holy graph of sociology is a bell shaped curve, which sociologists call the “Standard Normal Distribution.”  It’s not only a graph, but also a presumption about the distribution of characteristics in a population.  Additionally, it’s a way of talking in extreme shorthand about potentially large data sets.

This particular bell curve has two salient characteristsics: mean and standard deviation.  If I say “The mean is ninety-one and the standard deviation is six,” that means the middle of my bell curve is at ninety-one, sixty-eight percent of the area under the curve is between eighty-five and ninety-seven, ninety-five percent of the area under the curve is between seventy-nine and one-oh-three, etc.

And I can say all that in one short sentence: ”The mean is ninety-one and the standard deviation is six.”

It’s cool, but it’s also totally fake.  Of course, any data that can be averaged can be shoved under a bell curve.  But in most cases, the only reason to do so is so that you can use the shorthand I described up above- it doesn’t mean the curve is a very good fit for the data.

For instance, the distribution of IQ in the human population is often shoved under a bell curve, thus proving that most of us are very, very average, and very few of us are genuinely stupid or crazy-smart.

Which is total bullshit.

In fact, what I would like to offer is a bell curve of my own, which is a bell curve of how awesome it is to use a bell curve to describe any given data set:

Bell CurveWhich is to say that the vast majority of the time, it tells you nothing.  But sometimes, it’s awesome.  Other times, it kind of sucks.

That is all.

Some Reflections on This Year’s Garden

Winter Squash came early. Plant it later: some time in mid-June, maybe. As nice as it was to have winter squash in late July, it would be nicer to have it in late October.

Tomato staking didn’t work for me, mostly because in our climate, we can leave four or five branches on the indeterminates, and that’s too many to tie to a single stake. On the other hand, I wasn’t really satisfied with how they trellised last year using leftover fence- we had a higher yield, but it took a lot of time. Next year, maybe we’ll try try an overhead support with twine coming down, and some tomato clips.

Hot spring meant early-bolting greens and unhappy sugar peas. I’m not sure what to do differently. Maybe hope for fewer ninety-degree days in May ;) This year we could have planted sugar peas in late February, I bet, but that definitely wouldn’t have worked last year, when we got a frost on May 11. I don’t think it frosted once in April this year.

We let our kale bolt in the spring, which was an interesting experiment. The birds loved it. They parked in the kale branches for a solid month, and wound up distributing kale around the garden and beyond. Every single seed must have sprouted, which included a carpet of kale in that planting box, which pretty much rendered it unusable for anything else, other than hot-summer-baby-kale, which is not much of a treat. Not sure if it was a feature or a bug overall.

Planted the peanuts too close together, should have done it in the patch, not in a box. They sure are pretty, though.

Loved the beets, will probably plant more and more varieties next year.

Peppers did great, but they need to be supported.

Don’t love spaghetti squash. Love acorn and butternut. Hubbard is doing great, lots of them, don’t know if we like to eat it yet. All the squash needed way more space than we gave it. We had squash borers, but half the squash seemed to ignore them and keep growing, while the other half abruptly died.

All the squash and melons need way more space than we gave them. And on that topic, melons are awesome around here. Watermelons, cantaloupe, and we should try some more. No pests bothered them, and they were prolific, and they tasted great. More, please!

Cucumbers only last six or seven weeks, but it’s enough to get three or four cucumbers from each plant. They appear to always get the wilt that seems to be pretty ubiquitous around here.

Deer ate every one of my beans and tried their best to kill the sweet potatoes, but seem to have failed (they’ve been eaten back to the stems twice, but just keep putting out new leaves and growing bigger. Maybe that’s okay?

Loved having flowers interplanted. Loved having annual herbs interplanted.

Volunteer squash suck- none of them were edible, though some of them were pretty, but they totally took over wherever they came up. On the other hand, I pretty much loved all our volunteer tomatoes.

Planting onions from seed didn’t work in the spring, because the plants got overgrown with weeds that we couldn’t pull because it always pulled up the onions that were next to it. We’re going to try that again in the fall.

Herbs all did great, especially the lavender that Susan planted, and I learned a lot about babying those particular beauties along. Sage, rosemary, basil, thyme, chives, all seem not to need too much babying.

I think the rhubarb would be happier with a little less sun. Maybe we should move some into the orchard under apple trees? Near the house?

Asparagus is going gangbusters, we should eat some next year.

Sunflowers are totally fun, wish we’d planted them earlier. Same goes for corn.

We need to take better care of our strawberries, and I think we need to switch to a June-bearer around here. Summer is just too hot for those puppies. Maybe they’d do okay next to the house as well?

In general, I suppose we need to focus on getting the high-maintenance stuff going in boxes, the low-maintenance stuff in the patches, the sun-shy stuff out of the sun, and a better supporting method for everything that needs to be supported. Maybe we should try a couple methods next year.

I suppose we’ll increase the size of the garden patch, leave the boxes about where they are, get a water feature running for the critters, let fewer vines grow between boxes, make it easy on ourselves to mow the spaces between boxes, which will in turn leave fewer weeds in the boxes.

These are just the things I remember right off the top of my head- our spring harvest was lovely, and I wish I remembered a few more details from it or had written down some thoughts then.

Term Oriented Parsing

@eikeon and I keep talking about term oriented programming and circling ever closer to something that doesn’t completely fall apart the first time someone touches it… we’ve landed on a few conventions that I’m document here primarily for the purpose of remembering them, and in order to let him comment on whether I remember them correctly.

A grammar is a list of simple named graphs called parts of speech. Each part of speech consists of a label and a list of neighboring parts of speech. One refers to a part of speech by its label. A label may be used more than once, leading to a somewhat confusing ambiguity when you’re not careful.

A lexicon is a list of terms. Each term consists of a label, a part of speech (e.g. a named graph) and a definition. The definition of a term is an ordered list of one or more terms, which we’ll call a sentence. For the sake of bootstrapping, a term whose definition is identical to its label can be considered a terminal graph node: no sub-parsing is required.

A sentence is an ordered list of terms to be parsed. It is considered parsed when each term in the sentence is assigned a part of speech and formed into a graph where each term is a node and there are no dangling vertices. That last assumption of no dangling vertices is one that may be relaxed in the future, but for now it means that if a verb in our grammar is defined as being connected to two nouns, and a noun in our grammar is defined as being connected to one verb, that two nouns and a verb can make a completely parsed sentence.

Parsing begins with the first term in a sentence. The term is looked up in the lexicon, which provides its part of speech. The part of speech is looked up in the grammar which provides its neighbors. This is stored in memory as an incompletely parsed sentence. On the next term, the process is repeated, and the two incompletely parsed sentences are attempted to be joined following the rules set out by the part of speech (e.g. the neighborhoods have to be correct). This is done until the end of the sentence is reached, at which point if there is a complete graph found, it gets parsed, and otherwise it fails to parse.

Obviously, the naive approach will only work with carefully constrained lexicon, grammar, and sentences. It is that which I suppose we’ll begin with.

Oh, and left-to-right parsing is arbitrary.

Programming is Inventing a Language

The act of programming a computer, and the act of inventing a language, are the same act. By convention, we use one toolchain for the former, and an admittedly more difficult (and correspondingly more powerful) toolchain for the latter. I imagine a world where this is not true.

I imagine a world where the act of writing a program and the act of inventing a new programming language are identical. All the power of the tools used by the language designers in the hands of mere programmers, and visible to the very end.

In that far flung science fiction world, the act of using a computer program and the act of making a computer program are probably also the same act.

I imagine a world in which the tools for inventing language are made available to children, who invent languages for fun, and whose languages are understood, also for fun.

Oh wait, that’s just called bath time around here.

Parts of Speech Are Named Graphs

@eikeon chided me gently for a pretty major oversight yesterday, and I intend to correct it here, hopefully freeing up he and I to move ahead a little on Hu (more on that topic later).

In a lexicon, a part of speech is a named graph.  Specifically, when I say “lentil is a noun” what I mean is that the term lentil has an entry in a lexicon whose part of speech is noun.  A noun is any term who can fill the space in a parsed graph where a noun belongs- or, spoken in reverse, a noun anchors a parsed graph and articulates some requirements for the rest of the graph.

So, if I say “I ate a red lentil.” there are five terms, whose definitions I’m going to ignore for the moment.  I’m also going to ignore positions in that sentence, which will create some problems down the line, which I’m also going to ignore for now.

“I” has a part of speech that’s quite lengthy: subjective-first-person-personal-pronoun.  ”ate” is a past-tense-transitive-verb.  ”a” is an indefinite article.  ”red” is an adjective.  ”lentil” is a noun.

For the sake of having a place to start, we parse the leftmost term first.  If I look up “I” in my lexicon, I see that it’s always a first-person-personal-pronoun.  First-person-personal-pronoun is a named graph that identifies how the term “I” connects to other terms in a graph of meaning.  Maybe its graph looks something like this:

first-person-personal-pronoun
|-past-tense-transitive-verb

Which is another way of saying, “in the semantic graph of this word, a first-person-personal-pronoun is always connected to a transitive verb.”  Of course this is not the case (for instance, it could be connected to an intransitive verb, but that’s where ambiguity has entered our grammar- that really should be a different part-of-speech, but that’s just too unwieldy for a lexicon that’s useful for humans).

The next term we encounter is “ate” which has the part of speech past-tense-transitive-verb, which has a meaning graph like this one:

past-tense-transitive-verb
|-first-person-personal-pronoun
|-noun

Once again, obviously a simplification, since transitive verbs can live between all manner of nouns in a semantic graph.

The next part-of-speech is an adjective, which simply hangs off of a noun in the semantic graph, like so:

adjective
|-noun

Now we get down to the noun, which has a graph like this one:

noun
|-adjective
|-past-tense-transitive-verb

Technically, I guess we’ve described an objective noun there, but with some handwaving on this simple example, we have parsed into a graph that looks something like this:

I
|-ate
  |-lentil
    |-a
    |-red

The fact that I is at the top of this graph is really just an artifact of its presence at the beginning of the sentence.  The sentence makes just as much sense if it is said “A red lentil ate I” which would rearrange its graph somewhat, but be semantically identical (see the previous posts on hypergraphs if that’s confusing, which will make it more confusing).

So, the work that @eikeon and I now need to do is turning a bunch of parts of speech into a bunch of named graphs, and beginning to identify the places where those parts of speech are actually multiple parts of speech sharing the same label (e.g. the name names different graphs depending upon the context).  At that point, we’ll either allow name overloading, or for simplicity sake, we will start having a few hundred more parts of speech.

Heh, because that would be simple.  Heh.

The Fair and the Fay

As I had it explained to me, a fairy is one of The Fair Folk.  There are a hundred different names for them just in English, with a hundred different implications.  A fairy is what you get whenever some aspect of nature is successfully ensouled.  This has happened a lot over the centuries since (and before, I suppose) we humans were ensouled, leaving all manner of Sprites, Brownies, Kitsune, Niads, Dryads, Pixies, Elves, Goblins, Sylvans, Nymphs, etc.  The Fair Folk are an emergent property of an ecology in balance.

The Fay are wild.  Some are born wild, some grow wild, some grow tame.  King Arthur’s half-sister Morgan was famously Fay.  The matriarch of clan McLeod, likewise.  You probably know some people who are more or less Fay.  All it means for The Fay to be wild is that they are not subject to some set of rules.

To the extent that the Fay gather together (such does not happen often any more), their abode is a Fayrie or a Faerie.  The “King of the Faerie” is not the king of all the Fay (they are, after all, wild), but some Fay who is meaningfully associated with that place.

The Fay are flesh and blood.  Fairies are emergent spirit beings.  But to confuse matters, Fay live in a Faerie.  And to confuse matters even more, a Faerie is likely to play home to fairies as well as Fay.

Lucky for everyone I didn’t delve into fairs and faires and fey today.  Matters are confusing enough already.

For the Love of Lexicons

An entry in a lexicon is a beautiful thing.  I think lexicographers call the entries “lexemes” but there are other words that relate, like sememes and semes and morphemes and memes and graphemes.  I don’t think there are any gremes, though there are grimoires and grammars and grams.

I call them terms.  A term in a lexicon has three basic pieces: the sequence of letters, the syntactic structure, and the semantic meaning.  It’s also my understanding that in a lexicon, the sequence of letters can have “alternate spellings” that are considered the same lexical entry, or term.

Roughly speaking, the syntactic description of a word is a part of speech.  A part of speech is a named graph, which describes how the term (at the center of the graph) connects to other parts of speech.

The semantic meaning of a term is defined in terms of other terms.  Forget buffalo buffalo buffalo, the hot new dish is To Everything, Term, Term, Term.

The semantics are not ambiguous, they are very specific.  If you replace a term with its semantic definition, the meaning of the original sentence remains the same, except it is now parse-able by a parser that doesn’t understand the original term.  Nice!

What is not necessarily in the lexicon, but still contributes to the meaning of a term (where I use the term “meaning” to gesture meaningfully at its usual commonsense meaning), is its use.

The use of a term is the list of every time it is used.

Ever.

Which is part of why it’s so hard to find meaning in that word meaning.  It’s a mean word.

Piebald Stag

We first met the Piebald Stag about two years ago.

We were out in front of the house having a picnic.  I happened to be seated facing East, where I saw an imperious figure stalk out of the woods and fix us all with a stare.  He just stood there looking at us, as if to catch our attention.

“Does everyone else see that?”  At first I was worried it was only me.

He had the coloring of an Appaloosa horse, and he was big.  Real big.  Big like… well, big like an Appaloosa horse.  He had the rough overall shape of a four-point whitetail buck, big antlers and big eyes.  Which, as I mentioned, were staring imperiously toward our little picnic.  His antlers were huge, and his nose had a funny shape to it- not straight and narrow like a deer, but curved downward and thick.  His nose reminded me of a pit bull, except there was nothing vicious about it.  Same shape, though.

“What is that, Daddy?”

“I don’t really know, Punkin, ask your mama.”

“I don’t know either.”

We stared his way, and he stared our way.  Then with a whuff and a snort, he turned around an disappeared into the trees.

He was our first introduction to The Fay.

Word

All the talk about Term Oriented Programming has got me thinking about words.  The term “words” has a subtly different meaning than the word “terms”.  How’s that for a confusing start to a blog post?

“Word” is a term that is useful for describing some the reusable parts of any exchange of meaning.  Thus, I can say “thus” more than one time even in a single sentence.  I can reuse thus, thus.  My reuse of the word may (and probably does) convey different intent.  However, intent is not part of a word- intent is an emergent property of words that are used together with other words, and are part of an exchange.

A word may be a sequence of characters, a combination of sounds, a movement, a drawing.  For all I know it could even be a smell or a temperature or a pressure or a color, though I don’t tend to recognize those words.  What makes it useful to think of any one of these as a word is that it’s reused, and it’s in a context that uses it to convey meaning.

The word “term” I use in a subtly different fashion: it still includes a label (the word part of a term, I guess), but it also has a particular way of connecting to other words.  Exemplis gratis, a term that connects to verbs would be an adverb, but a term that connects to nouns might be an adjective.  Well and good.

A term also has a definition, which is made up of other terms.  Which leads to the confusing fact that buffalo and buffalo and buffalo are three different terms- one is a verb, one is a singular noun, and one is a plural noun.  And the sentence “Buffalo buffalo buffalo,” is perfectly valid (despite having some ambiguous meaning).  One word, three terms.

A word does not carry meaning.  Words do.

A term carries its meaning with it, but until it is known, I suppose a term could be thought of as just another word.

A word is the label for a term.