1
$\begingroup$

I'm not a mathematician, so excuse the informality, but I've begun thinking about the following problem:

How can we randomly generate a whole number from 1-5 on a matrix (imagine a chess board) such that each number is must be within 1 of all of the numbers next to it?

Obviously since each number is dependent upon all of the other numbers next to it, the question becomes "where to start." Of course I've heard of conditional random variables, but in these cases there is always a sort of sequential "order" between the variables in question.

Idea 1: Pick a starting point, say the upper left corner, and generate all other numbers sequentially. This one isn't ideal, as the first few numbers isn't really conditioned on anything.

Idea 2: Repeatedly randomly generate an entire matrix, until we have one that satisfies our rules. I like this idea a lot more.

Any links/ideas/references on this topic would be great appreciated!

Liz

  • 1
    The second idea is very slow.2017-02-20
  • 0
    By "next to" do you mean horizontally and vertically, or diagonally as well?2017-02-20
  • 0
    I would start in one corner and proceed iteratively to construct a valid $2\times 2$, $3\times 3$, etc. matrix until the desired size is created. I believe that algorithm would be correct, although that would need to be proven.2017-02-20

0 Answers 0