Average Number of Fill Commands Needed to Turn a Billion Pixel Screen White

  • Context: Undergrad 
  • Thread starter Thread starter Bartholomew
  • Start date Start date
  • Tags Tags
    Paint Works
Click For Summary

Discussion Overview

The discussion revolves around the average number of fill commands needed to turn a billion-pixel screen white, focusing on the mathematical and probabilistic aspects of the problem. Participants explore concepts related to pixel distribution, clumping, and percolation theory, while considering both theoretical and empirical approaches to the problem.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant introduces the problem of filling a billion-pixel screen and questions whether it is a solved problem.
  • Another participant notes the complexity of the problem, emphasizing the changing distribution of pixels with each fill and the impact of locality on fill commands.
  • A third participant defines "clumps" as connected areas of the same color and suggests that the average number of fills relates to the number of clumps present on the screen.
  • One participant proposes that understanding the probability of pixels being in the same clump could help estimate the average size of clumps.
  • A later reply mentions percolation theory as relevant to the discussion and shares experimental results indicating a consistent number of clumps relative to the total number of pixels.
  • Another participant expresses confusion regarding the interpretation of s-clusters and their relation to the number of pixels, questioning the values presented in a referenced source.
  • One participant inquires about how another found a specific page related to s-clusters.

Areas of Agreement / Disagreement

Participants express various viewpoints and hypotheses regarding the problem, but no consensus is reached on a definitive solution or approach. Multiple competing ideas and uncertainties remain throughout the discussion.

Contextual Notes

Participants mention the complexity of pixel distribution and the irregularity of clump sizes, indicating that assumptions about pixel arrangement and fill methods may significantly affect outcomes. The discussion also highlights the potential for different interpretations of related mathematical concepts.

Bartholomew
Messages
527
Reaction score
0
You know how the fill tool in Paint works. If you have a really large computer screen (a billion pixels, say) and you fill each pixel in the screen randomly either black or white (equal probability either one), what is the average number of times you would have to use the fill command for turning black pixels white to then turn the entire screen white?

I just thought this up a little while ago and I have no idea how to do it except empirically. Is this a solved problem?
 
Physics news on Phys.org
It is an interesting problem.
I'm not sure there's an elegant way to solve it.

The mean number of pixels changed on each fill is related to the distribution of black and white pixels in the image and this distribution changes with each fill. This is also ignoring distribution locality (because a fill in general changes the distribution more significantly in its locality) which I imagine would be another factor.

Assuming a 3x3 pixel kernel and filling based on adjacency, another problem is that each progressive kernel overlaps the parent kernel and other sibling kernels which means that the probability distribution of finding n new unfilled pixels (accounting for sibling overlap) is very irregular, and that is without even taking into account parent overlap.

If anybody has any ideas on this one, I'd like to hear them. Perhaps I'm missing a very simple way of approaching this.
 
The problem is essentially the ratio of the number of "clumps" to the number of pixels. A clump is a single-color area so that every pixel in it is connected to every other pixel in it by a series of north, south, east, or west moves while not leaving the color. Also, for a clump to be a clump and not just a part of a clump, it must not be possible to include any additional pixels and still have all the pixels connected in that way.

One fill of black to white will delete one black clump.

The problem is easy in 1 dimension; the size of the clumps there has an exponential distribution, since a clump in 1 dimension is just a run of the same color.

I think if you could find the probability that any two randomly selected pixels are in the same (2-dimensional) clump, you could indirectly get the size of a clump. This might be easier to find or it might not; I don't know how to do it. Somehow you'd count the possible paths from one pixel to another and multiply each path by the probability of it being taken, and add all those together.

A possibly related problem which I came up with is, if you can use fills of BOTH black-to-white and white-to-black, how many fills would it take? If you try an experiment in paint using the spray gun to randomly fill one area until it's about half-and-half black and white, and then alternate between black-and-white and white-and-black, only a few clicks will clear everything.
 
The area of math dealing with this kind of problem would be percolation theory.

I wrote a program to run the problem experimentally and came up with a fairly consistent number of clumps. There were rougly 0.066A clumps where A is the total number of pixels.

I also came across s-Clusters and I found roughly the same value (0.065770) for the average number of clumps.
 
Well, that's the answer then. I don't understand what that site on s-clusters means, though, by "number of s-clusters for s = 0, 1, ..." Those values seem to add up to more than the number of pixels. For n = 2 you have a 2x2 grid, with 4 pixels, but the total # of clumps it seems to indicate is 16. Even looking at all possible arrangements, there are only 10 possible groups of size 1 in such a grid, and it indicates 13. What is it counting?
 
By the way, if you don't mind my asking, how did you find that page?
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
8
Views
5K
  • · Replies 14 ·
Replies
14
Views
6K
Replies
3
Views
3K
Replies
10
Views
5K
  • · Replies 37 ·
2
Replies
37
Views
5K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 43 ·
2
Replies
43
Views
12K