Flexible Zipcar Algorithm

I am now a proud owner of a Zipcard. My old car died a horrible, screaming death recently and I decided to try to go carless as an experiment, hoping to save some money or to lose weight.

Zipcar is the modern way to rent a car. You reserve a car by the hour or by the day through the web, arrive at the site, swipe your card and drive away.

My biggest problem with being a Zipster is that the closest Zipcar location to my home is about one mile away. On second thought, I am losing weight.

But for other Zipsters, the biggest problem is that you have to return the car at the exact location where you picked it up. Obviously, if you allow renters to return their car to a different location the Zipcar company might run out of paid parking spaces in a particular location or, even worse, the cars might migrate to certain places, leaving other locations without any car.

I would like to propose an algorithm that will add some flexibility to where you can return a car, without overwhelming the system.

Here’s how it would work. Suppose we have three cars currently assigned to the Mt Auburn/Homer Ave location. I suggest we name three as a desirable number, but actually allow from three to four cars to be assigned to this location at any particular time.

Now suppose I want to pick up a car at the Mt Auburn/Homer Ave location and to return it to the Somerville Ave/Beacon location. If the number of currently assigned cars to Mt Auburn/Homer Ave location is three (at the lower limit), the Zipcar reservation webpage tells me, “Sorry, you can’t use this location unless you return your car back here,” and shows me the closest location with extra cars. The same goes if the number of assigned cars at the Somerville Ave/Beacon location is at its upper limit. If my starting point has more cars assigned to it than its lowest limit and my destination point has fewer cars assigned to it than its upper limit, then I am allowed to take a car from my starting location and return it to my destination. Zipcar can throw in some financial incentives. If my choice disrupts the most desirable balance of car assignments, I have to pay a fee. If my choice restores the balance, I get a bonus discount.

It would be so cool if zipcars were flexible. I understand that the average cost to the company of parking each car might go up with my flexible algorithm as Zipcar will need more parking spaces than cars. But Zipcar can start implementing this flexibility with a small number of flexible locations. It would be a great feature.

Hey, Zipcar algorithm designers! Can I get a bonus if you implement my algorithm? I can also design a financial incentives formula for you.

Share:Facebooktwitterredditpinterestlinkedinmail

Funny Pictures

Cape Cod Levitation Society

Violators GrilledI updated my funny pictures page with five new pictures. My new favorites are “Cape Cod Levitation Society” on the left and “Grilled Violators” on the right.

Share:Facebooktwitterredditpinterestlinkedinmail

Conway’s Wizards Generalized

Here I repeat the Conway’s Wizards Puzzle from a previous posting:

Last night I sat behind two wizards on a bus, and overheard the following:

— A: “I have a positive integral number of children, whose ages are positive integers, the sum of which is the number of this bus, while the product is my own age.”
— B: “How interesting! Perhaps if you told me your age and the number of your children, I could work out their individual ages?”
— A: “No.”
— B: “Aha! AT LAST I know how old you are!”

Now what was the number of the bus?

It is obvious that the first wizard has more than two children. If he had one child then his/her age would be the number of the bus and it would be the same as the father’s age. While it is unrealistic, in mathematics many strange things can happen. The important part is that if the wizard A had one child he couldn’t have said ‘No’. The same is true for two children: their age distribution is uniquely defined by the sum and the product of their ages.

Here is a generalization of this puzzle:

Last night I sat behind two wizards on a bus, and overheard the following:

— Wizard A: “I have a positive integral number of children, whose ages are positive integers, the sum of which is the number of this bus, while the product is my own age. Also, the sum of the squares of their ages is the number of dinosaurs in my collection.”
— Wizard B: “How interesting! Perhaps if you told me your age, the number of your children, and the number of dinosaurs, I could work out your children’s individual ages. ”
— Wizard A: “No.”
— Wizard B: “Aha! AT LAST I know how old you are!”

Now what was the number of the bus?

As usual with generalizations, they are drifting far from real life. For this puzzle, you have to open up your mind. In Conway’s original puzzle you do not need to assume that the wizard’s age is in a particular range, but once you solve it, you see that his age makes sense. In this generalized puzzle, you should assume that wizards can live thousands of years, and keep their libido that whole time. Wizards might spend so much of their youth thinking, that they postpone starting their families for a long time. The wizards’ wives are also generalized. They can produce children in great quantities and deliver multiple children at the same time in numbers exceeding the current world record.

Another difference with the original puzzle is that you can’t solve this one without a computer.

You can continue to the next step of generalization and create another puzzle by adding the next symmetric polynomial on the ages of the children, for example, the sum of cubes. In this case, I do not know if the puzzle works: that is, if there is an “AHA” moment there. I invite you, mighty geeks, to try it. Please, send me the answer.

In case you are wondering why the wizard is collecting dinosaurs, I need to point out to you that John H. Conway is a superb puzzle inventor. His puzzle includes a notation suggestion: a for the wizard’s age, b for the bus, c for the number of children. Hence, the dinosaurs.

Share:Facebooktwitterredditpinterestlinkedinmail

