Saturday, November 12, 2016

Ick, a failed blog.

Wow, what do I do with this thing?

Monday, March 21, 2011

A Nerdy Math Thing at the Airport

I was seated at an airport food court with my suitcase, backpack, a coffee and an orange juice. I wanted to walk over the diner and get some breakfast, but I already didn’t have enough hands to carry my suitcase, coffee, and orange juice (I struggled to get to the table without spilling anything to begin with), so I wouldn’t be able to carry the food, either.

I asked an old couple next to me to watch my stuff while I go get my food.

Is that rational? Is asking a stranger to guard (and not steal) your stuff any different than just leaving it?

To figure it out, I did some math.

First, we’ll need some variables and assumptions:


Tg = Probability of a random stranger to steal a guarded item
Tu = Probability of a random stranger to steal an unguarded item
D = Probability of failing to defend an item that you own
Ds = Probability of failing to defend a stranger’s item
N = The number of strangers encountered during the risk period

  • Tu > Tg. I’ll assume that the random stranger is less likely to attempt to steal something if it looks like someone is keeping track of it.

  • Ds > D. If you are guarding your own item, I assume you will more vigorously defend it than a stranger guarding your item.

  • T variables will depend on the desirability of the item. Is it a nondescript suitcase, or a laptop computer? It also obviously depends on the population of strangers.

  • D variables will vary based on the value of the item. If the thief steals a pen or a candy bar, he will probably not be pursued.

Let’s get started. We have the first base case. What if you just leave your item unguarded? In that case, each of N strangers has probability Tu of stealing the item. The probability of retaining your item is the product of the independent decisions of N strangers to not steal your item. Because we’re calculating risk of loss, we use “one minus” a lot of times, so here’s the formula:


With our numbers, the risk of loss to 100 strangers is approximately 1%. It goes up to 10% for 1000 strangers and 63% for 10,000 strangers. Maybe this sounds reasonable. It certainly sounds like a bad idea to leave your stuff lying around.

The other base case is that I just sit there and guard my item. This has two advantages. First, an attempted theft is less likely of a guarded item. (Ok, this is circular logic, since that was one of our assumptions, but if you disagree you can change the numbers.) The second advantage is that if an attempt is made, you have the opportunity to defend your item. Again, using our numbers for 1000 strangers, the risk of loss drops to about 5% due the assumption that an attempted theft is half as likely for a guarded item, and then to 0.5% for the 9 out of 10 likelihood of defending your item. The full formula is:


So what about my decision to trust a stranger to watch my stuff? For this we have a small probability tree. On one branch, we have an honest stranger, and on the other branch I actually chose the thief to guard my item (oops).

If you choose the thief to guard your item, you are sunk. In that branch, there is a 100% probability of loss. However, that branch only occurs with probability Tu. (Obviously, once you hand your item to the thief, we consider it to be unguarded.)

If an honest stranger is chosen, then the math is the same as when you guarded your own item, except that we assume the stranger will less vigorously defend your stuff than you would your own, so we use Ds instead of D:


Predictably, the risk of loss in that case is double (again because that was our assumption). (While it’s only relevant when N is small, we use N-1 because we’ve already picked one of the strangers as the guardian, so his probability of being a thief is already in the other branch.) The answer has to be multiplied by the probably of entering that branch (choosing an honest stranger to begin with) and then we add the probability from the “I chose the thief” branch:

Tu+((1-Tu)* (1-(1-Tg)^(N-1))*Ds)

That looks ugly, but it’s just iteratively applying what we’ve been doing. The first instance of Tu is implicitly multiplied by the 100% probability that the chosen thief will take your stuff.

Here’s a handy table for different values of N (using our initial numbers):



The decision about whether or not to trust a stranger depends mostly on your assumption that the stranger will adequately defend your item, and that a guarded item is less likely to be stolen. Since the individual probability that the stranger chosen is a thief is so small, it doesn’t factor into the decision much at all.

