# On Choosing Random Numbers...



## mosaix (Feb 12, 2017)

Okay, think of a random number between 1 and 1000. Do that twice a day for the next 45 days.

Wait a year then do it again. How many of those numbers will be repeated between the two events? Or to put it another way how good are you at choosing random numbers?

I've got a book of 1000 chess problems. At the beginning of 2016 I decided to solve two of these a day (one in the morning and one in the evening), each problem chosen by me choosing a random number between 1 and 1000. I did this until the middle of February and then it petered out. I started again at the beginning of 2017.

The problems have no obvious solution but more 'best outcome'. I recorded my solutions in an excel spreadsheet and then looked up the solution. Where my solution wasn't 'best outcome' these were marked in red so that I could visit them again in the future, having forgotten the provided solution.

So twice a day for forty five days meant that last year I chose 90 random numbers. And now I'm approaching having chosen another 90 this year. When I go to the spreadsheet I can see previous choices.

How many of this years 'random' choices collided with last years 'random' choices?



Spoiler



17 



On 



Spoiler



6


 additional occasions I chose numbers that I had already chosen _this_ year - I remembered the problem as soon as I turned to the page!

So choosing random number is much more difficult that I thought - for me anyway.


----------



## BAYLOR (Feb 12, 2017)

Nevermind ,


----------



## Victoria Silverwolf (Feb 12, 2017)

This is like the birthday problem.

If you choose 90 numbers at random out of 1000, each number has 89 chances to match another.

(90)(89) = 8010 chances to match.

This isn't formal math, but it lets you see that it's not very surprising that you will have some matching numbers.

If you want to avoid repeating, use this random sequence generator to arrange the numbers from 1 to 1000 in a random order.

RANDOM.ORG - Sequence Generator


----------



## RX-79G (Feb 12, 2017)

I'm willing to bet that you wouldn't "randomly" choose 1 or 1000.


----------



## Victoria Silverwolf (Feb 12, 2017)

How to calculate the exact probability that two numbers will be the same when N numbers are chosen from K choices:

Probability of choosing the same number

Since this involves calculating factorials for large numbers in your example, the math is more than any on-line calculator I can find can handle.

It would be:

One minus [1000!/(1000 to the 90th power)(910!)]


----------



## Victoria Silverwolf (Feb 13, 2017)

Let me try to approximate this:

1000! = Approx. 4 times ten to the 2567th power

1000 to the 90th power = 1 times ten to the 270th power

910! = Approx. 2.5 times ten to the 2299th power

Multiply the last two to get 2.5 times ten to the 2569th power

Divide this into the first number to get 1.6 times ten to the minus 2 power = 0.016

Subtract this from 1 to get 0.984

Therefore, if you randomly pick 90 numbers from 1 to 1000, there is a 98.4% chance that at least two will match.


----------



## mosaix (Feb 13, 2017)

I think it's more than probability Victoria. There must be some other kind of mechanism at work. 747 for instance is an obvious choice, although it wasn't one that I chose. 464 was however - it was the model number of a machine I worked on about 50 years ago. There must be other 'themes' at work that I haven't recognised and this is probably true for everyone.


----------



## Victoria Silverwolf (Feb 13, 2017)

So, these are not really "random" numbers?  You're just picking one out of your head?  Yeah, that would involve psychological factors.

There are a few surveys on-line which indicate that, when asked to pick a number from 1 to 10, 7 was picked more often than chance.  When asked to pick a number from 1 to 20, 17 was picked more often than chance.  The effect of "lucky" 7, I suppose.


----------



## Ursa major (Feb 13, 2017)

mosaix said:


> 464


This (well, 4-6-4) is a locomotive wheel arrangement (a "Hudson" or a "Baltic"), and there are lots** of them, not all of them listed on this Wiki page.

Having not tried the experiment, I don't know if I would tend to choose these numbers or actually avoid them, as not being at all random to me. (It would be interesting to know how a random number generator, whose generation process is not encumbered by extraneous knowledge, might perform in comparison.)


** - Luckily, many of them step outside the 1-1000 limits (2-10-4, a Texas type, for instance).


----------



## mosaix (Feb 13, 2017)

Victoria Silverwolf said:


> So, these are not really "random" numbers?  You're just picking one out of your head?  Yeah, that would involve psychological factors.
> 
> There are a few surveys on-line which indicate that, when asked to pick a number from 1 to 10, 7 was picked more often than chance.  When asked to pick a number from 1 to 20, 17 was picked more often than chance.  The effect of "lucky" 7, I suppose.



Sorry, I should have made myself clearer,  Victoria.


----------



## mosaix (Feb 15, 2017)

It happened again this morning. 627! 

Heaven knows why I should pick 627 twice when there are hundreds of others to go for.


----------



## Stable (Feb 16, 2017)

Interestingly there's a branch of maths (or statistics) that deals with this - they determined that there is a pattern to even random numbers. This is relevant because it shows when people, for example, cook their accounting books. The "random" numbers that they pick don't reflect the natural distribution of numbers.

In other words, humans are terrible at picking numbers randomly. You need technical assistance like a random number site.


