Random Walks

One blog I follow is GÖDEL’S LOST LETTER

In the post Do Random Walks Help Avoid Fireworks, Pip references George Polya’s proof that on regular lattices in one and two dimensions, a random walk returns to the origin infinitely many times, but in three dimensions, the probability of ever returning to the origin is strictly less than one.

He references a rather approachable paper explaining this by Shrirang Mare: Polya’s Recurrence Theorem which explains a proof of this matter using lattices of reisistors in an electrical circuit analogy.  The key is that there is infinite resistance to infinity in one or two dimensions, but strictly less than infinite resistance to infinity in three dimensions.

This is all fine, but there is another connection in science fiction. In 1959, E.E. “Doc” Smith’s The Galaxy Primes was published in Amazing Stories.

Our Heros have built a teleporting starship, but they can’t control where it goes.  The jumps appear long and random.  Garlock says to Belle:

“You can call that a fact. But I want you and Jim to do some math. We know that we’re making mighty long jumps. Assuming that they’re at perfect random, and of approximately the same length, the probability is greater than one-half that we’re getting farther and farther away from Tellus. Is there a jump number, N, at which the probability is one-half that we land nearer Tellus instead of farther away? My jump-at-conclusions guess is that there isn’t. That the first jump set up a bias.”

“Ouch. That isn’t in any of the books,” James said. “In other words, do we or do we not attain a maximum? You’re making some bum assumptions; among others that space isn’t curved and that the dimensions of the universe are very large compared to the length of our jumps. I’ll see if I can put it into shape to feed to Compy. You’ve always held that these generators work at random—the rest of those assumptions are based on your theory?”

Garlock is right – this is a three dimensional random walk and tends not to return to its starting place, but James is wrong when he says this isn’t in any of the books.  Polya proved it in 1921.


How are non-engineers supposed to cope?

The Central Vac

Today the central vacuum system stuck ON.

The hose was not plugged in, and toggling the kick-plate outlet in the kitchen did not fix it.  That accounted for all the external controls.

The way this works is there is a big cylinder in the basement with the dust collection bin and large fan motor to pull air from the outlets, through the bin, and outside the house.  This is a great way to do vacuuming, because all the dusty air gets exhausted outside.

The control for the fan motor is low voltage that comes to two pins at each outlet.  When you plug in the hose, the pins are extended through the hose by spiral wires that then connect to a switch at the handle.  You can also active the fan by shorting the pins in the outlet with a coin.  Each outlet has a cover held closed by a spring.  You open the cover to insert the hose.  The covers generally keep all the outlets sealed except the one with the hose plugged in.

The outlets are all piped together with 1 1/2 inch PVC pipe to the inlet of the  central unit.  The contact pins at all the outlets are connected in parallel, so shorting any of them turns on the motor.

We also have a kickplate outlet in the kitchen – turn it on and sweep stuff into it.  The switch for that is activated by a lever that also uncovers the vacuum pipe.

I ran around the house to make sure nothing was shorting the terminals in the outlets.

Next, I went to the cellar to look at the central unit.  Unplugging it made it stop (good!) but plugging it back it made it start again.   That was not good.

I noticed that the control wires were connected to the unit via quick connects, so I unplugged them.  The unit was still ON, which meant the fault was inside the central unit.

I stood on a chair and (eventually) figured out that the top comes off, it is like a cookie tin lid.  Inside the top was the fan motor (hot!) and some small circuit board with a transformer, some diodes, and a black block with quick connect terminals.  The AC power went to the block and the motor wires went to the block.  I imagine that the transformer and the diodes produce low voltage DC for the control circuit, and the block is a relay activated by the low voltage.

Relays can stick ON if their contacts wear and get pitted, or there could be a short that applied power to the relay coil.

I blew the dust off the circuit board, and gave the block a whack with a stick.

That fixed it.

I just don’t see what a non-engineer would do in this situation, except let the thing run until the thermal overload tripped in the fan motor (I hope it has one!) and call a service person.  Even if the service folk know how to fix it without replacing the whole unit, it is going to cost $80 ro $100 for a service call.

