Sunday, June 22, 2014

Rotaries v Intersections, An Exercise in Analysis


(Picture from here.)

This is the sort of thing my brain does. Which probably tells you more about me than you want to know. Indulge me. Next time I'll talk about space drives. I promise.

I live up here in Massachusetts. When I moved up here, back in the Cretaceous,  I encountered something called a "rotary." It's also called a "roundabout", "circular intersection", "traffic circle" and other names. Some of which are even printable. They took a little getting used to but I managed. The problem with Mass drivers isn't rotaries; it's that they, and the state police, view traffic rules as mere suggestions or revenue sources. No one takes them seriously.

Then, in the 80s, there was a big push to get rid of rotaries. It is a certain truth in life that no intersection is so completely devoid of merit that a Massachusetts traffic engineer can't make it worse. Perfectly functional rotaries were replaced by obvious inventions of the devil. At left is a picture of what happened to the Route 2 Rotary in Cambridge. The black circle is where the rotary used to be. That mess is controlled by four barely functioning stoplights.

Get caught in this thing and kiss an hour of your life good-bye.

So, I'm driving into work today and not happy about it. To alleviate my boredom I took a back way in through Lincoln. The back way goes through a 5-points. This may be a term most people are not familiar with. It's a relic of my sordid youth in Alabama. A 5-points is a 5 way intersection. And, of course, there was little or no understanding by the drivers of who has which turn. I got through that and mused on intersections all the way in.

It came to me that intersections have an ascending complexity rule. It's an easy one to formulate. Let's consider the simplest intersection, a straight line with a stop sign. No cross streets.

Since the road is bi-directional, two drivers have to be considered. So each driver has exactly one choice. This is a complexity level of two. The next kind of intersection is three points. Each driver has to consider two choices. This gives us a rule of:

C = R * (R-1), where R is the number of roads coming into the intersection and C is the complexity level.

This number goes up fairly quickly. For R = 3, the C value is 6. For R = 4, the C value is 12 and for my favorite, the 5-points, the C value is 20. If you graphed this it would look like an ascending curve.

Rotaries have a different rule. Each entry at a rotary has, in effect, an R of 2. The choice is limited by 1) spreading out the intersections across the rotary and 2) determining that direction of travel in a rotary is one way. This turns the rotary into a series of R-2 intersections. The complexity of the entire rotary could be considered a sum of the R-2 intersections.

So, in this case, if we have a four way intersection, we have a complexity level of 8 as opposed to the R-4 straight intersection complexity level of 12.

Notice that while the curve for  a linear intersection is an ascending curve,  the increasing complexity of the rotary is linear. This means we can add complexity to a rotary with much less impact than adding the same complexity to a linear intersection. However, it also says that for a small intersection, the complexity of a linear intersection is less or equal to a rotary.

However, rotaries were often the victim of their own efficiency. One could get on a rotary faster than one could get off. This caused nightmarish congestion. The Brits came to our rescue and redesigned the rotary in the 1960s. The big change was the addition of a precedence rule: vehicles in the rotary have priority to those outside the rotary.

(This, by the way, was always the rule in Massachusetts but drivers often had difficulty understanding it. The problem driver precedence, I think, was one reason rotaries fell out of favor.)

But there is a hidden complexity in the rotary. The 4-way intersection is intended to be traversed one at a time. Time is not a factor except as measured by the impatience of other motorists.

In the rotary, however, vehicles are on the move. Time is a significant factor. The rotary has to be sized that a given vehicle has enough time to get on and off the rotary. Ideally, this is done without much slowing down.

If we take 30 mph as an ideal speed of traversal, that's 44 feet/second. Let's allow 3 seconds at a given intersection in the rotary just to have room. That's 132 feet between intersections. A simple two road rotary would have to be 264 feet in circumference or 84 feet in diameter.

I'm not sure how to evaluate this numerically. If 30 mph is the proper speed than as the size of the rotary increases or decreases, the complexity must increase or decrease. The number of choices remains the same but the time in which to make them is a variable.

When I was visiting my home town in Missouri I saw what must be the smallest rotary imaginable. It could not have been more than 20 feet in diameter. Two cars draped across the center would hang off both ends. This little thing had four roads coming into it. If you didn't hang hard on the steering wheel, you would drive off the road. But I digress.

This is the sort of analysis engineers do on all sorts of things. There's a reason that data going across a network is called "traffic." Many of the original network topologies use road metaphors. One of the famous problems of mathematics, solved by Euler in 1735, is how to determine the optimum path to traverse seven bridges in Konigsberg. That was the beginning of graph theory. Which was the start of that map program in your smart phone.

