
Damn!
I glanced at your OP too quickly, obviously, and completely misread it.
Why do pressures of work always have to get in the way of really useful stuff, like talking bollocks in the Lounge!?!
I wanna be a eunuchs developer! Pass me a bread knife!






0
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!Wernher von Braun





13 being the less frequent because I don;t like it and my girlfriend says it makes her butt look big.
New version: WinHeist Version 2.2.2 Beta I told my psychiatrist that I was hearing voices in my head. He said you don't have a psychiatrist!






11s Ok but 12 is better. Oh you mean her butt...that's a touchy subject!
New version: WinHeist Version 2.2.2 Beta I told my psychiatrist that I was hearing voices in my head. He said you don't have a psychiatrist!





Being as this is the "Who Cares Puzzle Of The Day", wouldn't the best answer be...
"WHO CARES?"
Just saying.





Sod it  my brain is too knackered to work this out. Time to cheat!
Enumerable.Range(1, 1000)
.SelectMany(i => i.ToString())
.GroupBy(d => d, (Digit, items) => new { Digit, Count = items.Count() })
.Dump();
Digit  Count

1  301
2  300
3  300
4  300
5  300
6  300
7  300
8  300
9  300
0  192
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
 Homer





0 is the least used
1 is the most used
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!Wernher von Braun





000 001 ... 009
010 011 ... 019
...
990 001 ... 999
so, from 000 ~ 999, all digit are equal. But, remove leading '0', '0' is least frequent.
Adding 1000, so, 1 is most frequent.





1
10
11
100
101
110
111
1000
0 == 8
1 == 13





Consider these by the length of the number we have 4 groups.
19
1099
100999
10001000
In the first three groups we only need to consider the first digit, the remaining digits will have an identical number of every digit 09, as they cover the complete range.
In the final group there is only one number, so it is trivial.
Group 1 adds 1 of 19.
Group 2 adds 10 of 19.
Group 3 adds 100 of 19.
Group 4 adds 1 of 1 and 3 of 0.
This makes 1 the most common (by 1) and 0 the least common.





Is fascinating how one can get the right answer even from the wrong reasoning...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.





Ooh, I worked this out the easy way: count them...
14 1s and 9 0s. Easy!





In the range of 199 there are 20 1s alone!!!
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.





Not in binary





Looks to me that everybody is wrong. There are clearly more zeros than ones.
Each byte is packed with leading zeros. The ones are bigtime losers.
QED.





I would like to see how it goes on base 2...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.





I was actually thinking about posting the entire binary sequence so people could count for themselves, but Excel only goes up to 511 in DEC2BIN.





Then go on to the next one:
To enter our office area, you must tap the correct four digit code on the keypad by the door.
For some strange reason, the checking is implemented as pipeline: The last four digits typed must be the correct ones. So, if the correct code is 2345 and you start typing 1234 the door won't open. Then you add the 5, and the door opens.
In other words: You have tested two 4digit keystrokes by 5 keypresses.
Problem 1: What is the minimal number of keypresses required to go through all 10000 possible coded?
Problem 2: Describe the algorithm for generating the order of keypresses
Problem 3: Prove that this is the minimal number of keypresses
Problem 4: The average number of codes you have to try to find the right one is 5000. How many keypresses have you made before having tried 5000 codes? Does it depend on the order of these keypresses?
(Note: I do not have the answers)





The easy way: I made a program and the result is:
0: 192 times
1: 301 times
2...9: 300 times.
So, everyone is right





Interesting one . .
It's about two things  the Interval of integers under consideration and the fact that poor zero never gets to be the first (most significant) digit.
For a range of 1 to 10^n, lucky "1" gets representation in both the first AND last, so has a count of one more than all the rest other than zero.
Zero never starts an integer, so looses out greatly but does indeed benefit slightly from (n1) representations in the last number in the series.
I don't think I have ever actually replied to anything on CP  many thanks for interesting me so much as to prompt me to do so this time!
Russ
A few are great.
I am small.
Together we are the Universe.





I have been surfing around and I found that SO was actually down; first a simple blank page, then an officially "We are down" page.
Their Twitter tweet was,
We are having database or network issues on Stack Overflow  investigating now. Some admins might be losing their jobs over this.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out  Eminem
~! Firewall !~






Then, look for a solution, Dave and help them out.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out  Eminem
~! Firewall !~