Sing Away Your Snoring

Singing for Snorers CD

Everyone agrees that you snore because some muscles at the back of your mouth are too relaxed when you sleep. Back in Russia, I heard about exercises for snorers that strengthen those muscles, but I never heard about them here. That is, until now.

Even medicine in this country is oriented towards making money. Simple exercises do not make much money. Here they offer you many devices and pills and even operations to relieve snoring, but not much in the way of exercise. Recently, though, I heard a very simple idea — sing before going to bed. Singing will help tone your throat muscles.

Some people are making money off of singing, too: check out the Singing for Snorers CD.

Share:Facebooktwitterredditpinterestlinkedinmail

Reason Number 37 not to Trust NJ Transit

I was waiting for a train in Newark. On the platform, there was an LCD screen that flashed advertising. The ad I was staring at was titled, “Reasons to take NJ Transit to Prudential Center, #15.” I was impressed that the NJ Transit sales people were working so hard to invent that many reasons.

I waited for my train for half an hour. It turned out that the NJ Transit advertising people were not working hard after all. The screen was flipping between four reasons, numbered 3, 6, 12 and 15. This is a case of false advertising. You look at reason number 15 and think that there must be a lot of reasons. They fool with your head. Cheaters.

I hope you noticed that I did the same thing with this posting — purely in order to illustrate my point.

Share:Facebooktwitterredditpinterestlinkedinmail

Simplified Wizards Puzzle

Here is my simplified version of Conway’s wizards puzzle.

Last night when I was coming home from my writing class with Sue Katz, I sat behind two wizards on the bus, and overheard the following:

— Wizard A: “I have a positive integral number of children, whose ages are positive integers, the sum of which is the number of this bus, while the product is the amount of dollars I have in my pocket.”

At this point I interrupted the wizard. “Excuse me, professor, I overheard your conversation and can’t resist asking you a question. Usually when a father says ‘my children’ everyone assumes that he has at least two children. Can I assume that?”

— Wizard A: “No. I stated my assumptions up front. A positive integral number of children means one or more.”

I started thinking. If I were to explain this to a non-mathematician who assumes that ‘my children’ means more than one child, I would need to change the wizard’s statement into the following:

“I have at least one child. The ages of my one-or-more children are all positive integers. The sum of the ages of my children or the age of my only child is the number of this bus. The product of the ages of my children or my only child’s age is the amount of dollars I have in my pocket.”

Hmm. I like that mathematicians use ‘my children’ to indicate any number of children. Makes puzzles faster to type.

Anyway, the wizards continued their discussion:

— Wizard B: “How interesting! Perhaps if you told me the number of your children, I could work out their individual ages”
— Wizard A: “No.”
— Wizard B: “Aha! AT LAST I know how many children you have!”

If I were John Conway, I would have asked you next, “What is the number of the bus?” As I am not John Conway, I’ll ask you, “Why do we presume that Wizard A hasn’t cheated on his wife?”

The answer is that all wizards are notorious for making precise statements. If he cheats a lot, he would have started the conversation with, “The number of children I know about is a positive integer.” Or maybe, more discreetly, “My wife and I have a positive integral number of children.”

If you have already figured out the number of the bus, the bonus question is, “Why did I change the ‘age of the first wizard’ in Conway’s original puzzle into the ‘amount of dollars’ in my puzzle?”

When I left the bus, I started wondering why on earth anyone would ever want to sum up the ages of their children. And I remembered that I once did it myself. I was trying to persuade my sister to apply for U.S. citizenship. My argument was that by moving here the life expectancy of her children would increase by 30 years. Indeed, she has two sons and the male life expectancy in Russia and the U.S. has an astonishing 15-year difference. I have to admit that my argument is not very clean, as we do not know the causes for this difference and, besides, the data is for life expectancy at birth and it changes while our kids age. My sister dismissed my argument, saying that the low male life expectancy in Russia is due to alcoholism and that her family is not in the high-risk group.

So, there could be a reason to sum up the ages of your children, but why would anyone ever want to multiply the ages of their children? In any case, if the first wizard continues to keep an amount of dollars equaling the product of the ages of his children in his pocket, his pocket will do better than mutual funds for the next several years.

Share:Facebooktwitterredditpinterestlinkedinmail

I am a Computer Addict

I know I’m a computer addict, because:

  • When I just wake up, before opening my eyes, my first thought is not that I need to run to the bathroom, but rather, “I need to check my email.”
  • My computer desk is the farthest surface suitable for eating from my kitchen, still I have most of my meals there.
  • To take a break from my laptop I play evil level websudoku. To take a break from sudoku, I check my email.
  • I gave a name to my laptop — Richard. Now when I travel I never feel lonely — I have my own Dick with me all the time.

If you’re reading this, you might be as bad as I am. Please finish this sentence and add it to comments below: “I know I’m a computer addict, because …”

Share:Facebooktwitterredditpinterestlinkedinmail

A Very Special Ten-Digit Number

 This puzzle was given to me by John H. Conway, and he heard it from someone else:

