Friday, July 31, 2009

How to power a frisbee

I was wondering the other day how a free standing object like a frisbee, or a rotating space station, can be made to spin (where it counts) at variable rates in an efficient manner. By "variable rates", I mean that the thing can be made to spin fast, then slow, and then fast again, for example. By "an efficient manner", I mean a mechanism that doesn't cause significant mass loss and which therefore conserves the angular momentum of the whole system.

So the idea here is that if there is one component of the thing that's spinning in one direction (the outer hull of the frisbee) then there must be another component spinning in the opposite direction (e.g. an internal flywheel). If you use only one internal flywheel, then the only way to slow the rate the spinning is to slow the internal flywheel's spinning by braking against the outer hull that is spinning in the opposite direction. A better solution (no doubt already discovered by some gyro tinkerer from the 18th century) is to use 2 flywheels: instead of having to change the magnitude of the spinning, you change the orientation of the flywheels. Here's how it works.

The schematic is a side view of the contraption. At the center of the device we have an "engine" from which 3 arms extend. One arm is fixed to the engine and represents the thing that is to be spun (labeled "power train"): the engine will spin along with the thing it's spinning. The other 2 are affixed with identical flywheels at the ends and spin along the axes of their respective arms.

The engine controls the rate of rotation of the "power train" by two means: one, by controlling the rate at which the 2 flywheels spin, and two, by changing the angle between the arms of the flywheels. (The 3 arms always lie in a same plane relative to each other in, as we shall see, the rotating reference frame of the engine).

Using those 2 levers of control, we may employ a variety of strategies to make the "power train" spin. For example, starting at rest (top figure in drawing), we can arrange the arms of the flywheels (initially not spinning) along a straight line perpendicular to the power train (shown horizontally in the figure). The engine could then expend energy to make the two flywheels spin in opposite directions in such a way their net angular momenta cancel each other. So in this configuration as the engine stores rotational energy in the flywheels, the engine and its attached "drive train" remain at rest.

After the flywheels each have absorbed a sufficient amount of kinetic energy, their angular momenta can be transfered to the power train by drawing the arms attached to the flywheels inwards--towards the engine and therefore the axis of the power train arm. The two arms of the flywheels, each subtended at an equal angle from the horizontal, induce a rotation on the engine and the drive shaft (power train) it is affixed to such that angular momentum of the whole system is conserved (see lower figure in drawing). (Given the initial conditions of our example, the angular momentum of the whole system adds up to zero.)

For a frisbee, of course, some of the angular momentum would be dissipated into the environment (the surrounding air) in order to create lift. So in a real application, the angular momentum of the whole system is not conserved. Nevertheless, the same principles can be applied. To get a better appreciation of the dynamics of the system, it would be instructive to look at the system's Lagrangian--which doesn't seem too complicated. That's a task left to the reader or a later article.

So why do I think this is interesting? Mostly because it avoids using gears and such for directing rotational motion: instead, it uses inertial forces. Compared to the teeth of a gear, for example, inertial forces can be more evenly distributed over a larger volume of material. This suggests we could achieve greater acceleration (or deceleration) for spinning the outer of hull of our hypothetical frisbee: the achievable angular acceleration is more likely bounded by the structural limits of the whole system, than by the limits of some small component of it (e.g. a tooth in a gear).

Saturday, July 18, 2009

On health care reform

Over decades health care costs have been rising at unsustainable rates. While the need for change is intuitively obvious, the actual remedies are not. Lacking a proper, more or less unified conceptual foundation upon which to articulate their arguments, the proponents of reform seem to be outsmarted, outmaneuvered by the defenders of the status quo.

The status quo has an economic theory and model to draw on--or defend, as Stephen Colbert once critiqued proposals to better regulate the financial industry: "After all, I have an economic theory to defend." The proponents of change, I believe, lack the language and conceptual tools to counter much of this laissez-faire bunk. Meanwhile, some on the right even argue that there really isn't any problem, that rising health care spending is a natural consequence of greater prosperity.