I don’t have any special home-vacuum-system powers, but I have a general idea how it works, and a comfort level with electricity that I don’t mind taking the covers off things.  This time it worked out well.

The Dishwasher

For completeness, I should relate the story of our Kitchenaid dishwasher.  One day something went wrong with the control panel, so I took it apart.  It wasn’t working, and I thought I couldn’t make it much worse.  I was wrong about that.

I didn’t really know the correct disassembly sequence, and I took off one too many screws.  The door was open flat, and taking off the last screw let the control panel fall off, tearing a kapton flex PC board cable in two.  The flex cable connected the panel to some other circuit board.  I spent a couple of days carefully trying to splice the cable by scraping off the insulation and soldering jumpers to the exposed traces, but I couldn’t get the jumpers to stick.  New parts would have cost about $300, and the dishwasher wasn’t that new.  We eventually just bought a new Miele and that was the Right Thing To Do, because the Miele is like a zillion times better. It has built in hard-water softeners, and doesn’t etch the glasses, and doesn’t melt plastic in the lower tray, and is generally awesome.

So OK, sometimes you can fix it yourself, and sometimes you should really just call an expert.  How are you supposed to know which is the case?

The Garage Door Opener

Every few years, the opener stopped working.  It would whirr, but not open the door.  The first time this happened, I took it apart.  Now you should be really careful around garage door openers, because there is quite a lot of energy stored in the springs, but if you don’t mess with the springs, the rest of it is just gears and motors and stuff.

On mine, the cover comes off without disconnecting anything.  Inside there is a motor which turns a worm gear, which turns a regular gear, which turns a spur chain wheel, which engages a chain, which carries a traveller, which attaches to the top of the door.  The door is mostly counterbalanced by the springs.  With the cover off, you could see that the (plastic) worm gear had worn away the plastic main gear, so the motor would just spin.  The worm also drove a screw that carries along some contacts which set the full open and full closed travel, which stops and reverses the motor.  The “travel” adjustments just move the fixed contacts so the moving contacts hit them earlier or later.

An internet search located gear kits for 1/3 or 1/4 the price of a new motor, and I was able to fix it.

Last time the opener stopped working, however, the symptoms were different – no whirring.  The safety sensors appeared to be operational, because their pilot lights would blink when you blocked the light beam.  I suspected the controller circuit board had failed.  A replacement for that would be about 1/2 the cost of a new motor unit and I wan’t positive that was the trouble, so I just replaced the whole thing.  The new one was nicely compatible with the old tracks, springs, and sensors.

A few weeks later, my neighbor’s opener failed in the whirring mode, so we swiped the gears from my old motor unit with the bad circuit board and fixed it for free.

Take aways

Don’t be afraid to take things apart, at least if you have a reasonable expectation that you are not going to make it worse.

Or – Good judgement comes from experience, but experience comes from bad judgement. (Mulla Nasrudin)

… and just maybe, go ahead and get service contracts for complicated things with expensive repair parts, like that Macbook Pro or HE washing machine, particularly when the most-likely-to-fail part is electronic in nature.

So I usually get AppleCare, and we have a service contract for the new Minivan, and for the washing machine, but <not> for the clothes dryer, since it doesn’t appear to have any electronics inside.  I was able to fix that by replacing the clock switch myself.

But how are non-engineers supposed to cope?



Buying a lemon

Last month we got a shiny new Stop and Shop grocery store here in Wayland.  They’ve been having various grand opening specials so we have been dropping by.  I went over there Sunday evening to buy blueberries (two pints for $3! in January!) but they were out of stock.  I managed to leave the shopping list at home, so I had to go by my wits, which is really not such a good idea.

I checked out using the ScanIt! gadget, and this time I remembered to wait for the coupon accepted tone before dropping my coupon in the slot.  Last time I had to have staff fish my should-have-worked coupon out of the guts of the machine and fix it, but I digress.

