TWCP OTD (The Who Cares Puzzle Of The Day) - 24th of January, 2017
-
We need a bit of context, here. 0. Strictly normal daily usage, 1 is the first number (and is also a article, grammatically), so it will come into most use. 1. In a supermarket, 99, because they treat their customers like ****ing idiots. 2. In a nursery school: 3, 4, or 5. 3. In a brothel, somewhere between 68 and 70 (non-inclusive). 4. Etc. Whatever "answer" you give as being absolute will have some context, but will be wrong in all the others.
I wanna be a eunuchs developer! Pass me a bread knife!
What about the numerical context?
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
What about the numerical context?
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
42
I wanna be a eunuchs developer! Pass me a bread knife!
-
For the most, The problem actually scales down to what is the most frequent digit between 1 and 10. There are 2 ones. It is the same idea for 1 to 1 X 10^n. You wouldn't notice the least until you get to 11 to 20. In this case, 1 shoots out ahead because it leads half of the digits. in 21 to 30, 2 catches up to 1. But there is no equivalent section of numbers for 0. In 1 to 100 there are only 11 0's, which puts it far behind the other numbers and it never catches up.
Brent
Now, that's much better!!! :thumbsup:
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
42
I wanna be a eunuchs developer! Pass me a bread knife!
You won the big prize today!!!
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
Jochen Arndt wrote:
The less is obviously the zero.
I see nothing obvious there... You may say, that the line does not start with zero so it is at least one appearance behind, but 1000 adds three more zeroes!
Jochen Arndt wrote:
The most probably the one because 1000 is the only 4-digit number.
OK. But that implies, that no other number had an advantage before than... Why is that?
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
You did not wrote "list of numbers form 0001 to 1000". So it is obvious that the zero occurs less often than other digits. 1-9: Each digit except zero occurrs once 10-99: Each digit except zero occurs 10 times (10's place) plus 9 times (1's place); zero 9 times >= 100: Zero is now present at the 10's place like the other digits but not at the 100's place.
-
THE MOST AND LESS FREQUENT DIGITS IN THE NUMBERS FROM 1 TO 1000 It is not about writing code - but it is possible - but some nice logical explanation... So which is the most frequent digit in the list of numbers form 1 to 1000? And the less frequent? Why? And even Google is our friend - it would be nice to not to tell him about it...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
There's a touch of Benfield's Benford's Law about this...
-
You did not wrote "list of numbers form 0001 to 1000". So it is obvious that the zero occurs less often than other digits. 1-9: Each digit except zero occurrs once 10-99: Each digit except zero occurs 10 times (10's place) plus 9 times (1's place); zero 9 times >= 100: Zero is now present at the 10's place like the other digits but not at the 100's place.
Much better - it is like the second version of some code... more robust and trustworthy... :thumbsup:
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
There's a touch of Benfield's Benford's Law about this...
Benford's law is more about observation of probability in naturally occurring number lists and it is much more a phenomenon... I tried to keep it more terrestrial...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
THE MOST AND LESS FREQUENT DIGITS IN THE NUMBERS FROM 1 TO 1000 It is not about writing code - but it is possible - but some nice logical explanation... So which is the most frequent digit in the list of numbers form 1 to 1000? And the less frequent? Why? And even Google is our friend - it would be nice to not to tell him about it...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
Real programmers start counting with 0, and logically speaking, a list of 1000 numbers would only go to 999. Using my logic: Most instances = 1 through 9 (all tied) Least instances = 0 If you did it wrong (as stated by the original message), 1 would be first (by just one instance), and 0 would still be the least used. Actual results: 1-1000 0 = 300 1 = 300 2 = 300 3 = 300 4 = 300 5 = 300 6 = 300 7 = 300 8 = 300 9 = 189 0-999 0 = 190 1 = 300 2 = 300 3 = 300 4 = 300 5 = 300 6 = 300 7 = 300 8 = 300 9 = 297
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
Real programmers start counting with 0, and logically speaking, a list of 1000 numbers would only go to 999. Using my logic: Most instances = 1 through 9 (all tied) Least instances = 0 If you did it wrong (as stated by the original message), 1 would be first (by just one instance), and 0 would still be the least used. Actual results: 1-1000 0 = 300 1 = 300 2 = 300 3 = 300 4 = 300 5 = 300 6 = 300 7 = 300 8 = 300 9 = 189 0-999 0 = 190 1 = 300 2 = 300 3 = 300 4 = 300 5 = 300 6 = 300 7 = 300 8 = 300 9 = 297
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013John Simmons / outlaw programmer wrote:
Real programmers start counting with 0
And outlaw programmers keep their logic as secret... :-D
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
THE MOST AND LESS FREQUENT DIGITS IN THE NUMBERS FROM 1 TO 1000 It is not about writing code - but it is possible - but some nice logical explanation... So which is the most frequent digit in the list of numbers form 1 to 1000? And the less frequent? Why? And even Google is our friend - it would be nice to not to tell him about it...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
Kornfeld Eliyahu Peter wrote:
which is the most frequent digit in the list of numbers form 1 to 1000?
Assuming that those are spelling errors:
2 it the least frequent, with only one instance.
0 is the most frequent, with three instances.
Poor old 1 has only two instances in the collection {1, 2, 1000}Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
John Simmons / outlaw programmer wrote:
Real programmers start counting with 0
And outlaw programmers keep their logic as secret... :-D
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
There are no secrets with regards to being an outlaw. That would put the rest of society in danger, and not even I'm that insensitive...
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
Kornfeld Eliyahu Peter wrote:
which is the most frequent digit in the list of numbers form 1 to 1000?
Assuming that those are spelling errors:
2 it the least frequent, with only one instance.
0 is the most frequent, with three instances.
Poor old 1 has only two instances in the collection {1, 2, 1000}Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
Remember! I'm not only writing bad English, but also reading that way...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
Real programmers start counting with 0, and logically speaking, a list of 1000 numbers would only go to 999. Using my logic: Most instances = 1 through 9 (all tied) Least instances = 0 If you did it wrong (as stated by the original message), 1 would be first (by just one instance), and 0 would still be the least used. Actual results: 1-1000 0 = 300 1 = 300 2 = 300 3 = 300 4 = 300 5 = 300 6 = 300 7 = 300 8 = 300 9 = 189 0-999 0 = 190 1 = 300 2 = 300 3 = 300 4 = 300 5 = 300 6 = 300 7 = 300 8 = 300 9 = 297
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013That's taking digits into account, though, but, numerically, eleven isn't one twice, for example; it's eleven (which becomes obvious with any base other than 10). Either zero or one would have to be the absolute top, in real-world usage: 0. Unlike any other number, any amount of zeroes = zero, so finance, decimal fractions, etc, will rack up huge amounts of the non-existent buggers. 1. Everything (that grokels use) starts from 1, so it is therefore highly used because it's always there, even if [2 ... 99] aren't. And, language-wise, expressions like "Oh, just one more thing..." are used a gajillion times more often than "Oh, just [2 ... 99] more things...". Someone must have done a study on this! It's way more interesting and useful than a huge amount of "research" I hear about. (i.e. it's a tiny bit useful and interesting)
I wanna be a eunuchs developer! Pass me a bread knife!
-
THE MOST AND LESS FREQUENT DIGITS IN THE NUMBERS FROM 1 TO 1000 It is not about writing code - but it is possible - but some nice logical explanation... So which is the most frequent digit in the list of numbers form 1 to 1000? And the less frequent? Why? And even Google is our friend - it would be nice to not to tell him about it...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
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!
-
THE MOST AND LESS FREQUENT DIGITS IN THE NUMBERS FROM 1 TO 1000 It is not about writing code - but it is possible - but some nice logical explanation... So which is the most frequent digit in the list of numbers form 1 to 1000? And the less frequent? Why? And even Google is our friend - it would be nice to not to tell him about it...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
1
-
THE MOST AND LESS FREQUENT DIGITS IN THE NUMBERS FROM 1 TO 1000 It is not about writing code - but it is possible - but some nice logical explanation... So which is the most frequent digit in the list of numbers form 1 to 1000? And the less frequent? Why? And even Google is our friend - it would be nice to not to tell him about it...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
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! -
THE MOST AND LESS FREQUENT DIGITS IN THE NUMBERS FROM 1 TO 1000 It is not about writing code - but it is possible - but some nice logical explanation... So which is the most frequent digit in the list of numbers form 1 to 1000? And the less frequent? Why? And even Google is our friend - it would be nice to not to tell him about it...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
THE MOST AND LESS FREQUENT DIGITS IN THE NUMBERS FROM 1 TO 1000 It is not about writing code - but it is possible - but some nice logical explanation... So which is the most frequent digit in the list of numbers form 1 to 1000? And the less frequent? Why? And even Google is our friend - it would be nice to not to tell him about it...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
Sod it - my brain is too knackered to work this out. Time to cheat! :D
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
-
THE MOST AND LESS FREQUENT DIGITS IN THE NUMBERS FROM 1 TO 1000 It is not about writing code - but it is possible - but some nice logical explanation... So which is the most frequent digit in the list of numbers form 1 to 1000? And the less frequent? Why? And even Google is our friend - it would be nice to not to tell him about it...
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
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