Take Andrew Briggs of the American Enterprise Institute, for example, who drives the point by comparing health care spending for people vs. pets over the last two decades. He observes the two categories of costs have been growing at roughly the same rate, and that pet health care expenditures are more discretionary than expenditures on humans because a) we value our own lives more than those of our pets, and b) pet care costs are out-of-pocket expenses (little to no insurance for pets). Using this relative priority scale in consumer decision making (should I spend the money on myself, or my pet), Briggs makes an implicit logical leap to conclude that pet health care spending is indeed discretionary, and if consumers are spending ever increasing amounts on their pets, then the onus must be on the consumer to spend less, not on the [pet care] industry to provide more affordable health care. And the reader is left to conclude that indeed the same relationship between the consumer and the general health care industry must also hold.

Such laissez-faire arguments ignore the reality that health care spending is generally non-discretionary. Health checkups, for example, are a necessity, not a choice. In fact, using a similar (fallacious) argument, one could argue that a responsible parent's health care spending on themselves is more discretionary than their health care spendings on their children; so what? that doesn't make the parent's health care spending discretionary. Using the same data Briggs uses, one can plausibly infer the opposite conclusion: neither of the health spending categories (pets or humans) is discretionary.

At any rate, health care costs cannot continue to eat into an ever increasing slice of the GDP pie. The situation is clearly untenable. At some point, the health care slice of the GDP will become so large that our other industries will become globally uncompetitive. At that point (if we haven't already crossed it), we will either be net exporters of health care (hard to imagine), or we will be facing some sort of economic malaise.

From an economic theory perspective, the laissez-faire-do-nothing camp of the health care debate is armed with a well-articulated, widely understood, and widely applicable, market driven economic model. The proponents of health industry reform, by contrast, seem to lack a solid, articulated economic theory or model to base their reforms on. I wonder whether the difficulty in articulating the message for reform stems from a lack of public understanding about how certain industries do not fall neatly into the unregulated, market driven model (e.g. law enforcement, public utilities, roads).

The proponents of change need studies to buttress their arguments, but tellingly, there's a paucity of such research. Simple facts, like the inflation rate for the cost of stitches for ordinary cuts requiring emergency room visits, or the inflation rate for the cost of casting a broken arm, are hard to come by. Concentrating on the cost structure of clear, "simple," everyday services that have remained largely functionally unchanged over the decades might crystallize the message for needed reform. In any event, the message for change is muddled: it is intuitively obvious that we need it, but we lack the popular concepts to express and defend that need.

Where are the studies showing the in inelasticity of demand in the face of rising health care prices? Where are the studies showing the breakdown of the health care market's pricing mechanism? (I imagine this would involve an analysis of how powerless health insurance companies are in controlling costs, except for the cruel and crude ax of denying coverage.) And who would fund such research?

I am a bit befuddled by the health industry's adolescent-like stance in the debate. Surely the big players must realize it is in their long term interest to be proactively involved in shaping policy and reform. Surely they understand that postponing reform will only make future reforms even costlier, that the longer they wait while the national health care crisis simmers, the more onerous will be the regulatory attempts to fix the system. Instead we have a political class beholden to a health care industry that is largely happy with the status quo--a status quo which, under the laws of gravity, cannot stand.

Here's how I'd try to frame the reformist platform.

1. Fund studies into the breakdown of the market mechanism in the health care industry and establish a language and popular nomenclature for this breakdown. Taking exception to pure, free market thought is no small undertaking and requires a solid, yet easy-to-communicate conceptual framework for why the status quo needs fixing. (Take our anti-trust laws as an example.)

2. Establish the idea of a "right" to basic health care, and delineate the boundaries where this "basic health care" ends.

3. Propose offering "basic" health care insurance from the government. (Usage of the expensive GE Omnigotron machine that'll keep you alive for another 2 weeks is not covered.)

4. Phrase the concept of a government run insurance plan as a mutual insurance scheme, where the interests of shareholders and policyholders are aligned. (There's a lot of meat in considering and contrasting the business models of public and mutual insurance companies , I think.)


But the first step on the way to change has to be winning over thinking minds. And hence the need for a new language to crystallize the dialog.

Monday, November 3, 2008

The Little Depression

If we do get an economic depression, and there are signs aplenty that we will, it will be short lived.

That's my crazy investment thesis. When I search my feelings, I cannot see how a protracted depression is in the cards. (Yes, that's how I imagine I decide things: the mind leads the gut, but it is the gut that ultimately [thinks it] "knows".) So what after-the-fact arguments do I have to support this view?


The Velocity of History

The obvious is easy to overlook. History unfolds, unwinds, at an ever faster pace. The dynamism of the world is incomparably greater today that it was some seventy years ago. The rise and fall of actors on the world stage has been both amplified and shortened. The rise of new corporate titans such as Google, and Microsoft before it, is historically breathtaking. And so is the fall of the once mighty.

So if things get bad quickly, then likely they wont stay bad for as long as they did last time.


The Information Currency

Imagine we're in a depression. I wont bother describing how horrible things have become (no job, no credit, foreclosures and soup kitchens). Still, does the internet still work? Do cell phones still work? Do airplanes still fly?

Of course everything will still work. We wont somehow fall into the dark ages--at least not from an economic calamity. No, the better question is "Will these things still be plentiful?" If the cell phone owning homeless of today are any guide, then the basic communication tools will remain around even in the hardest of times.

Now imagine how trade could possibly come to a standstill. Retailers have gone bust, distributional channels are somehow broken, and producers have no efficient means to meet consumers and sell their goods, so prices plummet driving even more folks out of business.

I submit that was the real cause of the Great Depression: a breakdown in distribution channels. That the failure of distribution channels was caused by financial mismanagement is a side issue. The point is "If we can somehow avoid a systemic failure in the distribution of goods and services even in a crippled financial regime, then the economic rebound will lead the financial rebound; not lag it."

Todays communication tools (most notably the internet) make it easy for producers to meet consumers. The new distribution channels (think eBay) are efficient, many, and resilient. It is hard to imagine how these can disappear. Ultimately, that back door through which consumers and producers can meet will alway be open.

If capital is not just a store of wealth, but also a "signal" that allocates resources to a purpose, then information too, when it reaches a certain "critical mass", acts as an agent that repurposes and reallocates resources. The big difference between now and seventy years ago is that we can find each other.


Positive Black Swans

And lest we forget how improbable predictions generally are, let us enumerate a number of technological game changers that might lift human economic activity. Odds are there will be a game changer; moreover, it'll likely not be any mentioned here.

  1. Clean, cheap energy
  2. Quantum computing
  3. Mind/machine interface
  4. Stem cell and tissue regeneration
  5. Cognitive enhancers (drugs)

Friday, October 24, 2008

On Black Swans, Greenspan, Markets and Leaders

I read Nassim Taleb's The Black Swan some time ago. It is a wonderful, clear-eyed view of the world as you have not seen it. It is mostly about debunking what we think we see. If you haven't read it, have an analytical bent and enjoy ruminating over financial/economic theory, then this book may be for you. If I had to sum up the book in a nutshell, the basic message would be that most everything you hear from the so-called experts in the field of finance and economics is based on flimsy science, and the pseudo logic of mathematical models that are removed from reality. No wonder, then, that Taleb's ideas are in vogue these days.

Which brings us to Alan Greenspan's testimony to Congress, yesterday. Here we had the former high priest of economics (some would have him a demi-god), the father returning from retirement, the leader in whose wisdom we trusted (e.g. I don't know what he's talking about, but he does speak with authority and exudes confidence in his understanding of the wheels of finance and economics), the one whose steady hand had guided us through many a crisis before, this guy.. here we had this guy say that the current credit crisis had rocked (or in his own words, "shocked") some fundamental precepts of his world view, that he could not have seen the problem coming given that world view, and admit that he no longer thinks he understands how the world works.

On first hearing that admission on video, I let out a silence gasp. Moments later, I became aware that I had gasped. I wondered what had startled me about his testimony, but as I searched my feelings I could not come up with a why? Mr. Greenspan hadn't said anything I hadn't already known: I have never believed anybody knows how things in spheres of human affairs, such as in finance and economics, really work. But as the committee members proceeded to attack the fallen angel, the reason behind my instinctive recoil became evident.

The average committee member is not a financial genius: often, that is abundantly clear from the tenor and incoherence of their questions. Rather, they rely on the very same actors they are supposed to oversee for constructing an oversimplified, conceptual view of world finance they can understand. The believers (the ones who favored the facility of belief over the rigor of reason) were feeling betrayed by the priest who had lost faith. They were now rudder-less. They were mad to find out the priesthood had disbanded, and they lashed out at the poor 82 year old governer.

And it was not just the committee. The stock market too seemed not to like hearing Greenspan admit he couldn't understand how things had come to this. Yes, the market, with all its sophisticated actors, it too needs a high priest, something, someone to have faith in.

The old order is clearly gone. Ironically, the new order that will replace it will be founded on faith, too.

It may be that Greenspan's successor Bernanke has largely made the right decisions in this crisis. However, big crises summon leadership. The human collective is at its most irrational at such times. The voice of reason is inaudible; the voice of faith and hope is--the voice of a prophet. Mr. Bernanke's temperament is ill-suited to the task right now. But he might as well try. Perhaps he should make an about face, abandon the new openness that has diminished the Fed's mystique, adopt the old terse language of the priesthood that can be endlessly reinterpreted, and shepherd a new faith and thereby reestablish trust.

Monday, September 22, 2008

On the Markets, US Dollar, and Inflation

I hadn't planned on prognosticating on the financial markets here, in my journal. These are unusual times, however, and I have been entertaining unusual thoughts lately. But first a little about where I'm coming from..

Background: Trading Activity

I play mostly individual stocks, and luckily (for me, that is) I have been on the right side of the recent market action. I've been in the market for over 20 years now. I first started as a broker on wall street where I became good at selling mortgage backed instruments (CMOs) and such derivatives as "residuals". Actually, no. I wasn't good at selling them; I was good at explaining how the pricing model was supposed to work. I made okay money, but a year or so after the crash of '87 (my best trading day ever), my interest wandered back to painting and I left the business shortly thereafter. I was young, and had yet to try many other things. Through it all, though, I've always had skin in the market.

Over time, I have developed some trading/investing habits. I summarize them below.
  • Whatever the overall strategy, it has to be simple to execute. This means, for instance, that I wont consider a trading strategy that involves anything more than a few trades a day.
  • I generally prefer to be market neutral: that is, I like to hedge my long positions with short positions in other stocks.
  • I like to maintain anywhere from 6 to 9 positions at any one given point in time. This policy does a few things for me. One, it helps me focus on what I believe are the best opportunities by narrowing down on a few. Two, it makes following the news that I have exposure to easier. Three, it makes trading the positions easier. (Trading 20 different stocks is considerably more challenging than trading 3.)
  • I prefer to speculate on medium term trends: 6 months to 2 years out. I will not enter a position for which I have no medium term prognosis.
  • I trade around core positions. I do this in an attempt to increase profits while minimizing my average downside exposure over time.
  • I accept that to win you must also prepare to lose.
  • The only number on the screen that matters is the one on the corner: your account's value.
  • I begin everyday with one mantra: "I don't know anything; I'm just a speculator in search of an edge."
Inflation or Deflation?

What's the nasty end game? That's what everyone is quietly wondering.

Will the dollar plummet, as in the unraveling of an elaborate confidence scheme to which foreign traders of goods and capital are just waking up to? Or will the dollar plummet as the treasury prints more money to stave off a financial crisis which itself was a product of another credit bubble? Or does the master plan (the one nobody knows about but which is written in stone) involve cheating our creditors by wiping off the real value of all this toxic debt with an inexorably steady dose of inflation?

Or is deflation in the cards? The US government does not print money; it doesn't have to. The world's creditors run to the protection of the one "true" thing they still believe in, the US dollar. Economic activity contracts in the developing world and takes the emerging economies down with it. Unemployment rises, interest rates fall, and the treasury finds yet more willing foreign buyers for Treasury debt. And the currency confidence scheme of international trade and national current account deficits continues.

Turning and turning in the widening gyre
The falcon cannot hear the falconer;
Things fall apart; the centre cannot hold;
Mere anarchy is loosed upon the world..
-W.B. Yeats

The future, it seems, can have both outcomes in the cards. For now, while fear is in charge and world markets price in economic contraction, deflation is the theme of the day. As a horrible as it might get, we will eventually meet our demons, and fear will first be replaced with ambivalence, before greed's comeuppance. Somewhere along that path, I expect inflation to rear its nasty head. I hope it doesn't, but a dollar is an IOU, and that's what happens to IOUs issued by borrowers who can't balance their books.

Friday, July 18, 2008

A more efficient shorting tactic?

The recent SEC curbs on shorting a select list of financial stocks got me thinking about ways to avoid these silly procedural rules. I was short some of these financials, and in deciding whether or not to cover, I had to also consider the fact that I would likely be unable to short the stock again.

I called my broker, and they confirmed my suspicion: there was no stock available for shorting--for the time being. I asked whether it was likely that my short position might get called away--that is, that I might be forced to cover: highly unlikely, was the answer. I described my predicament (a juxtaposition of fear against greed), that I wanted to cover (fear), and still keep the borrowed shares around for shorting later (greed), and they said there would be no guarantee that there'd be any more shares to short after I had covered. How about if I bought the stock in my long account, didn't touch my short account, and later sold the shares in the long side of my account? I suggested. Can't do that either, they said. Once I bought the shares on the long side, they would be in a boxed position, and I would not be able to sell any more shares. I thanked the broker and hung up.

The solution to my problem had already presented itself in that last question. All I had to do was to go long the shares in another account I own at another broker: the combined account positions could exactly offset each other, and I would be able to later return to a net short position simply by selling the shares in the long account at the other broker.

I doubt the procedure described here is illegal, [ Ignorantia juris non excusat warning and other usual IANAL, IANAIA disclaimers go here], and if it is, I certainly couldn't find anything about it on the web. (Truth be told, I didn't ask either of my brokers: I had heard enough stupid "No"s for one day.)

My solution to this short term problem, created by a seemingly capricious regulator, led me to consider its more general application. For the regulator, by making shorting difficult, has created artificial scarcity. A short position, then, by virtue of its scarcity, must have more value than its nominal value. How much more?

Let's call this double account tactic, where your long shares in one account are exactly offset by your short shares in another account, an open boxed position. I suggest the scarcity value of a short position might somehow be connected to the cost of money (e.g. as employed in the Black-Scholes model) required to maintain an open boxed position in the same number of shares. I say "somehow", because while I can easily quantify how much it's currently costing me to maintain my open box, there is no general way to determine what it might cost another person (the cost of borrowing shares varies from broker to broker).

To put it another way, I suggest an open boxed position is a store of all the regulatory overhead associated with shorting. A speculator wishing to short hard-to-borrow shares, must consider both price movement and the availability of shares to short in the timing of their trade. It is a well known fact that open interest tends to increase at price peaks, making shorting at the best price a double challenge. This puts the short trader at a tactical disadvantage to the long trader. In order to mitigate that disadvantage, a speculator who plans to short shares at, for example, some future higher price might build a (net neutral) open boxed position, to be unboxed (net short) at a future time when the price or trend is right. In building the open box position, you are satisfying all the regulatory overhead of shorting ahead of time (whether that overhead is the requirement that your short never be naked, the now defunct up-tick rule, or some other silly red tape impeding your ability to short at the precise time of your choosing). Alternatively, as described at the beginning of this post, a short position can evolve into an open boxed position.

That you can easily skirt the intent, if not the letter, of regulatory restrictions designed to impede shorting is a testament to the fact that shorting is a natural, organic outgrowth of market activity. It is not an activity born of the invention of some new fangled derivatives instrument; rather, people have been shorting stuff for centuries. So I guess it shouldn't surprise us if we later find that the new SEC curbs on shorting only worked temporarily. The market always finds ways to correct artificial scarcity.

Sunday, July 13, 2008

Differential equation estimating the distribution of primes


Let me begin with this disclaimer, first: though mathematically trained (physics background), I am not a mathematician. OK, got that out of the way.

*

I have found a simple way to derive Gauss's estimate of the prime density function using probability heuristics, alone.

Background

Excerpt From MathWorld: http://mathworld.wolfram.com/PrimeNumberTheorem.html

..
In 1792, when only 15 years old, Gauss proposed that pi(n), the prime density function

 pi(n)∼n/(lnn).

Gauss later refined his estimate to
 pi(n)∼Li(n),

where
 Li(n)=int_2^n(dx)/(lnx)

..

I have not seen a simple derivation for this estimate, and if it exists, I am surprised why it is not more widely used in expositions on the subject of the distribution of primes. What follows is a very short argument based on a probability model. According to this model, we'll find that the distribution of primes is governed by a delay differential equation of the form

Q'(x) = - Q(x) Q( √x ) / x

which has a solution

Q(x) = 1 / 2 ln x

Anyway, to me, what's interesting is how using some specious probability arguments about the distribution primes I was able to set up the equation and try a test function inspired by Gauss's estimate to solve it. This hints at something more meaningful in my Clouseau-esque accident.

The setup

The setup, I have come to find, is similar in spirit to Harald Cramer's probabilistic, heuristic arguments for estimating of the distribution primes (the difference here being that we don't use any other results from number theory). Here it is..