Find a ten-digit number with all distinct digits such that the string formed by the first k digits is divisible by k for any k ≤ 10.

Surprisingly, there is a unique solution to this puzzle. Can you find this very special ten-digit number?

For the contrast, consider ten-digit numbers with all distinct digits such that the string formed by the last k digits is divisible by k for any k ≤ 10. These numbers are not so special: there are 202 of them. My puzzle is: find the smallest not-so-special number.

Share:Facebooktwitterredditpinterestlinkedinmail

John Conway’s Wizards

John Conway sent me a puzzle about wizards, which he invented in the sixties. Here it is:

Last night I sat behind two wizards on a bus, and overheard the following:

— A: “I have a positive integral number of children, whose ages are positive integers, the sum of which is the number of this bus, while the product is my own age.”
— B: “How interesting! Perhaps if you told me your age and the number of your children, I could work out their individual ages?”
— A: “No.”
— B: “Aha! AT LAST I know how old you are!”

Now what was the number of the bus?

Share:Facebooktwitterredditpinterestlinkedinmail

The Mathematical Path to the Right Husband

The first time I heard about the “stopping problem,” many years ago, it was in this version: The king announces that it is time for his only daughter to marry. Shortly thereafter 100 suitors line up in a random order behind the castle walls. Each suitor is invited to the throne room in front of the eyes of the princess and the king. At this point, the princess has to either reject the suitor and send him away, or accept the suitor and marry him. If she doesn’t accept anyone from the first 99, she must marry the last one. The princess is very greedy and wants to marry the richest suitor. The moment she sees the suitor she can estimate his wealth by his clothes and his gifts. What strategy should she use to maximize the probability of marrying the richest person?

The correct strategy is to reject the first 37 suitors and then marry the one who is better than anyone else before him. Generally, if there are N suitors the number of people to skip is about N/e — slightly more than one third of the whole group.

However, the greedy princess never received a good mathematical education. It is clear that her goal should have been to maximize the expected wealth of the future husband. In this case the strategy would be different; in particular, it changes significantly at the end. Let’s imagine that when the line of leftover suitors thins, she realizes that she’s already rejected the best one. In this case, it would be in her interest to consider the second best and, closer to the end, even the third best.

In real life, marrying the second best creates a burden of regret and bitterness. Let us assume that we all want to marry the best we can. But of course in our cases, the best does not necessarily mean the wealthiest. Also, we do not know how many suitors are lining up for us. Back in Russia I heard that a woman, on average, receives ten proposals. So, we should skip the first three, then marry the best person after that.

I do not know how many proposals an average American woman gets, but nowadays she doesn’t have to wait for an official proposal before deciding whether a guy is right for her. The question becomes: which marriage candidate should a woman try to marry?

If we assume that marriage candidates are distributed evenly in time and girls are seriously hunting for husbands between ages 20 and 35, then the above math advice can be applied in the following way: From age 20 to about 25 or 26, just look around and see what life offers you. After that, marry the one who is better than all the previous ones.

This is a very mathematical piece of advice. The idea makes sense: first you sample your options then you target the best. The problem is that these assumptions do not cover our real-life situations. Let’s look at some realistic adjustments and how they affect the age at which you stop sampling and become more active.

  • You might be OK without marrying at all. In this case you can afford to be much pickier and skip the first 60% of the candidates.
  • Potential husbands are not spread evenly in time. In this case try to estimate the distribution and act accordingly. For example, if you expect more men around you while you are in college, your cut-off age goes down.
  • You change with time. If you think that you will lose your freshness and charm with age, your cut-off age goes down. If you think that you’ll become more experienced and effective at seducing men later in life, your cut-off age goes up.
  • Your values change with time. You might be interested in looks now and value a big heart later. Because of this, it is better to delay your choice until you know yourself well and your opinion of life has stabilized.
  • The value of a man changes with time. A high school drop out can become a very successful businessman and the brightest student in college can become an alcoholic. You might benefit from waiting to see how he stabilizes, thus moving your cut-off age up.
  • You can divorce. This allows you to make a mistake on the first try and moves your cut-off age for this first try down.

Based on the mathematics and discussion above, here is the advice I would give to my teenage daughter — if I had one:

Take your time looking around and sampling your boyfriends. Constantly analyze the pool of your boyfriends as a whole. If there are strange patterns — for example, all of them look exactly like your father or you always pay for their dinners — start psychotherapy and work it out. As soon as your boyfriends start to look different from each other — except for things that are important to you, like education — compare your dream husband to the pool. If you dream about a Nobel prize winner who is not older than 30 and on the list of the 100 sexiest men alive, you should adjust your expectations to your chances. You will choose a guy who is better than anyone before, but it is unrealistic to expect him to be much better. As soon as you get to a cut-off age, which you have estimated using the suggestions above, stop sampling and start deciding. As soon as you find someone who is better than anyone else before, go for it — marry him.

That was advice from my brain, now I will give you advice from my heart:

Use mathematics to guide you, but make the final decision with your heart.

Share:Facebooktwitterredditpinterestlinkedinmail