# Random arrangement of marbles on a surface; how many with neighbors of the same color?

**URL:** <https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553>\
**Category:** Factual Questions\
**Created:** [December 1, 2016, 8:20pm UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553 "2016-12-01T20:20:39Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruken](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@Ruken](https://boards.straightdope.com/u/Ruken)\
**Post date:** [December 1, 2016, 8:20pm UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/1 "2016-12-01T20:20:39Z")

</div>

For a (111) surface, sufficiently large to ignore boundary effects, comprising a random arrangement of marbles of two colors, red and black, what is the percent of red marbles with 0, 1 . . . 6 red neighbors as a function of the red/black ratio?

That’s not actually the problem I need to solve, but this one should move me in the right direction. I’m just not sure what kind of math this is. I may just Monte Carlo the damn thing if I can remember how to do that, but I’d like to know of a more elegant approach if there is one. I suspect this is a solved problem.

Or course, “random” means there’s a chance all the red marbles are packed together, and a chance they’re spaced as far away as possible, and everything in between. So we need to account for that.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [December 1, 2016, 8:47pm UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/2 "2016-12-01T20:47:15Z")

</div>

I think that the arrangement of the balls on the table is a red herring. The simpler equivalent problem is just “Take six marbles at random. What is the chance that _n_ of them are red?”, which is just a [binomial distribution](https://en.wikipedia.org/wiki/Binomial_distribution).

---

<div class="post-metadata">

**Author:** ![MikeS](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@MikeS](https://boards.straightdope.com/u/MikeS)\
**Post date:** [December 1, 2016, 8:48pm UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/3 "2016-12-01T20:48:45Z")

</div>

If the fraction of the total marbles that are red is _p_, then the probability of having N red marbles out of 6 bordering a given marble is given by the binomial distribution:

Prob. = [6!/(N! \* (6-N)!)] p[sup]N[/sup] (1 - p)[sup]6 - N[/sup]

So for each N, we have:[ul][li]N = 0: Prob. = (1-p)[sup]6[/sup][/li][li]N = 1: Prob. = 6 p (1-p)[sup]5[/sup][/li][li]N = 2: Prob. = 15 p[sup]2[/sup] (1-p)[sup]4[/sup][/li][li]N = 3: Prob. = 21 p[sup]3[/sup] (1-p)[sup]3[/sup][/li][li]N = 4: Prob. = 15 p[sup]4[/sup] (1-p)[sup]2[/sup][/li][li]N = 5: Prob. = 6 p[sup]5[/sup] (1-p)[/li]N = 6: Prob. = p[sup]6[/sup][/ul]

---

<div class="post-metadata">

**Author:** ![Ruken](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@Ruken](https://boards.straightdope.com/u/Ruken)\
**Post date:** [December 1, 2016, 9:08pm UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/4 "2016-12-01T21:08:51Z")

</div>

Oh good, much simpler than I was expecting. Thanks much. It might get weird with my actual problem, but I haven’t figured out what that is yet. This will get me started.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [December 1, 2016, 11:18pm UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/5 "2016-12-01T23:18:56Z")

</div>

There’s an implicit assumption here that the surface is densely packed.

What’s the definition of “neighbor” if the surface has lots more surface area than it has marbles?

Is my distinction relevant to the OP’s stated question or his underlying real question?

Did I miss something explicit in the problem statement?

---

<div class="post-metadata">

**Author:** ![OldGuy](https://avatars.discourse-cdn.com/v4/letter/o/3bc359/32.png) [@OldGuy](https://boards.straightdope.com/u/OldGuy)\
**Post date:** [December 1, 2016, 11:57pm UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/6 "2016-12-01T23:57:37Z")

</div>

> [@LSLGuy](#):
>
> There’s an implicit assumption here that the surface is densely packed.

If the surface is not densely packed, then there are three “colors”, red, black and empty. But if you’re only worried about reds being together, then you only need consider red and not red. p would now be the fraction (#red)/(#total spaces), and the same formula applies.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [December 2, 2016, 2:50am UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/7 "2016-12-02T02:50:06Z")

</div>

Not true.

What is the definition of neighbor? For a dense pack there can be no more than 6 neighbors since circles tile the plane as hexagons.

Once the surface is not dense packed then the number of neighbors depends on your definition. And may be in the thousands. Or may be limited to at most 1. In neither case does the straightforward binomial distribution apply.

---

<div class="post-metadata">

**Author:** ![OldGuy](https://avatars.discourse-cdn.com/v4/letter/o/3bc359/32.png) [@OldGuy](https://boards.straightdope.com/u/OldGuy)\
**Post date:** [December 2, 2016, 2:59am UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/8 "2016-12-02T02:59:46Z")

</div>

> [@LSLGuy](#):
>
> Not true.
> 
> What is the definition of neighbor? For a dense pack there can be no more than 6 neighbors since circles tile the plane as hexagons.
> 
> Once the surface is not dense packed then the number of neighbors depends on your definition. And may be in the thousands. Or may be limited to at most 1. In neither case does the straightforward binomial distribution apply.

True if that’s your interpretation. I was assuming neighbor meant neighboring cell. There are always six of those.

---

<div class="post-metadata">

**Author:** ![Leo\_Bloom](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/leo_bloom/32/10377_2.png) [@Leo\_Bloom](https://boards.straightdope.com/u/Leo_Bloom)\
**Post date:** [December 2, 2016, 3:00am UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/9 "2016-12-02T03:00:14Z")

</div>

/this is not snark…this is a real question…it’s a tad embarrassing…

Since you’re all here, how do you pronounce “chi-squared?” Like the tea thing? (Oy, t-squared play unintended.)

---

<div class="post-metadata">

**Author:** ![lazybratsche](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@lazybratsche](https://boards.straightdope.com/u/lazybratsche)\
**Post date:** [December 2, 2016, 3:20am UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/10 "2016-12-02T03:20:32Z")

</div>

“Chi” is the Greek character, pronounced with a hard C: “Kai”.

---

<div class="post-metadata">

**Author:** ![Ruken](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@Ruken](https://boards.straightdope.com/u/Ruken)\
**Post date:** [December 2, 2016, 4:25am UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/11 "2016-12-02T04:25:24Z")

</div>

I was assuming a packed surface

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [December 2, 2016, 12:23pm UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/12 "2016-12-02T12:23:30Z")

</div>

The OP did say a (111) surface, which is crystallography terminology for that sort of hexagonal packing.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [December 2, 2016, 4:38pm UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/13 "2016-12-02T16:38:48Z")

</div>

> [@Chronos](#):
>
> The OP did say a (111) surface, which is crystallography terminology for that sort of hexagonal packing.

And there we have it. Not a notation I was familiar with. Thanks for closing the loop for me.

Time for a Wikigrination.

---

<div class="post-metadata">

**Author:** ![Some\_Call\_Me.Tim](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Some\_Call\_Me.Tim](https://boards.straightdope.com/u/Some_Call_Me.Tim)\
**Post date:** [December 2, 2016, 6:03pm UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/14 "2016-12-02T18:03:23Z")

</div>

> [@Chronos](#):
>
> The OP did say a (111) surface, which is crystallography terminology for that sort of hexagonal packing.

A quibble: (111) is not a specification of the kind of lattice (presumably hexagonal close-packed or face-centered cubic in this case) but is rather a three-dimensional specification of the orientation of the plane along which such a crystal would need to be cut in order to create the specified surface. After all, one could imagine cutting a real crystal of close-packed spheres along any number of planes that would not give a nice flat surface of spheres with six neighbors. A (111) plane in particular intersects each (x, y, and z) axis an equal distance from the origin.

---

<div class="post-metadata">

**Author:** ![Leo\_Bloom](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/leo_bloom/32/10377_2.png) [@Leo\_Bloom](https://boards.straightdope.com/u/Leo_Bloom)\
**Post date:** [December 2, 2016, 6:08pm UTC](https://boards.straightdope.com/t/random-arrangement-of-marbles-on-a-surface-how-many-with-neighbors-of-the-same-color/773553/15 "2016-12-02T18:08:34Z")

</div>

> [@LSLGuy](#):
>
> …  
> Time for a Wikigrination.

🙂
