r/MathHelp • • May 02 '20

Question involving discrete probability, my math's a bit rusty, would appreciate some help.

Hello mathbuffs,

Quick question. Imagine we have a 2x2 grid; g(1,1), g(2,1), g(1,2) and g(2,2). Now, we're going to place a building on each coordinate. There are 3 types of buildings; a building that takes one coordinate, a building that takes one vertical coordinate and two horizontal and a building that takes one vertical coordinate and two horizontal. For ease let's say if there is a (2,1) (horizontal long) building on a coordinate, that coordinate is 1, if there is a (1,2) (vertical long) building on a coordinate, that coordinate is 2 and if there is a single building on a coordinate, that coordinate is 3.

So, we could have g(1,1) = 1, g(2,1) = 1, g(1,2) = 3 and g(2,2) = 3, which means the grid has a big, horizontal building on the top and two smaller ones on the bottom. I'm interested in the probabilities that any one tile is any number {1,2,3}.

So starting at g(1,1), let's say it has a p=(1/3) to be either 1, 2 or 3. Then, g(2,1)'s probabilities are p(g(2,1) = 1) = 1 if g(1,1) = 1 and 0 if g(1,1) /= 1, so p(g(2,1) = 1) = p(g(1,1) = 1) = (1/3). p(g(2,1) = 2) = 0 if g(1,1) = 1 and 1/2 otherwise and p(g(2,1) = 3) = 0 if g(1,1) = 1 and 1/2 otherwise. So I conclude that for g(2,1) p=1/3 for either 1, 2 or 3.

Now, g(1,2) is where I'm having problems because, g(1,2) = 2 if g(1,1) = 2 (vertical building) so p(g(1,2) = 2) = p(g(1,1) = 2) = (1/3), p(g(1,2) = 3) = 0 if g(1,1) = 2 and (1/2) otherwise, but p(g(1,2) = 1) = 0 if g(1,1) = 2 or g(2,1) = 2 (because then g(2,2) will have to be 2 and won't be able to be 1) and 1/2 otherwise.

My math is rusty and I don't remember how to figure out how that bolded part affects the probabilities of g(1,2) being {1,2,3}. Any help appreciated. Thanks for reading.

9 Upvotes

2 comments sorted by

1

u/Naturage May 03 '20

The big issue is that your cells are not independent from one another, and hence the result depend on how exactly you define 'random'. Let's look at all possible configurations: A: 4x 1x1 buildings. B: building 2 in row 1, 1's below. C: 2 in row 2, 1's above. D: 3 in col 1, 1's to the right. E: 3 in col 2, 1's to the left. F: 2 2's. G: 2 3's.

So the question then boils down to: what are the probabilities of each A-G? Note that 'random' isn't specific enough: I could tell you each is 1/7 and you'd get one answer; I could tell A is 40% and others 10% each; again, random, but weighted to one outcome. I could rig it so 3's are way more common than 2's, but still random. In short, as it is the question is a bit poorly posed.

But you state that g(1,1) has 1/3 to be each 1 2 or 3; let's see if we can work with that. Then, outcomes A,C,E total 1/3, B and F total 1/3, and C,G total 1/3.

Also, we'd hope for symmetry - 2 is as likely on the left as on the right, and 3 as likely up as down. Further, 2s and 3s generally are equally likely. In other words, BCDE are all equally likely and FG are equally likely. Then the above becomes P(A)+2P(B)=1/3, P(B)+P(F)=1/3.

And yet, this isn't enough, since I can define you P(A),P(B) and P(F) in many ways and get different answers on "how likely is g(1,2)=3 if g(1,1)=1?"

In short - we lack info!

1

u/The0thArcana May 03 '20

Thanks for the response. Your way of looking at it makes things much clearer. Sorry for not providing all the necessary info, that's a little embarrassing.

What I want to do is program these permutations of buildings on tiles. I basically have a big grid of these 2x2s and every tile can have a subset of the total permutation ABCDEFG (because there are roads running between the middle of the edges to the center of the tile and you can't have a 2-long building where there is a road). I figured it would be better to program something that could look at every tile and randomly fill it in with one of the possibilities, but I didn't want to go "If grid(x,y) = TileA, choose randomly(ACDEFG)", "If grid(x,y) = TileB, choose randomly (ABCDF)", etc for every tile possibility. So I figured I'd do something like look at all possibilities for the upper left of grid(x,y), choose one randomly then move on to the upper right, etc. This seems much cleaner to program.

Ideally though I'd wish for every possibility on a given tile to have equal probability. Doing a little drawing I see now that assigning the first corner whatever it can be with equal probability, then looking at the next corner and choosing whatever it can be with equal probability given what has already been decided doesn't give every possibility equal chance.

Even though it seems very inelegant, I might have to go with "If grid(x,y) = TileA, choose randomly (ACDEFG)", etc. I'll think on it more, maybe there is a distribution that gives every possibility equal probability regardless of what tile it is. Thanks for the response.