Which could help you navigate one of the Massachusetts rotaries.


Sunday, June 15, 2014

The Turing Test


Well, last time I spoke about how the Fermi Paradox irritated me. I'm on a curmudgeonly roll. Since it's in the news, let's go gunning for the Turing Test.

The Turing Test was invented, not surprisingly, by Alan Turing. It came from a paper entitled Computing Machinery and Intelligence and appeared in Mind in 1950.  It was an attempt to determine whether machines could think without defining a "machine" or "think", since these were potentially ambiguous concepts. He wanted something that could get beyond this problem.

Turing proposed an "imitation game" where a judge must attempt to determine if a respondent is a human or a machine. To do this, the conversation between judge and candidate was made devoid of clues by using a teletype (remember, it was 1950). If the judge could not distinguish the machine's conversation from human, then the machine "won". If the judge could detect that the candidate was not human, the machine "lost."

Turing thought that if a computer could fool a human judge up it had shown itself sufficiently capable as to be considered "intelligent."

I don't have a problem with the Turing Test as long as we understand a few things about it:
  1. It is a very limited kind of intelligence that is being tested
  2. It is limited by the context of the test and the biases of the judges
  3. It does not imply anything about the humanity or experiential nature of the candidate.
  4. It plays into human biases in that it presumes that something that is capable of indistinguishable imitation of a human is as intelligent as a human.
 Let's consider a thought experiment. Let's say we have added intelligence to a dog. It's just as smart as a human in terms of cognitive brain power but it's nature, motivations and considerations are still that of a dog. We give the dog a Turing Test. Would it pass?

Maybe. Maybe not. Remember it's still a dog. Dogs are not motivated the same as humans. Their sensory system is very different. We are sight animals. They are smell animals. That alone is going to make the conversation interesting.

But the Turing Test presupposes that a human response is the correct response regarding intelligence. Consider if the situation were reversed and the dogs were giving a Turing Test to the humans. Perhaps a question might be, "Are you smelling my excitement right now?" (One should think that dogs would make a Turing Test that they would be able to pass.) The human would be unlikely to answer correctly and the dog professor would say sadly these humans are just not as smart as we canines. We share a lot with dogs. An intelligent extraterrestrial or computer program is going to be much harder.

We live in the context of our humanity. We should expect other, non-human, intelligences to live in their own context. My point is that there are only two possible true successful systems that would pass a Turing Test. One is a program that is specifically designed to pass a Turing Test. It doesn't have to have any general intelligence. It's designed to show itself as intelligent in this very limited domain.

Which brings us to Eugene Goostman, the program that "won" the most recent Turing Test.

Eugene Goostman is a chatterbot-- a program specifically designed to hold conversations with humans. Goostman portrays itself as a 13 year old boy from Ukraine that doesn't understand English all that well. I've read the transcript of some of Goostman's conversations. I argue that without this context provided by Goostman, it would not have passed. Goostman's programmers gamed the test in my opinion.

But let's say a really clever program was designed from the ground up to hold meaningful conversations. Would it be intelligent? I don't think so. Intelligence is a tool that can be applied in many circumstances. Watson, the program that won the Jeopardy is a closer contender. It's intelligence won at the game. Not, the same system is being used in medical decisions for lung cancer.
 
An intelligent conversationalist would be one that donated its intelligence to the conversation. It might supply insight. Make connections. In short, do all the things we expect from a human conversation. It converses intelligently instead of having conversational intelligence. That is, its conversation derives from its intelligence. It's not just a smart program that's learned to fool us.

Which brings us to the second possible winner of a Turing Test-- a system (biological or otherwise) that is so smart it can model our context sufficiently that we would find it indistinguishable from a human being. Such a system would have to be more intelligent than a human being, not less.

But this all presumes the Turing Test has a purity it does not possess. Not only does the test only measure an extremely narrow view of intelligence-- behavioral conversation-- it presumes the judges are unbiased. As we saw with Goostman, this is not so. And it could never be so.

After all, humans imbue cats, dogs, insects, statues, rocks, cars and images on toast with human like qualities. We infer suspicion from inept sentence structure. We infer honesty when it's really spam. We infer love from typewritten conversation when it's really sexual predation. Put two dots over  a curve and we inevitably see a face. Give us a minimum of conversational rigor and we inevitably determine that it's human.

Humans can tell what's legitimately human and what's not a lot of the time. But we don't do it from characters on a screen. We detect it from motion or facial expression. We detect it from tone of voice or contextual cues. We know when something that purports to be human, isn't, if we can bring our tools to bear on it.