After finishing, I called Cathy to see what I had forgotten and she told me to remember to get a lemon and to get a rain check for the 10/$10 frozen vegetables they had run out of.  (I already had a rain check for the blueberries).

I didn’t get another ScanIt! machine for one lemon, so I went over to produce and picked out a nice lemon.  66 cents each!  Should be 50. I carefully put it on the scale, typed in the produce code, and entered my quantity,  The machine prints a scannable sticker, which I stuck on the lemon.

At the self-checkout I scanned the lemon and touched “pay”.  While the machine thought about it, I got exact change from my wallet and began to feed in coins.  Around about 55 cents, I noticed the amount due was $4.03.  There was no cancel button.  At that point I looked at the lemon, and the sticker said “7” rather than “1”.   I think the produce machine must have a calculator style keypad, with 7 at the upper left, rather than a phone keypad with 1 at the upper left.

I think this is 1200 baud modem training to blame.  In those days, you typed way ahead of the computer, and since you knew what it was going to do, there was no real need to actually look at the screen when it caught up.

At this point, there was nothing to do but press  the I Need Help button and look sheepish.

A nice girl with bright orange hair came over and I explained.  I think this was a new one.  She scanned her superuser card and after flipping through some screens said “I don’t think there is any way to change an order after you start paying…. But I can refund the money.”

[Side note: The machine refunded a different collection of coins that happened to add up to 55 cents, rather than returning my coins.  I suppose this lets you overload the change and the refund mechanism.]

After she left, I entered 1 lemon through the produce lookup screens, and again hit pay, and started putting my coins in.  This time, after a few coins, the machine said $5 something or other to go.  I had done it again!  Evidently the 7 virtual lemons were still on the tab, as well as the one real lemon.  I had to call for help again.

The same girl with the bright orange hair came over, and apologized to me, apparently for my being an idiot, and this time refunded the money, and deleted the 7 lemon line item, leaving only one lemon.  I successfully paid, and fled.

It is a mixed blessing that the store was essentially deserted.  No one was there to watch my performance, but neither was there any press of work to distract the staff from chuckling over the befuddled customer.

And I forgot to get the rain check for the frozen peas.

Elegy for a boot

I had not been skiing since 1990 or so.  When I moved to New England in 1989, I thought that skiing here was just too darn icy and cold, compared to Lake Tahoe.  I put my ski boots and other gear in a box in the basement.  This year, my 12 year old son announced he wanted to try snowboarding, so during winter vacation week we went to Nashoba Valley here in Massachusetts.  It was what we used to call “spring skiing” conditions.  Alex had a good time and might want to go again, but here’s what happened when I hit a bump on my first intermediate run.

It looks to me like the plastic just got brittle and shattered. Now I am kind of bemused.  What happened really?  I know that plastics get brittle when exposed to ultraviolet light, but that is not the case here.  Perhaps this is an example of the plasticizers evaporating over many years.

Anyway, farewell boots!  You served me well, at Squaw Valley, Alpine Meadows, Kirkwood, Soda Springs, Heavenly Vally, Boreal, and farther afield at Mammoth Mountain, Snowbird, and Sun Valley.  Even Waterville Valley was no match for you, but little Nashoba was too tough.

Broken ski boots
My 1985 Ski Boots

Order of Operations – Evil and Pernicious

Back in November, my son came home with a 6th grade math test in which he lost a point because he put in parenthesis that were not strictly necessary, according to the order of operations.

Here’s the note I sent to the math teacher:

I’ve been meaning to write about this, but not getting around to it.  I am moved to write because on Alex’ recent math test, he lost a point because he put in parenthesis that were not necessary due to the order of operations.

I’m not going to argue about the grading, which is fine given the syllabus, but rather I want to express my view that teaching order of operations at all is evil and pernicious.

The only correct way to handle math is to always put in all the parenthesis.  Here’s why.

