Some states seem to have something called the 3 foot law to keep cars away from cyclists. Why 3 feet? Which states in the USA have it?
The 3 foot law is an example of a law that exists mostly to create awareness rather than having some direct practical function.
This law is rarely enforced by itself. Can anyone cite an instance where a motorist was ticketed for passing in under three feet (and not ticketed for anything else)? The 3-foot law is, AFAIK, typically enforced as a supplement to some other violation such as failure to yield or reckless driving.
But more than anything else, the intent is to create some level of awareness in motorists about how to deal with cyclists. If motorists know it is a law, most will make an effort to abide by the law.
A quick google search reveals that, as of this year, 20 states in the USA have this law. You can view a map depicting the status of this law in the United States here: http://www.3feetplease.com/important-stuff
It seems to me that in the last 10 years or so, motorists have been getting much better than in the past about getting along with bikes. It could be the marked lanes/signage, or perhaps things like the 3-foot law, but I have noticed a LOT LESS "entitlement-to-the-road" behavior from motorists than in the 1990's and earlier.
Three feet just seems (to legislators) like a reasonable number (it's 1 meter in the UK and I think most of Europe). And I know it's the law in Minnesota. Don't know about any other states.
Would a different number make more sense? Probably not. Less would be out-and-out dangerous, and more would create the situation where the bike (in theory) blocks traffic in too many cases (and hence would be ignored even more than the current law).
Pennsylvania's got a new four-foot law. It was recently enforced after an attempted hit-and-run in Bethlehem, PA (http://www.youtube.com/watch?v=b7AVC1YCcO0). (I should clarify that it was a hit-and-attempted-run, as other motorists pinned the driver in to prevent him from running).
France has such a law (1 metre in cities, 1.5 metres in the country). That safety margin is also applicable to passing pedestrians and animals.
Five feet seems to be a popular variant of the 3-feet law. I suspect that's because if you tell people five, maybe they will give three. But five has the benefit of making it cleaer that the car needs to partially cross over to the other lane instead of trying to squeeze by without crossing the line.
The 3-Foot Law passed a few years back has brought much more awareness with motorists and cyclists alike here in CA. I have noticed greater compliance here in Midtown Sacramento where one motorist will yield to a bicyclist and whoever is behind them in the following car will follow suit. How other cities/neighborhoods have reacted is beyond my reach, since I only ride in Sacramento, however, my best guess would be motorists are much more aware of the need to "share the road" there as well. It should be noted when the law passed, there was significant backlash from the "entitled motorists" among us. This lasted for at least a year. Gradually, however, at least here in Midtown, I've witnessed improvement in the relationship between cyclists and motorists alike. A reduction in the speed of both is critical for this to work, and that has happened with the advent of protected bike lanes, bicycling education classes sponsored by the City of Sacramento and Sacramento Area Bicycle Advocates (SABA), and a better appreciation of the role of bicyclists in the area. We're hopeful for continued change.