This is more exploratory Commentary than an Answer.
As far as I can see this will be a fairly messy problem.
For simplicity, let's start by figuring out if any of the ten rows
on your 'screen' will have six or more pixels of the same color
in a row.
Begin by using R to simulate the probability of getting a run of six or more
pixels of the same color in a single row of ten positions.
[Colors RGB are denoted 123; rle
is R's 'run length encoding' function,
from which we can get the lengths of runs of colors, and hence the maximum
run length. At the end of the simulation mx >= 6
is a logical vector
of a million TRUE
s and FALSE
s; mean(mx >= 6)
is the proportion of its
TRUE
s.]
set.seed(2019) # for reproducibility
col = 1:3
mx = replicate( 10^6, max(rle(sample(col, 10, repl=T))$len) )
p = mean(mx >= 6); p
[1] 0.015034
Thus the probability of a run of five of one color in one row of ten pixels
is $p = 0.015.$ With a million iterations, this result should be accurate to about three decimal places.
[There is considerable literature on counting numbers of runs; you may prefer to use ideas there to get an exact result by
analytic means. There are users of this site who are better at combinatorial
computations than I; maybe someone will post a better answer.]
Now let the random variable $X$ be the number of such color runs among ten independent rows, where $X \sim \mathsf{Binom}(10, p).$ We find
$$P(X > 0) = 1 - P(X = 0) = 1 - (1-p)^{10 }\approx 0.14.$$
1 - pbinom(0, 10, p)
[1] 0.1405663
The answer for columns on your screen should be the same. It will be a little
more difficult to find the probability of $2 \times 3$ arrays of color-matched pixels and then the probability that any one of the four configurations you
mentioned will occur. (Because the four types of outcomes are not
mutually exclusive, the last step will not be as simple as adding four
probabilities.) Finally, to me, it seems a bit arbitrary not to include patterns
such as the one below (in which *
is a non-red pixel):
***RRRR***
****RR****
Note: Here is a demonstration of getting mx
from one simulated
row of ten, for which the maximum run happened to be of length 3.
row = sample(1:3, 10, repl=T); row
[1] 1 1 3 3 2 2 2 1 3 2 # RRBBGGGRBG
rle(row)
Run Length Encoding
lengths: int [1:6] 2 2 3 1 1 1
values : int [1:6] 1 3 2 1 3 2
rle(row)$len
[1] 2 2 3 1 1 1
max(rle(row)$len)
[1] 3