----------



## Venusian Broon (Feb 17, 2017)

Or make your own daft random number generator!

How about choosing a seed - say in this case number 4 - then take a big long list of the digits of Pi and then when you've solved the problem go along 4 in Pi's decimal expansion and then take the next three digits you find (which assuming you count the 3.) would be 159. After solving that go 159 digits to the left, after the 9, and find the next three digit number...

So not only are you solving chess puzzles, you will be exploring and traversing the mysteries of the number Pi. From my understanding it should be truly random.

(Note, looking at the first thousand numbers, you would probably have to choose the chess problem with the three numbers you find _plus one_ as there are sequences of zero's I.e. 000 - although you could interpret that as 1000?)

((mmm...makes me wonder if this would be easy to program ???.....Stop, procrastination begone!))

(((EDIT: Now this raises the question for me, how long do you need to go to make all the numbers 1-1000 appear at least once???)))


----------



## mosaix (Feb 17, 2017)

BTW if anyone is interested the book is 1001 Winning Chess Sacrifices and Combinations by Fred Reinfeld. Can't recommmend it highly enough.

In fact any chess book by Reinfeld gets my recommendation.

This morning's duplication was 511! Why?!


----------



## Venusian Broon (Feb 18, 2017)

mosaix said:


> BTW if anyone is interested the book is 1001 Winning Chess Sacrifices and Combinations by Fred Reinfeld. Can't recommmend it highly enough.



I was a bit addicted to chess as a child...but I just couldn't get into the whole chess problem thing. I think I understand it better now as an old one...but I've not played chess in years . Possibly all this 'a chess program on a mobile phone that can beat most humans' has tarnished it a bit for me 

Cor, I now remember when newspapers used to print daily chess problems (The Sudoku of the 'up to 70s?')


----------



## mosaix (Feb 18, 2017)

Venusian Broon said:


> Cor, I now remember when newspapers used to print daily chess problems (The Sudoku of the 'up to 70s?')



I think The Observer still does one on Sundays, VB. 

I remember a Christmas special many years ago that I found impossible. The solution nearly drove me mad. The problem 'Black to move' referred to the player's name - Black - who was playing white and all the black pieces had passed all the white pieces on the board so they were playing in the opposite direction to which the solver assumed. Believe it or not someone solved it - swine!


----------



## The Judge (Mar 14, 2017)

If you want a chess problem -- and prove humans can beat computers -- Sir Roger Penrose has one for you, mosaix Scientists Need You to Solve This Chess Problem and Find the Key to Human Consciousness


----------



## mosaix (Mar 14, 2017)

The Judge said:


> If you want a chess problem -- and prove humans can beat computers -- Sir Roger Penrose has one for you, mosaix Scientists Need You to Solve This Chess Problem and Find the Key to Human Consciousness



Wow! Three black-squared bishops is going it a bit!

Edit: Can't see anywhere where it says whose move it is.

Edit: Assuming white to move (but probably doesn't matter if it's black): As long as white doesn't move its bishops pawn and restricts movement to the king only (onto white squares is best) then the 50 move rule comes into play allowing a draw. 

50 move rule: No pawn moves or captures in 50 moves allows a player to claim a draw.


----------



## Vladd67 (Mar 14, 2017)

Why not just throw three d10s?


----------



## The Judge (Mar 15, 2017)

You've got it, mosaix!  (At least, I think so -- the answer I've read doesn't mention the 50 move rule, just that if the white king stays on the white squares it can force a draw.)

Apparently, the way to get to checkmate is by the white king travelling to d7 by keeping on the white squares, and then keep moving safely to and fro until black moves all its bishops away from the diagonal line they occupy at the start.  White then moves its pawn at c6 forward two squares, promotes it to queen, checkmating the black king.


----------



## mosaix (Mar 17, 2017)

Thanks TJ. 

Black would be insane to stop guarding c7 so, whilst not impossible, a win for White is improbable.  Black can't prevent a draw.


----------



## mosaix (Mar 17, 2017)

From the original article:

_As Sarah Knapton at The Telegraph explains, a computer will always assume the black player will win in this scenario, because seeing those three bishops will force it to perform a massive search of possible positions "that will rapidly expand to something that exceeds all the computational power on planet Earth".
_
I have to take issue with Sarah Knapton on two counts. Firstly, computers never 'assume' anything, they just follow their programming. And secondly, I just dug out my old version of Chess Master 8000 (about ten years old I think), set up the position and, in two games, let the computer play first black and then white. Rather than 'running out of computational power' as she says, both games ended in a draw under the 50 move rule with the computer taking about three minutes to consider all its moves and me about four minutes to consider mine and actually move my piece - with white it was always the king and with black always a bishop but leaving at least two bishops on the diagonal.


----------



## The Judge (Mar 17, 2017)

Well, there you are -- go and write in to Roger Penrose and tell him he got it wrong!


----------



## Ursa major (Mar 17, 2017)

Roger Penrose is _wrong_...?!

And to think I bought -- but have not yet read -- his book _The Emperor's New Mind_ only a couple of months back. 

​


----------