Equ. 1:
The joint probability of a randomly chosen positive number n not
being divisible by two relative primes p and k is (1 - 1/p)(1 - 1/k).

Equ. 2:
Define Q(x) = (1 - 1/p)
taken over all primes px.

Equ. 2a:
The joint probability of a randomly chosen positive number n not being divisible by any prime px is Q(x).

Using Equ. 2a, vigorous hand waving, and a pinch of salt, we can say

Equ. 3:
The probability that a randomly chosen positive number x is a prime is Q( √x ).

What we're saying here is that for x to be prime, it suffices to show that it is not divisible by any prime less than the square root of x. Equ. 3 says that in the neighborhood of x, the 'average' distance between primes is 1 / Q( √x ).

Now the d.d.e. above comes from trying to approximate Q(x) using this probabilistic model. The idea is to use that approximation in order to estimate a prime counting function:

Q (√x) dx

But we don't have an analytic expression that approximates Q, yet. Instead of setting up an integral equation, we try a differential approach. Consider the change in Q as x passes over 2 very large consecutive primes p1 < p2:

ΔQ = -Q(p1) / p2 ~ -Q(x) / x
Δx ~ 1 / Q( √x )

Dividing the top equation by the bottom one, you get

Q'(x) = - Q(x) Q( √x ) / x

the d.d.e. I described above.


The solution


I had read somewhere how the 15 year old Gauss had been able to come up with his logarithmic integral for estimating the number of primes less than n. Was his integral inspired by a similar probabilistic argument? Maybe, but googling it, I couldn't find much. So, I plugged in C / ln x and solved for the constant C (=1/2).

Q(x) = 1 / 2 ln x


Does it mean anything?


I suspect it might, which is why I posted it. I did a bit of cursory reading on the topic, but alas, I'm an amateur. My claim that

Q(x) = ( 1 - 1/p) ~ 1 / 2 ln x

does not agree with Mertens' asymptotic formula (1874)

( 1 - 1/p) ~ exp(-C) / ln x,

where C is Euler's constant.

Still, there's something here that piques my nose. My result, when plugged into the prime counting integral, agrees exactly with Gauss's estimate:

Q (√x) dx ~ (1 / ln x) dx
What do you think? Is this interesting, or is this old?


7-09 Addendum: Interestingly, if we adjusted the model so that
Q'(x) = - Q(x) Q( x1/n ) / x

then Gauss's estimate would still hold for most n. It's as if the forward distribution constrains that back distribution.