For example, there's the uncanny valley. This is when an artificial visualization of a human being gets very close to presenting as human but not quite. People get uncomfortable. It happened with the animated figures in Polar Express. The characters animated on the train were just a little creepy. Exaggerated figures such as Hatsune Miku or the characters from Toy Story are fine-- they're clearly not human and don't trigger that reaction. Think of the characters in Monsters, Inc: monsters all, with the exception of Boo. But we were able to fill in any missing humanity they lacked. (The fact that the story was brilliant is beside the case.)

Alan Turing was a genius but, personally, I don't think the Turing Test is one of his best moments. It's an extremely blunt tool for measuring something that requires precision.

I invite the system under test to come with me to a family reunion with my in-laws. Navigating that is going to take some real intelligence.



Sunday, June 8, 2014

The Fermi Irritation

(I meant to upload this and thought I had. But I didn't. Oh, well. Sorry.)

I'm on my way home from work and I’m in a bad mood. So, I’m going to talk about something that regularly irritates me.

Like Pap in Huckleberry Finn, "Whenever his liquor begun to work he most always went for the govment." I go for the Fermi Paradox.

Enrico Fermi came up with it. Essentially, it says: the universe is unimaginably old. We arose. If we’re typical, surely in all that time some other intelligent race has, too. Why don’t we see them?

The Paradox is rather a Rorschach test. It reflects more the point of view of the person discussing the Fermi Paradox than the Paradox itself.

The Fermi Paradox has been discussed over and over, both in science and in the science fiction communities.

The science community came up with the Drake Equation, a way of formulating the variables of the problem. This comes right out of Wikipedia:

N = R_{\ast} \cdot f_p \cdot n_e \cdot f_{\ell} \cdot f_i \cdot f_c \cdot L
where:

  • N = the number of civilizations in our galaxy with which radio-communication might be possible (i.e. which are on our current past light cone);
  • R* = the average rate of star formation in our galaxy
  • fp = the fraction of those stars that have planets
  • ne = the average number of planets that can potentially support life per star that has planets
  • fl = the fraction of planets that could support life that actually develop life at some point
  • fi = the fraction of planets with life that actually go on to develop intelligent life (civilizations)
  • fc = the fraction of civilizations that develop a technology that releases detectable signs of their existence into space
  • L = the length of time for which such civilizations release detectable signals into space

But that’s really only saying what would have to know in order to figure out the probabilities. Without the content of the variables, we really know next to nothing.

There have been several SF books to explain why we haven’t heard from our neighbors. Personally, I like Larry Niven’s idea from World ofPtavvs. He suggested that intelligence was a naturally occurring phenomena. But a few million years ago a violent telepathic race of enslavers beamed out a massive command to commit suicide when they were about to be overwhelmed by a slave uprising.

It's pretty quiet out there. No escaping that.

Many people who discuss this problem one of two camps:
  1. We have no evidence of them. Therefore, human beings are a singular event.
  2. We have no evidence of them so we should keep looking. Something is surely there.

Personally, I’m in the latter camp. Not because there is any real hope of detecting them—I don’t think there is—but because if there was evidence we’d be damned fools not to check.

There are a couple of problems with the paradox itself. For one thing, it is instantaneous: it must always be analyzed in terms of the known world at the time of analysis. We didn’t have an indication until just a few years ago how many variant planets were in the Milky Way. If planets were a rare event, we would expect planetary life to be an equally rare event. Now we have a better understanding of planets—there are lots of them. The current estimate of earth like planets, at least size and mass, is about 100 millions.

About that is spread out over the whole galaxy. And it doesn’t account for time.

Life has been on this planet for nearly four billion years. But we didn’t have eukaryotic cells until only about 600-700 million years ago. Invasion of the land was about 300 million or so years later. Mammals didn’t get their start until 65 million years ago and our genus didn’t get started until about 2 million years ago. Humans have been thinking for less than 250k years and we’ve only been in a position to actually detect extraterrestrial life for a little over a century.

Of those 100 gigaplanets, how many, like Mars, had their life opportunities come and go? For all we know, Mars had a thriving civilization about a billion years ago.

All evidence points to a relativistic universe. That is, we are limited by the speed of light. Physical travel between the stars is probably beyond us—or it may require us to give up our humanity. We might end up striding across the galaxy as powerful as gods, but we’ll no longer have a human perspective.

A better detection mechanism is to detect some sort of photon emission—radio, visible light, etc. We can signal each other like candles in the dark.

But even that has a duration. The span of frequencies that we manipulate is called the spectrum. As we’ve found over the years, broad use of the spectrum is wasteful. Consequently, the radio spectrum is cut up like fine cheese. In addition, not all parts of the spectrum are created equal. Some portions—radio, for example—are particularly nice for wireless communication. Visible light is very nice for carrying signal but it doesn’t broadcast very well. You can communicate with a laser but you need to aim it particularly well—or push it down a pipe like optic fiber. Scarcity and demand determine price and spectrum has gotten expensive. It's not going to get any cheaper.

I expect that we (and by extension of our sample size of one, everybody else) will refine our use of spectrum away from broadcasts that can be picked up by our neighbors and direct more where it will be useful. That’s going to reduce our stellar footprint. In addition, we are already getting farm more efficient in how much signal we actually use. Some of our satellites barely put out more watts than a cell phone, relying instead on better receivers. Detect that Antares!

And that is presuming a detectable civilization (i.e., us.) even survives.

That, I think, is the biggest problem of Group 1 of the Fermi Paradox. They are inherently optimistic that in the broad expanse of time a single group must have survived long enough for us to detect them. Their absence must indicate our singular existence.

Think back on our own evolutionary history. Life was here for nearly four billion years before we could detect or be detected. If, say, humans lasted a million years, we could miss talking with our neighbors four thousand times by being out of sync just a little bit. They started their climb a million years after us—we miss. A million years before—we miss. And that presumes a million year life span for human beings. It doesn't take into account that evolution is always going on. We have no idea what Homo sapiens will evolve into. Only that in a million years we won't be Homo sapiens

There might be gods out there—species that were so stable and intelligent that they have lasted across the time of our ascent. But they will have a god’s perspective. Which means that there is no determining whether they would want to or be able to detect us or if we would be able to detect them. If they created a supernova to send a message over to their fellows in Andromeda, we’d never recognize it as other than random noise. Unless, of course, they took an interest in us. They just made a movie about the last time we interested a deity overmuch. It’s called Noah.

But I don’t think there are gods out there. I suspect if we have neighbors they're pretty much like us: fumbling our way into a greater universe with the meager tools evolution gave us. Putting out enough radio waves to show themselves but too far away or out of synch to be seen.

We’re probably not alone out here. But we may as well be.




Sunday, May 11, 2014

Song vs. Story


(Picture from here.)

My father was a musician and my mother was a writer. Apparently, it's harder to teach story than music so I started piano at four and have kept it up ever since. Think of me as a determined and talentless, but enthusiastic, amateur.

But my mother got me in the end.

Over the years I've been thinking over and over how music and narrative are related. I don't mean sound tracks intended to support or tell actual stories or things like opera where stories are performed with music. No, I mean the structure of music itself seems to be strongly related to structure of story telling.

I suppose this shouldn't come as a surprise. Story narrative and music both bind time. Narrative binds time in the form of a list of events-- even if those events are out of sequence. Though the binding in the case of stories is looser. A reader isn't forced to read stories, sentences or even words one after the other. Some (me, included) tend to read blocks of words, skipping forward and back within the block. In comics narrative can float across the page in all sorts of ways.

Music, though, binds time exactly. The note is played at a given time and no other. Even if the performer is improvising, once the note is played it cannot be unplayed. The note is fixed in time.

However, I think the relationship between story and music is even deeper. To prove my thesis I'm going to crawl through a fairly easy pop song I happen to like. It's called The Transient Apple Salesgirl. It's a Japanese song-- I like listening to J-Pop. I'm not distracted by the words. It has something to do with transience. And girls. And apples, I think. Listen to it here.

I mean I could do it with Beethoven but then we'd be here forever.

This song has a number of musical themes that happen at particular points in the song. It begins with a mechanical sound like the winding of a music box. Then a music box plays followed by a little singing. Then the song starts in earnest. It has the following themes.

  • music box theme: trifle played on a music box
  • descent theme: descending pitch theme that is reminiscent of the music box theme, but descending in tone rather than ascending 
  • bridge theme: a broken rhythm theme that ascends sort of like a counter point to the descent theme
  • chorus: strong declarative musical line that seems to echo the music box theme 
  • crossed lines bridge (up and down): interesting theme where the voices go up and down but the background inverts it at the same time.
  • Resolution theme: resolves the tension in the crossed lines bridge
Here are the times for these themes in the song:

0:00 - mechanical introduction (winding up of music box)
0:05 - music box theme
0:19 - music box singing
0:44 - descent theme
1:36 - bridge theme
1:49 - chorus
2:07 - crossed lines bridge (up and down)
2:16 - descent theme
2:40 - bridge theme full
3:07 - chorus
3:25 - crossed lines bridge (up and down)
3:33 - chaotic bridge based on bridge and crossed lines theme
3:45 - crossed lines bridge/bridge theme
4:00 - Resolution theme: inversion of crossed lines
4:28 - chorus based on music box
4:45 - chorus raised key
5:04 - crossed lines bridge
5:12 - instrumental fade based on resolution theme
5:38 - music box fade

Now, if you graph these themes you get the picture of the song visually. (Click to enlarge.)



One of the first things you can see is the repetition pattern. Note two of the themes that are first introduced, the descent theme and the chorus, are big in the beginning and get smaller towards the end of the song. Note also, that some of the small themes in the beginning increase towards the end. Similarly, some of the sections are blended.

It's also clear the sections get smaller and smaller as time goes on.

Some of the themes are constructed to echo previous themes. The chorus has a relationship to the music box. The resolution theme has a relationship to the crossed lines.

Good stories are filled with these textures, resonances and relationships. Often, something in the beginning of a given story might appear unrelated to what comes immediately after but by the end of the story makes perfect sense. 

Some of the sections have more than one theme in them. There's a section at 4:28 where the chorus them is played against the music box. Similarly, there's a section at 3:33 where both the bridge theme and the crossed lines theme are played against one another. At 3:45 this same blend is played frantically, chaotically, in a climax to the song. 

In a story, when the climax is reached, the scene nearly always presents elements that have gone before-- otherwise the climax doesn't make any sense. Would Neo's belief in himself when he faces the agent make any sense if he hadn't gone through a crisis of faith before. Would his saving of Morpheus make any sense if Morpheus hadn't reached out to him before? Would Neo's battle with the agent work if the agent hadn't betrayed a personal antagonism to human beings? All of these little resonances and nuances play out in story.

And they play out in music in pretty much the same way. In Apple, the resolution theme is built in part from the crossed lines bridge. The crossed lines bridge echoes the previous descent theme. And, of course, the music box bookends the whole song. In a story, we would expect the resolution to echo and relate the conflicts that came before. Similarly, the conflicts themselves would have resonances to the situation, the character and world of the story. We have expectations of the path of a story. We have similar expectations of the path of a song. Sometimes the story/song fulfills the expectations. Sometimes it confounds them-- to our delight.

It's hard to take apart a story. After all, you must read and understand the internal pieces of the story to make sense of them. And it's hard to keep from being swept away from it.

But you can engineer the experience with music. You can choose a small piece-- this one is only about six minutes long-- that's relatively simple. Choose one where the language doesn't interfere. 
Then, pick apart the piece and get a sense of how the components mesh. That sense of things can then be translated into how a story works: The color palette can reflect something important. (The Cook, the Thief, his Wife and her Lover.) The image of scissors. (Dead Again.) The river can tie it together. (Huckleberry Finn.) 

I heard in a lecture years and years ago that music is composed of equal parts surprise and inevitability.

What a wonderful surprise. Stories are, too.

Sunday, April 6, 2014

Evolution of the Lung


I'm getting over pneumonia so in a vain attempt to make lemonade out of lemons, I'm going to talk about the evolution of the lung.

The lung one of the major mechanisms-- if not the major mechanism-- that enabled invasion of the land by animals.

The necessity of lungs is based on the vast difference between gaseous oxygen and oxygen dissolved in water. For one thing, when water passes over the gills of a fish (or crab) it one fluid (water) passing next to another fluid (blood) across a thin membrane. This is very similar to what already happens within the body of a complex organism.

In fact, some organisms are so simple that they have no need of circulatory systems at all. It is sufficient that they are in contact with water that contains oxygen. The oxygen crosses the membrane easily.

But there are some downsides.

For one, the amount of oxygen that can be dissolved in water is less than the level of oxygen in air. At 0C, the amount of oxygen in water is 14.6 mg/l. Air weighs 1.2 g/l, of which 21% is oxygen. That works out to about 251 mg/l-- more in the historical past. In addition, the solubility of oxygen in water is temperature dependent. If you bring the temperature up to 37C (human body temperature) the amount of O2 available drops to 6.71 mg/l. (See here.) Biochemical reactions like to take advantage of heat. But there's an obvious tension between the oxygen available for metabolism and the heat loving biochemical reactions.

All through the ocean different organism act out this tension from the smokers down at the sea bottom to the rich green soup of some lakes.

Think of the ancient oxygen atmosphere before organisms invaded the land as a wonderful resource yet to be exploited.

Given the sheer amount of available oxygen in the gaseous atmosphere, why did it take several hundred million years for animals to make it to land?

Well, the lungs were hard to evolve. Different groups of organisms such as insects, vertebrates and scorpions, used different strategies.

All lungs are a mechanism of concentration and distribution-- gills serve the same purpose in water. The idea is to expose a specialized organ used to absorb the oxygen and serve as source to be distributed over the body. It's a compromise between the necessity of oxygn being available to all cells of the organism to oxygen and the engineering problems of exposing the cells to the outside environment. A consequence of this compromise is the contents of lungs (or gills, for that matter) have enormous surface area to volume ratios. The human lung, for example, has about 70 m2 of surface area-- a square about 8 meters and some change on a side. About the floor plan size of a studio apartment.

Arachnids such as spiders and scorpions have something called "book lungs". These are flattened air sacks adjacent to one another, with the intervening space filled with hemolymph-- the equivalent of blood. Air is moved through the sacks allowing gaseous exchange.

Insects do something different. They have entry orifices called spiracles, allowing the air to enter a trachea. The trachea branch smaller and smaller, finally becoming tracheoles-- dead end, water filled compartments. (See here.) The tracheoles deliver oxygen directly to the tissues. In effect, the whole body of the insect-- or at least where necessary-- is riddled with lung like structures.

Vertebrates have more than one strategy but they all have the concept of a central concentrator space where oxygen is absorbed and then distributed via blood and the circulatory system.

If you look at the drawing above, you'll see the evolution of the different vertebrate groups through time. We're all familiar with the different extant vertebrate classes. We'll neglect the fish for the moment. On land, they are birds, mammals, reptiles and amphibians.

The first lungs are thought to derive from the swim bladder of fish. This organ keeps gas under pressure-- usually oxygen-- in order to stabilize swimming. The swam bladder is filled from a gas gland which extracts out gas from the tissue and blood stream and pressurizes it in the bladder. The pressure can be quite high-- even fish deep in the ocean have working swim bladders. Lungfish use the same structure in their air respiration.

The lungs of amphibians are composed of a few septa-- separated sacks-- which contain a few large alveoli-- blind chambers where oxygen transfer takes place. Since amphibians also respire through their skin the lungs are not the sole means of oxygenation.

The first lungs that look familiar to us arose in reptiles. Reptiles have alveoli, as we do. They have complex branched lungs-- though less branched than ours. Reptiles have no diaphragm and move air differently. However, that's more of a description of reptiles in general. Crocodilians have a more complex story to tell. But we'll get to that.

We have mammalian lungs: complex branched structures that terminate in highly vascularized containers called alveoli. Like most vertebrate lungs, air proceeds through the lungs one way at a time. In, then out, in a sort of bellows arrangement caused by the diaphragm.

There are a lot of problems with a bellows system. For one, it means that there's a lot of dead air in the lungs. That makes the lungs inefficient. For another, the termination areas somewhat susceptible to infection. After all, it's just a little cell where air comes in and goes out through a whole. It's easy to close off.

One of the biochemical developments that had to occur for lungs to work was the evolution of pulmonary surfactants: chemicals that manage the surface tension on the wet inner surfaces. In the absence of the surfactants, when segments of the alveolar membranes touch, they stick. This is not a good thing. Surfactants allow them to unstick from one another. The development of these surfactants predates the lungs so they were right there to help early on.

Now, we come to my favorite lung system: that of the birds.

Birds do not have an alveolar system. Instead, their system is tubular. Imaging the bird lung extracted into a long tube. Air comes in one end of the system and comes out the other. Instead of alveoli, they have parabronchii-- small tubes where gas exchange occurs. (See here.)

There are host of advantages to this sort of system. For one thing, there's no dead air. There are reservoirs where little exchange occurs. These appear to have a mechanical purpose and aid in moving the air along. But there is no dead air in the parabronchii while there is considerable unused air in the alveoli. Remember your CPR. You exhale into the patient because there's a lot of oxygen left in your air.

Because the system is flow through, there's the opportunity for counter current exchange. Imagine you have two flowing tubes of water, one hot and one cold, and you want to heat one up with the other. You lay the tubes down against one another, right? What direction should the water flow in the tubes? The same or opposite?

If you thought "opposite" you win the prize. If the flow is in the opposite direction then there is a continued gradient as the fluids flow past one another. While in co-current exchange, the fluids reach equilibrium and exchange stops. The kidney uses this mechanism. An alveolar system can't because the flow is in and out. But the bird system, since its flow is one way, runs the blood supply in the opposite way.

This makes the bird system enormously efficient. Not only does it provide a means to reduce the size of the lungs-- important in a flying animal-- it also is much better at extracting oxygen at lower pressures. Climbers on Everest, wearing oxygen equipment, have reported seeing geese flying high above them.

The flow through system of birds actually may predate their dinosaurian ancestors. Crocodiles and monitor lizards have both been shown to have flow through systems. (See here.) Going back to the drawing above, crocodiles separated from line leading to birds way back when they were both thecodonts. So for crocodiles to have flow through breathing either means they developed it independently or the rudiments were there prior to the evolution of dinosaurs or birds. Which makes sense. Pterosaurs also popped off from thecodonts and there is ample evidence that they had similar respiratory apparatus as birds. Maybe the marine reptiles did, too.

A gentleman named Farmer (See here.) has suggested the alveolar lung evolved in the late paleozoic, a period of relatively high oxygen. However, flow through lungs evolved in the ancestor of crocodiles and birds to support apnea-- the stopping of breathing. Possibly this was an aquatic adaptation as it is in the crocodilians. Or for some other reason. Regardless, it did evolve and it was present in the archeosaurs. Which meant it was there and waiting when the dinosaurs came along. Then, came birds.

So, as I sit here and cough my lungs out, I look outside. The sun is shining. The birds are singing.

God I wish I was a bird.

Sunday, March 23, 2014

Making Good Characters Rationally Self Destructive



(Picture from here.)

About years ago, back when I was in college and dinosaurs ruled the earth, I ran across Garret Hardin's lovely book, The Tragedy of the Commons. If you want to go out there and read it quickly, go ahead. It's not long. I'll wait.

The metaphor was the British Commons where the townsfolk would share grazing land for their cattle. However, there was an incentive for an individual to sneak in and graze more than the others if he could get away with it. His cattle would get a little more food and he'd do better economically. Of course, if one person could do it, anybody could do it and ultimately the Commons is destroyed.

To summarize the book in a single sentence: short term individual gain trumps long term common good.

It's a beautiful metaphor for a lot of things. For one thing it shows why public space, be it capitalist infrastructure or water and sewer, has to be protected. Once I became aware of the process, it showed up everywhere from food safety enforcement to securities fraud.

It explains why governments are necessary.

But it does not explain irrational behavior.

Adam Smith's "Invisible Hand" is a purely rational construction. It has no moral conscience or presumption of anything other than the iron rules of supply and demand. Prices go up as demand goes up or supply is restricted.

But as we all know we are anything but rational.

Let's be very clear. I am not talking about how people accept and cling to irrational beliefs. That actually makes an odd sort of rational sense. Think of it in terms of our ability to build serviceable models on incomplete data. Whether we're trying to figure out or in-laws or determine if our children love us, we're always building models composed of incomplete data. We then cling to the inherent phenomenology underlying them. It's the end result of our natural selection. After all, the cost of thinking a leopard is under that bush is enormously less than thinking there's no leopard under the bush when their is.

Nor am I talking about addiction, though we may end up talking about that as well. Addiction is a well characterized neurological phenomenon. It's not pleasant or rational but we (sort of) understand it.

No, I'm talking about  people can continue in a given course of action when it clearly, demonstrably, not being successful. You've all seen it. Somebody gets into a sticky situation and instead of stopping the behavior that got them there, they double down on that very same behavior. I'm thinking of this clinically. As a writer. After all, good characters need a healthy dose of self destruction.

How can people continue to do that?

Enter Prospect Theory.

Prospect Theory is the invention of Daniel Kahneman, who won the Nobel Prize for inventing it. It reformulates the decision making process in the form of risk analysis when the probabilities of outcomes were known. People tend to make decisions based on the relative weights of the risks of the wins and losses rather than the wins and losses themselves. The wights do not have to be equal. And they tend to be relative to a reference point where the balance of risk is considered equivalent.

One would think human beings would biased towards chance of gain rather than risk of loss. After all, we are the invisible hand, right?

Actually, it turns out that we are weighted against loss rather than towards gain. Consequently, we often aggressively increase the same behavior in the face of loss. Imagine a gambler who hits a losing streak. Which does he do? Try to break the streak-- in effect, gamble out of the hole-- or accept the loss and walk away from the table? Okay, guess on the count: 1! 2! 3! Go!

We see this all the time. Workers who have embraced a profession have trouble giving it up when the profession is lost or moves overseas. People cling to racial stereotypes ferociously when they think implied privileges or cultural heritage is threatened. People in marriages cling to the trappings representing when things were good. If I just do this, like I used to, the marriage will be saved. It is too terrible to face the risk of loss even though the possibility of gain might be negligible.

We see it in the political arena. One party or the other suffers a defeat and goes through soul searching. Inevitably, they come back to their central message: We must be exactly the same but even more! More conservative! More liberal!

I worked at a Very Large Computer Company back in the 80s. VLCC never really understood why it's products sold. One colleague suggested our salesmen were like cheerleaders around a rocket, saying "Go Rocket! Go!" and the rocket took off and their products sold and everything was right with the world. But when the microcomputer revolution happened, the stock crashed, the products didn't sell and the poor rocket lay shattered and broken in a crater. The salesmen kept trying their old techniques: "Go rocket! Go!"

I had a friend, Phil, when I worked at Small Aircraft Company. One week, when the value of the lottery was a couple of hundred million, there was a movement to buy a bunch of tickets together. It was sort of like a bunch of kids deciding to buy a share in an imaginary airplane. Phil was agonized over this. He was a mathematician. He knew the odds were as close to zero as to be negligible. Why, then, did he feel so compelled to buy a ticket. Eventually, he did buy one. He said to me, "It's not that I think we'll win. We won't. It's because I'd feel so bad if you all did win and I hadn't bought a ticket."

One of the reasons I find Prospect Theory so compelling is that it sounds so rational. But what it is really doing is evolving a mathematical model around irrationality. While the theory itself is perfectly rational, the weighting of risk found in observation is not. We tend to overvalue low probabilities and undervalue high probabilities. Which is another way of saying the lottery is designed for the mathematically challenged.

It gives an interesting development to character development in fiction. Writers always have to decide what the character wants and will risk to get it-- the princess must overcome obstacles to save the prince and the nature of the obstacles show the depth her bravery and strength of her commitment. Now, we need to look at this more closely. Now we also want to know if the loss or failure of not going might outweigh the risk of failure of going.

After all, Gimli said: "Certainty of death, Small chance of success... What are we waiting for?"

More on Prospect Theory:
Putin and the Crimea
Kahneman's original paper
Applications of Prospect Theory to Political Science
Evolutionary Origin of Prospect Theory

Sunday, March 2, 2014

Topics of Interest


(Picture from here.)

A lot of good stuff coming over the transom from Io9 lately. The picture left was derived from Googles partnership with organizations to create a deforestation monitoring tool: Global Forest Watch. The blue tends towards reforestation. Red tends towards deforestation. Norway, status quo. Sweden, much change.

Here's the first ever geological map of Ganymede.

These tunnels are beautiful. I especially want to visit the Guoliang Tunnel in China. I wonder what the accident rate is.

There's a good discussion here on how Kepler has changed our view of the universe. Just a few years ago there was no evidence for any other planets other than hope and optimism. But Kepler has given us an estimate there are on average 1.6 planets around every star in our galaxy-- or 160 billion planets. And that doesn't include free moving planetary objects.

Kepler also suggests that 22% of the sunlike stars in the Milky Way are Earth sized. That's about 2 billion possible planets.

There's company out there. We just haven't met them yet.

Original articles herehere and here.

Finally, here's a really good article on the similarity between the brains of dogs and humans. First, the study examined the area of the brain in both humans and dogs that responds to the human voice. Turns out they are the same. Emotionally charged sounds such as whimpering dogs or crying children caused similar responses in both species.

The study suggests that dogs are as conscious as human children. (Original NYTimes article here.)

There are two distinct possibilities, both of which are discussed by the authors. The first is that in the 100k years we've been associated with dogs and the 20k years we've been actively working with them, we've modified their brains to respond to us. This is, no doubt true. However, the authors think the data shows something different. They believe that these associations are much, much older. They speculate that the structures are common between humans and dogs and existed when primates and canids ancestry split-- about 100 million years ago.

If this is true and dogs are as conscious as children then it brings right to the forefront the whole "is conscious necessary?" argument. This discussion centers around is consciousness an artifact of general cognition, an unnecessary emergent property of the mammalian brain or a positive attribute selected for by evolution? The cons of consciousness are its metabolic expense and relative slowness to unconscious activities. The pros of consciousness selection are exactly the same: if it's so counter productive why do we have it? Natural selection would select against such extravagant expense if it wasn't useful.

But if it shows up all over in vertebrates the discussion narrows to: it's either a necessary but useless byproduct of mammalian brain or it has positive attributes that outweigh its expense. It seems that some of the bird studies of intelligence might be able to at least broaden argument to byproducts of vertebrate brains.

Which, to my mind, makes the argument fairly thin. I suspect that though some birds might have a cognitive level sufficient to support consciousness, I suspect that many do not. Whereas I suspect that there are many more mammalian species that can support consciousness. This is not purely chauvinism on my part. Birds and mammals parted ways long before the evolution of the neocortex and its equivalent in avians. The neural mechanism used for intelligence in the two groups is markedly different.

Add to that the tremendous limitations imposed by flight. Whatever birds have to do in their brains it must be in a small package. The expense of cognition and conscious must be justified by its utility and the expense for birds is much, much higher than for mammals. So if crows, parrots, etc., are conscious it must be advantageous for them.

Original article here.