In all cases, trusting a single stranger is overwhelmingly better than leaving the item unguarded, because that is equivalent to trusting EVERY stranger. This should also be intuitively true.

It would be neat if there is any data out there for T and D. Has anyone done a study like this?

In real life, choosing a stranger to trust is not done randomly. We expect that we can improve on random chance by profiling. I chose an old couple that looked like they have enough of their own stuff. Even though there were two of them, they know each other and thus are not independent random samples. In fact, I expect choosing a couple is better because of social pressure to be honest. The fact that they were old probably reduces their ability to defend when compared with myself, but I didn’t think of that at the time.

The meaningful difference in probabilities between self-guarding and stranger-guarding must be up to you. Is not trying to wrestle with my suitcase, coffee, orange juice, and backpack , and a plate of scrambled eggs with hash browns worth the additional 0.11% risk of theft? I suppose it was, because that’s what I decided to do.

I told you it would be nerdy.


Options House deleted my comment

I posted a comment in this article in the Options House blog, and they deleted it.

I didn't think it was controversial, and while I don't remember my exact wording, my points were:

  1. Wow, their margin rates are now cheaper than my mortgage.

  2. That the rates are "not tiered" is kind of weird. Let's say you borrow $40,000 at 4.0%. That would cost you about $133 per month in interest. If you go up to $50,000 the rate drops to 3.0%, and your monthly interest drops to $125. That's a nice bonus for borrowing an additional $10,000. Is that how other brokerages do it?

  3. One interesting change is that the previous margin schedule used the Broker Call Rate as the base rate, but now they are using the Federal Funds Rate. (Here's where I find the current rates.)
  4. I wonder why. They also quote the Federal Funds Rate as 0.25%, but that's not entirely true. The Federal Reserve has a "target rate" which is currently between zero and 0.25%. According to the Federal Reserve Bank of New York today's rate is 0.15%. This rate varies daily based on actual interbank lending.

Now let's get controversial...

Interactive Brokers probably can't be beaten.

First of all, Interactive Brokers is still cheaper. I wasn't going to post this on their blog, but now I'm on my blog, so let's go. I can't link directly to their margin schedule, but go here and click on "Interest Charged to You." You will see their highest rate is currently 1.64%. Above the $100,000 tier, it drops to 1.14%, and it just gets more absurd from there.

If I was a carrier of margin debt, I would be at IB in a heartbeat. Options House can crow about how they're lower than their crappy competitors, but there is one good competitor that I'm certain they can't beat.

You can do better with options.

The other thing is that you can obtain better rates from the options market itself. I'll go into more detail when I'm not on a lunch break, but it's fairly easy to find a credit spread on an index (like SPX, or XSP) that results in borrowing money for a relatively low rate, even after paying the spread.

Let's say we do a SPX box spread. While I'm typing I can sell a Dec 2013 $3000 put, and buy the same expiration $2500 put for a net credit of $47,539.30. (Don't bother looking for these numbers. As soon as I typed it, it was out of date.) In 2 years and 9 months, when the S&P 500 fails to crack 2500, this spread will "lose" $50,000.

But look at the mechanics of receiving $47.5K now, and paying $50K in almost 3 years. It kind of looks like you borrowed $47,539.30 at an APR of about 1.8%. That's locked in for almost 3 years. Not bad.

You'd do better borrowing more. At some point a full box spread is cheaper, but that depends on the bid/ask spread and if you start using options that are close to the money. But that's all optimization. If I spent more than 5 seconds looking, I could probably do better than an unlikely-to-pay-off bear put spread. Deals can be found.


Friday, February 5, 2010

Tequila and Hard Drive Recovery

Don't ask me why I thought those things would go together, but that's how I spent my evening last night. It all started after another night of drinking a week ago with a friend of mine. After I had a few, he came out with the old, "you're good with computers, right?" Of course, against my better judgment, I said yes. I probably shouldn't have had that last beer.

His laptop wouldn't boot. A laptop used for business, a laptop that didn't have any backups. Or at least there were some backups for some of the files, but those were with his ex, and well, never mind. Let's say there's no backups.

I'm a sucker when it comes to friends with computer problems. I also like to fiddle with stuff, and always like a challenge. And since I had abandoned my family in the Dominican Republic, I had some time on my hands, so I took the case.

The computer wouldn't boot. It froze while the Windows XP splash screen was fading in. In safe mode, it stopped responding after loading agp440.dll. There's nothing safer than safe mode, so I knew I wasn't going to get anywhere with that drive installed.

I swapped the hard drive to another laptop, and it had the same symptom, so that ruled out the motherboard, memory, and everything else that's not the hard drive. Just for completeness, I put my hard drive in his laptop, and it booted up fine. So nothing in his computer was broken. It also installed a bunch of drivers specific to his system before I could tell it to stop, so now my laptop is kind of hosed. I still can't get sound to work. Oh well.

I decided I can't do jack unless I can mount the drive as a secondary (non-boot) drive, so I ordered a USB drive enclosure from Newegg. Presumably, I'd be able to just yoink the files off the drive, and be the hero.

4 days after I ordered the hard drive enclosure, it arrived, and I hooked everything up. Getting ready to start the copy and relax with some Mythbusters, I poured myself a margarita.

Not so fast.

"The file or directory is corrupt and unreadable." That was unexpected. Something fundamental like the partition table was broken, so it didn't even show up as a valid drive. Linux wouldn't mount it either. The margarita was good.

I wondered if the drive enclosure was bad. I put in my hard drive and it failed in just the same way. Damn. Four days waiting for a bad USB enclosure. Now I've got to start all over again. Another margarita would numb the pain a little bit.

I tried a third hard drive, and it worked. After a bunch of fiddling, I realized that if I don't reboot after connecting the bad drive, Windows thinks all drives in the same enclosure are bad. After rebooting, all but the problem drive work correctly in the USB enclosure. That's a relief, but the drive still doesn't work. About now, I'm running out of margarita mix, so I make the next one 50/50 instead of 1:3 like I'm supposed to. It was still good. Definitely more tequila flavor that way.

The drive wasn't physically damaged, so I knew the data had to be on there. But without the benefit of a file system, I started looking for a program that would scan the entire drive and look for files.

I found a program called "Get Data Back," and it does what it says. (Maybe they'll become a sponsor.) I downloaded the demo, and told it to scan the drive, and it started reporting how many files it found. (Plenty.) I left it for the 30 minutes it asked for, and came back surprised to see not only had it found the files, but it had all the file names, and had reconstructed the original directory structure. And it allowed me to open all the files and look at them, so I opened a bunch of random documents and sure enough, everything was intact.

If I wanted to restore all the files, though, I had to pay the license fee. $79.00 Ouch. I sent an email to my friend. "I found your data, but getting it back will cost you." I briefly considered how long it would take me to save the files one by one. If only 10% of the 200,000 files were important, then about 27 hours if I could do a file every 5 seconds. Not worth it.

Another 50/50 margarita to polish off the margarita mix, and I'm off to bed.

But I stopped short. Not content to give up so easily, I decided to look for a free solution. I tried "PC Inspector File Recovery," which was highly recommended on the interwebs, but did not work as well. It found half as many files, and none of them had file names or directories, and they were all suspiciously the same size. I had very little confidence that it was working, and searching through 10,000 files named file12345.doc to find a particular document was not appealing.

Out of mix, I had one last tequila. Yow, straight tequila is rough, even after a string of margaritas. It wasn't up to me whether to pay for the software. Maybe he didn't care that much for his old files, so I went to bed for real this time. I slept pretty well, too.

Ultimately, my friend decided that his data was worth the ransom, so he bought a license for Get Data Back and sent me the registration code. At once, it started dumping his files onto my hard drive. I probably would have felt smarter if I could find a way to do it more cheaply, but in the end that's kind of stupid when the problem is already solved.

I don't know what the point of this story was. I like recovery tools that work. And I'm getting used to the taste of tequila, too.


Saturday, January 30, 2010

Bond prices and wireless phone minutes

This is likely to be my nerdiest post yet. I'm going to claim that the market for wireless phone minutes is like the bond market. Let's see how that goes.

Like most folks who begin to learn about investing, I used to have trouble with the notion that bond prices are inversely related to yield. I always thought, if yields go up, shouldn't bonds be more valuable? I finally realized that they're talking about old bonds. Duh... why didn't you say so? So now I get it. That old crappy 4% bond I bought yesterday is worth less, because you can get that shiny new 5% bond for the same price today.

I never thought I would mark to market my prepaid cell phone minutes, though.

All my posts seem to be pimping a product. I don't mean for it to turn out that way, but oh well. Today's is Page Plus Cellular. When I was tired of Verizon ripping me off (the latest thing was charging me for data I'm not using), I looked for a prepaid service. Bonus points for one where I can use my same phone. Page plus was it. I could get my minutes for about 6 cents (cheaper than every other prepaid provider) and my wife could get unlimited calling for $40 per month.

For my phone, I plunked down $80 for 1400 minutes. (Buying the highest value refill is how you get the cheapest minutes. I expected those minutes to last 7 months.) In those days, if you put $80 on your account, they credited you for $84. That way, you'd actually get 1400 minutes at 6 cents per minute. So actually, minutes were about 5.7 cents.

Four months later, I'm using even fewer minutes than I expected. I still have $62 on my account. Then they go and lower their price to 4 cents per minute.

That's great news, but the minutes on my account cost 6 cents, still. Why? Honestly I don't know. But now I know that those 62 dollars in my account are not worth $62 anymore. Those 62 dollars can buy 1033 minutes, but someone buying new minutes with $62 will get 1550 minutes. (Actually, they have to buy 2000, but you get my drift.)

How much is my 62 dollars worth? Enough to buy 1033 minutes at 4 cents each. $41.32. Hey, that's just like inverse bond pricing. The "yield" of minutes per dollar went up, so the value of my account went down.

The surprising thing is that when Page Plus lowered their minute prices, I actually lost money. There's no point in thinking that I'll just use up my minutes at 6 cents each. That's just mental accounting. My minutes are not worth 6 cents, because each one I use will be replaced for 4 cents. That means what actually happened is when they lowered their prices, my account lost about $21.

That's sort of like interest rate risk. I bought up all these minutes thinking they were a great deal, and then the deal got even better (for people that hadn't bought any yet).

When will I not care anymore? Well, the "maturity" of my wireless refill is whenever I run out of minutes at the 6 cents rate. At the rate I'm going (about 100 minutes per month), it will be another 10 months before I can enjoy the new lower rates. 11 months after the rates actually lowered.

That's weird.

Just about as weird as bond prices.


Thursday, February 12, 2009

The government doesn't owe me a job

I have a job. I guess that means I'm among the lucky 92.4%.

The reason I have a job is that I have a skill that someone will pay me for. If that changed, then I would join the 7.6% who are currently unemployed.

My number should be up soon, Nancy Pelosi says that every month 500 million American jobs are lost. That means I've got three weeks, tops. Then again, politicians shouldn't be expected to tell thousands from millions, or even billions, with the kind of stimulus figures that get thrown around Congress these days. What's a couple orders of magnitude between friends?

But I digress. If I couldn't get paid for what I do, the only thing I could do is turn to the government, right? Ha! Not this libertarian. I'd starve to death before asking the government to steal from my neighbors. (Where do you think the government gets the money?) Just to show you why I don't want or need a safety net, let me run down some of the things I might try if my employment were negatively affected.

  • If my job was on the line, the first thing I would try is negotiate for reduced pay for reduced work. Because I live within my means (30% of my income is directed toward savings) I could at least live with that much less and live the same lifestyle.
  • Of course, no matter what, I would reduce unnecessary costs. Goodbye cable TV, thermostat down, sell one car, cancel the gym membership, reduce cell phone minutes, and cook at home more often. I'd probably keep the Internet access and Netflix as long as possible, but that would go if it keeps the mortgage paid.
  • Unemployment insurance. Yes, private unemployment insurance is not expensive, and if I lost my job, this would be my first line of defense.
  • I could become an auto or motorcycle mechanic. In this poor economy, people are not replacing their old cars with new ones, and the repair business is up. I can follow a diagnostic flow chart, and use basic tools. I could probably start as an apprentice right away, but it would probably help to get some education and certification. Good thing I bought unemployment insurance.
  • I could teach Spanish, thanks to my Dominican wife. Or I could teach English to Hispanic people. I could teach English overseas, too. Japan, for example, ships in native speakers to teach English in school. I've heard they pay well, and take good care of you. It would suck to be away from my family, but at list this would support them.
  • I could tutor. There's always kids that need help, and their parents will pay to keep them from falling behind in school. If I was willing to put in the effort, I could become a real teacher. It would take a lot of frugality to survive the half dozen years of education and training it takes to become a teacher, but I doubt the education industry will be going away any time soon.
  • I could be a handyman. I fix stuff around the house all the time, I'll bet someone would pay me $50 to fix their electric range instead of paying $400 for a new one. Maybe I should ask for $100. I can come to your house and change the oil in your car, or paint your dining room.
  • I could become a real handy professional, like a licensed plumber or electrician. I'd lean toward electrician, because electricity speaks to me more than pipes, but if the demand was for plumbers, I'd be a plumber.
I am a software engineer, but I don't see any of these jobs as beneath me. If no one will pay me for software engineering, then that means I have to find something else of value that I can offer to society. If no one will hire me to do the job, it means that the job doesn't need to be done, or someone is already doing it. And this list is not hypothetical, these are things I would really do if I needed food on the table. Everyone thinks (government included) that when you're out of work, you have to get a job doing the same thing you were doing before. This is the same reason that we should feel bad for buggy makers when the automobile gets invented. Look at all the jobs lost.

You see, it's not about having a job. It's providing value. That's why we have money, to measure the amount value you provide. And there's nothing that says you are entitled to a job doing what you want, or what you did before. But if someone hires you, it's because they think that's the best use of their money. Isn't that better than government pity?


Sunday, February 8, 2009

The Motley Fool has jumped the shark

Act now! A chance of a lifetime! The secret that will make you rich!

Is this the latest infomercial? House flipping or selling time shares? Or one of those "work at home" ads stapled to a telephone pole?

No, it's the friggin Motley Fool!

I had some respect for these guys. In a world of get-rich-quick, and secrets of day trading, these guys tell you about index funds, and diversification, and the way that patient investors build wealth slowly and reliably. Sure, they'll tell you that this stock is better than that other stock, but it's usually backed up by some research into the company's financials, market changes, and whatnot. Overall, pretty respectable.

Now, every week I get an email from them about the one stock that's poised to pop. 3800% returns could be mine if I just knew. "Sign up now for this $169 newsletter, and we'll make you rich!"

Seriously, dudes. You're just like that timeshare guy on TV. If you've got such a sure thing, then milk it, and don't worry about your subscription revenue. You should be rolling in dough with your weekly 3800% secrets.

I'm conflicted because I read the damn site every week, and all of the analysis and advice seems good, but then I get these desperate pitches that look like they're on their last dime, I worry. Why the hard sell? Why can't we share investment advice without looking like a bunch of used car salesmen?