In 6th grade math, the order of operations is pretty simple, multiply and divide are “stronger” than addition and subtraction.  Once you get to the rest of mathematics, and then to programming languages, the situation becomes impossible.

I hate to cite wikipedia, but this article is relevant.


Just look at the page and its examples and just the visual impression of vast complexity is there.

It is beyond dangerous to teach these things <and expect folks to remember them>. They won’t remember the details, but <will think they know>.  Smart, capable engineers will write expressions, thinking they understand what they mean, and <they will be wrong>.

A few years ago I was working at SiCortex, and we built a custom chip with about 150 million transistors, as part of a supercomputer.  The logic is expressed in the VHDL programming language, which like many, has a defined order of operations.  An engineer did something quite innocuous, confusing the order of operations of logical OR and bitwise AND, and in consequence the mathematics expression meant something quite different than intended.  This was caught quite by accident, but had it gone through, the cost would have been a half million dollar replacement chip mask and about 3 months of schedule.

I very strongly feel that order of operations is a quaint dated idea that we really need to stop teaching and stop depending on.  If you always specify exactly what you mean by grouping operations with parenthesis, you and the computer will always agree about what the math means.

This also means that putting in the parenthesis, even if not needed, is a good idea, it makes the meaning of the expression clear without any risk.  This sort of care should be applauded, not penalized!

Some programming languages, like LISP, get this right – they don’t allow chained operations at all, and have no need for order of operations.  Of course they don’t even use infix operators.  In LISP, one says (+ 3 4) or (+ (* 2 4) (* 5 6)) and there is never any confusion about it.


PS  Don’t get me started about mean, median, and mode.  After 4th grade, has anyone actually used Mode?

Toaster Repair

My toaster only toasts on the outside, because the center heating element doesn’t.

No problem! I will take it apart.  Maybe I can fix it.

My toaster is held together by tamper resistant screws!

No problem!  I have a set of tamper resistant bits.

…but the screws are down inside holes that are too narrow for the bit.

What kind of state secrets are inside this thing?


I don’t think I’ll be shopping at wbshop.com any more.  They have had some sort of massive logistical breakdown.

Back on Tuesday, February 9, 2010, I made an $82 order for in-stock items, with two-day air shipping.  Since I ordered in the morning, I expected delivery Thursday, but I would have been only moderately disappointed with Friday, since almost everyone says “two day” when they mean “three days”.

It is now 13 days later, and the order has not shipped.  I had received an order acknowlegement email, but the online system says I have never ordered.  The telephone customer support center says the order is fine and is “in processing” at the warehouse, but they are running “a little behind”.

The gap between reasonable expectations and corporate performance is large.

Here are a few notes and suggestions.

  • The website continues to show items “in stock” and “ships in one day”, when this is obviously not true.
  • The website does not show my order at all.  According to the call center people, it will only show up after it is shipped.
  • My credit card was charged at the time of order.  Maybe my impression that mail order companies are only allowed to charge when they ship is out of date.  I have made an inquiry.
  • There have been no emails or calls from wbshop reporting delays or setting expectations.

I know a modest amount about systems for e-commerce, since I wrote a book on the subject (Designing Systems for Internet Commerce).  I have a few suggestions on technical aspects:

  • The online system can show all orders, completed and pending.
  • The online system can show current status, and contain links to make inquiries
  • The website can contain correct information about product availability
  • The online system can send email updates when previous promises become inoperative
  • There does not need to be any difference if the user account was created at the end of the first order or before it starts. The order is tied to the account and should show online.

And  I have some thoughts about public relations and customer satisfaction

  • Transparency works.  When you have a problem, coming clean about it and providing the best and most accurate information you have is nearly always better than becoming defensive, failing to respond, or stonewalling.
  • For an online store, logistics is everything.  Amazon gets this right.  Wbshop does not.
  • Customers have blogs.  Those blogs are indexed.  Maybe I can add some special index terms.

So what is happening?   I got one customer service rep to go off-script and mention “500 orders behind” but I doubt that is right.  500 is not a two-week problem, it is a few person-days of work at most. That doesn’t explain an ongoing two week delay.

