"Car Talk" Puzzler - Fuelly Forums

Click here to see important news regarding the aCar App

Go Back   Fuelly Forums > The Pub > General Discussion (Off-Topic)
Today's Posts Search Click Here to Login
Reply
 
Thread Tools Display Modes
 
Old 11-02-2008, 10:21 AM   #1
Site Team
 
Join Date: Dec 2006
Posts: 658
Country: United States
"Car Talk" Puzzler

I try to listen to Car Talk every week. While listening this week, they gave a puzzler:

NEW PUZZLER: One is the Magic Number
Car odometers go from 0 to 999,999. If a car reached 999,999 miles, how many times would the number "1" appear?

I came up with an answer, which I believe to be the correct answer. However they gave a different answer. What answer would you guys come up with?

-BC
__________________

__________________
Think you are saving gas? Prove it by starting a Gas Log, then conduct a proper experiment.
bobc455 is offline   Reply With Quote
Old 11-02-2008, 11:39 AM   #2
Registered Member
 
theholycow's Avatar
 
Join Date: Apr 2008
Posts: 6,624
Country: United States
Send a message via ICQ to theholycow Send a message via AIM to theholycow Send a message via MSN to theholycow Send a message via Yahoo to theholycow
I assume they're talking about the digit 1. If the question is about the number 1, then the answer is "once".

I wouldn't know a nice formulaic way to figure it out. I could probably figure it out pretty quickly with a pen and paper. However, that's not my way; I'd rather have the computer figure it out for me.

I started by popping a CygWin prompt. You could use any Linux/unix/unix-like system or even a DOS prompt, though it would take a few more keystrokes with a DOS prompt. I used the seq command but to do it in DOS you'd need a For loop.
$ seq 0 999999 > 0-999999.txt
I attached the output, a file with numbers 0 through 999999.

Next, I did this:
$ grep --help | more
Unfortunately, I didn't find what I was looking for. I've never needed it before, and I doubt it's common enough to be in grep. Therefore, I loaded the file into Notepad++.

There, I replaced every '1' with a '1' surrounded by CR/LF. Well, I tried to; it seemed to freeze up, so I ignored it for awhile, and just as I was about to give up and quit this post, it finished.

Now I can feed it back through grep and wc.
$ grep 1 0-999999-1.txt | wc -l
600000

That's my answer.
__________________

__________________
This sig may return, some day.
theholycow is offline   Reply With Quote
Old 11-02-2008, 11:51 AM   #3
Registered Member
 
skewbe's Avatar
 
Join Date: Jan 2007
Posts: 771
Country: United States
111,111 times, if, eg, 100,002 and 100,003 only count once.

The 1 in the 100,000 place will appear once, the one in the 10,000 place will appear 10 times, the one in the 1,000 place will appear 100 times, etc. etc.
__________________
Standard Disclaimer
skewbe is offline   Reply With Quote
Old 11-02-2008, 01:09 PM   #4
Registered Member
 
GasSavers_RoadWarrior's Avatar
 
Join Date: Feb 2008
Posts: 1,652
Hmmm

If it occurs 10% of the time in each column, that's 10%x6=60%, 600,000 times, which seems too high. With 10 symbols 0 to 9 there are 1,000,000 ways of arranging them, in 6 places, if you count 000,000. With 9 symbols this becomes 9^6 which is 531,441 so there's only that number of possible combinations with a 1 missing, i.e. only 468559 combinations that display one or more ones, BUT I guess we're assuming that 111,111 counts for 6 times, not once.

Then if we're assuming the number of times the 1 is brought into display on each wheel, then we only "use" the left hand reel once, the next 10 times, the next 100 times, the next 1000 times, the next 10,000 times, the next 100,000 times, in which case 111,111 is correct.
__________________
I remember The RoadWarrior..To understand who he was, you have to go back to another time..the world was powered by the black fuel & the desert sprouted great cities..Gone now, swept away..two mighty warrior tribes went to war & touched off a blaze which engulfed them all. Without fuel, they were nothing..thundering machines sputtered & stopped..Only those mobile enough to scavenge, brutal enough to pillage would survive. The gangs took over the highways, ready to wage war for a tank of juice
GasSavers_RoadWarrior is offline   Reply With Quote
Old 11-02-2008, 01:29 PM   #5
Registered Member
 
theholycow's Avatar
 
Join Date: Apr 2008
Posts: 6,624
Country: United States
Send a message via ICQ to theholycow Send a message via AIM to theholycow Send a message via MSN to theholycow Send a message via Yahoo to theholycow
Quote:
Originally Posted by RoadWarrior View Post
Then if we're assuming the number of times the 1 is brought into display on each wheel
You must be talking about one of these:


I had a toy one when I was a kid (obviously, a nerd). It was clear plastic, a lot thinner than that, and operated by a pencil or whatever could be stuck into the little holes of the dials which resembled a miniature telephone dial...
__________________
This sig may return, some day.
theholycow is offline   Reply With Quote
Old 11-02-2008, 01:39 PM   #6
Registered Member
 
GasSavers_RoadWarrior's Avatar
 
Join Date: Feb 2008
Posts: 1,652
Heh, what's that a mechanical calculator?

I was meaning mechanical odometers, the numbers are on a round thing which revolves, so I figure it's a wheel.

The electronic ones, well the LCD or Plasma display is usually driven with a high frequency so it's actually switching on and off many times per second.... figure it out then... but if you say, the number of times a 1 is "refreshed" then are we saying the 100,000s "1" is only refreshed once or 100,000 times?
__________________
I remember The RoadWarrior..To understand who he was, you have to go back to another time..the world was powered by the black fuel & the desert sprouted great cities..Gone now, swept away..two mighty warrior tribes went to war & touched off a blaze which engulfed them all. Without fuel, they were nothing..thundering machines sputtered & stopped..Only those mobile enough to scavenge, brutal enough to pillage would survive. The gangs took over the highways, ready to wage war for a tank of juice
GasSavers_RoadWarrior is offline   Reply With Quote
Old 11-02-2008, 01:44 PM   #7
Registered Member
 
theholycow's Avatar
 
Join Date: Apr 2008
Posts: 6,624
Country: United States
Send a message via ICQ to theholycow Send a message via AIM to theholycow Send a message via MSN to theholycow Send a message via Yahoo to theholycow
It's a Pascal calculator, and definitely mechanical.
http://en.wikipedia.org/wiki/Pascal's_calculator
__________________
This sig may return, some day.
theholycow is offline   Reply With Quote
Old 11-02-2008, 01:48 PM   #8
Registered Member
 
Join Date: Apr 2008
Posts: 1,264
Country: United States
Location: up nawth
I think I need one of those green BC powders.

regards
gary
__________________
R.I.D.E. is offline   Reply With Quote
Old 11-03-2008, 09:02 AM   #9
Site Team
 
Join Date: Dec 2006
Posts: 658
Country: United States
I also figured 111,111. But they gave the answer 600,000.

For example when the odometer changes from 182,556 to 182, 557 the 1 does not "appear", it was already there.

If the question was "how many times does the digit 1 exist in numbers between 1 and 999,999" then I would agree with their answer.

-Bob C.
__________________

__________________
Think you are saving gas? Prove it by starting a Gas Log, then conduct a proper experiment.
bobc455 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WTB: Honda Civic VX -Cash in Hand - PA or surrounding.. SoAngel Wanted to Buy 3 12-24-2007 04:34 PM

» Fuelly Android Apps
Powered by vBadvanced CMPS v3.2.3


All times are GMT -8. The time now is 11:25 AM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.