Suppose we have a $6\times 6\times 6$ cube such that it has $216$ subcubes, each with a visible, discernible light in it. A random number generator is connected to the cube and it will choose $128$ random numbers from $1$ to $216$ inclusive so that each subcube is addressable and equally likely to get picked/addressed by each random number. All the lights initially are off. Each time a subcube is addressed by the random number generator, the corresponding light gets toggled in a specific way. If the light is off, it will simply then be turned on. If it is already on, then it will be turned off, but also its neighbors will be "straight" toggled, meaning off becomes on and vice versa but the algorithm is not recursive for those neighbors. A neighbor of subcube x is defined as any subcube immediately adjacent to x (not more than $1$ subcube away). This includes diagonal neighbors as well since those are considered $1$ subcube away for this problem. Wraparound is not allowed so the corner subcubes for example have fewer neighbors than a subcube towards the center of the main cube. Neighbors in other adjacent planes are possible including diagonals in a neighboring plane. As long as it is "1 light away" in any direction.
So there are $3$ questions here:
$1$) What will be the average # of lights on after this process?
$2$) How many rows, cols, and diags of exactly length $4$ are possible in the main cube? That is, out of any $6$ collinear subcubes (in any direction), how many "lines" are possible with exactly $4$ adjacent (of the $6$) subcubes lit? See question #$3$ for an example.
$3$) What will be the average # of "lines" lit of length $4$ in the cube after this process? A lit "line", (of length $4$), is defined as any $4$ collinear adjacent lit lights not also having an adjacent $5$th collinear lit light. For example, lets suppose the front top row of the cube has addresses $1,2,3,4,5$ and $6$. A lit "line" of length $4$ would be if $2,3,4$ and $5$ are lit but not $1$ or $6$. That is, $1$ and $6$ must both be off in that example. Another "good" case is if $1,2,3$ and $4$ are lit and $5$ is off. $6$ in that case is a "don't care" situation (it can be either on or off it doesn't matter for that particular row, but it may matter for some other "line").
For question # $1$, so far I am getting $107.6$ lights on if I choose $128$ random addresses and follow the neighbor cluster toggle algorithm. If I drop from $128$ to $64$, I get $95.5$. If I drop again to $32$ I get $54.5$. This makes sense because the fewer random address we choose, the less likely we will get a "collision" and thus have to toggle a neighbor cluster (which if fewer than half the lights are on should increase the # of lit lights). I can see a side effect of this too in my simulation program. As I decrease the # of random addresses (like from $128$ to $64$ and again from $64$ to $32$), the process runs much faster, because it doesn't have to do as many neighbor cluster toggles.
For question # $2$, so far I am only checking rows, cols, and diags on the front side of each of the $6$ planes and am getting slightly under $4$ of those of exactly "length" $4$. I still have a lot more to check. I guess it would help if we knew how many possible "lines" of length exactly $4$ are possible in the cube so I will add that question to my main post.
b.t.w. and f.y.i., it is interesting to point out that the # of combinations of $108$ on lights (out of $216$ subcubes) is $216 \choose 108$which is about $5.7$ vigintillion which is $5.7\times 10^{63}$. So even if I simulated $1$ trillion ($10^{12}$), that is only a small "chunk" of the possible number of lit states. So an exact answer to my question may not be possible, just an approximation.
There is a downward bias because you only turn one on, but can turn many off. If all the lights were in the middle, they would have $26$ neighbors. If $f$ is the fraction of lights on, the long term average would satisfy $f=(1-f)+f(1+26f-26(1-f))$ where the first term comes from turning a light on and the second counts how many lights get turned off. This has an equlibrium at $f=\frac 1{104}(23+\sqrt{737})\approx 0.48219$ The close boundaries on your cube increase the fraction on. You can make a Marcov chain to see the chance each light is on. You can use symmetry to reduce the size of the matrix.