Update 2/26/2010

The order still hasn’t shipped.  I’ve learned a few more things

  • Discover card says it is up to the merchant to charge on order or on shipment.  Discover is happy to help me dispute the charge if I want.
  • A supervisor at wbshop tells me their practice is to charge when items are in stock, and hope they ship soon.  That obviously isn’t working well.
  • “Escalation” consists of sending an open-loop inquiry to the warehouse, with no expectation of hearing back from them.  As far as I can tell, there is no way for the call center to even find out if the order has simply been lost.

I was told Tuesday that the backlog should be cleared by “the end of the week”.  Here it is Friday afternoon and that has not happened.

The call center also has a music on hold system. It interrupts the music every minute or so to tell you “please continue to hold.”  This is a really bad design, since the caller has to shift gears to listen to the message every time.  It would be much better to have the music uninterupted.

Update March 1, 2010

I received an email from wbshop.com this morning:

Dear Lawrence Stewart ,

We deeply apologize for any inconvenience, but your order number xxxxxxx-00 has been delayed due to warehousing issues and we have been unable to ship the merchandise in your order. Please note that our warehousing issues have been resolved and we will be able to ship your order by no later than March 2, 2010. We will send you an email confirming when the shipment leaves our warehouse.

WBshop.com values you as a customer and greatly appreciates your business. We regret that this delay has occurred, and will be refunding $5.00 from your order number xxxxxxx-00 and will issue the refund to your credit card by March 31, 2010.

Please note if you have any questions about your order or charges on your order, please feel free to email us at service@wbshop.com or call our toll-free customer service number, 1-866-373-4389. Customer service representatives are available Monday thru Friday between 8:00 am and 10:00 pm (EST), and on Saturdays between 8:00am and 6:00pm (EST).

Also, you may always call this customer support number to cancel your order prior to shipment of the order to receive a prompt refund. If we do not hear from you before we ship your order to you, we will assume that you have agreed to this shipment delay.

Again, thank you for your patronage.



After 20 days, they are able to tell me my order is planned to ship by 21 days.

I have some suggestions.

  • Send an email immediately when does not ship on schedule.
  • If a new ship date is available, provide it.
  • In any case, provide a date for the next informative email.
  • If the original delivery date can be maintained by upgraded shipping, do that at no charge
  • If the original delivery date cannot be maintained, provide free shipping
  • Provide online order status for pending orders
  • Build systems that give the call center visibility into the warehouse. Maybe you don’t want to tell people “there are 1200 orders ahead of yours” via the web, but telling people angry enough to call is a good idea.  We’re angry, but we realize that folks delayed longer than us should be cleared first.

But, after nearly three weeks, stating with such assurance that you will ship by tomorrow is unlikely to be believed.

Update March 3, 2010

Good News!  Amazingly, wbshop did ship on March first.  I only know this because I called.  They did not send an email to say so.  How hard is it to send an email?  In addition, I got another email announcing a 25% off sale on the very items I tried to buy.  After another call, wbshop issued a credit for the difference.


Anything worth doing is worth overdoing.

Custom multigrain garlic bagel
Custom multigrain garlic bagel

The garlic bagel is a food object of tremendous power. However, my wife has been pointing out just how unhealthy white bread bagels are, so I have, sadly, cut way back.

It doesn’t have to be this way. It turns out that my local shop, a branch of Finagle A Bagel, will make bagels to order. I called up at 6:15 this morning and a dozen multi grain with garlic bagels were ready at 7.

I am a happy boy today. I am safe from vampires, but my colleagues are advised to keep back.


Our house was built in the middle of a field. Around the house is a bit of lawn. Beyond that is what was once a hayfield. Some years of neglect have left it overrun with Buckthorn and some sort of thorn bush. I was mowing the field on Columbus day weekend. Columbus day also has great visuals. I call the stand of trees in the photo “The great wall of flame.”

Fall Foliage

Continue reading “Mowing”