Ooops. You are right. I mis-copied the last dimension. :-(
Sorry for the confusion.

The problem I was working on, was to try to find all the ways to place 2"x
2" tiles non-overlapping on a 3"x 8" grid.
I know there's a technique called linear difference equations that can
solve this problem, but I wanted to try to
model it by brute force. So I generated all 16777216 possible 3x8 grids of
1s & 0s.

odo=:#: i.@(*/)

$n=.odo 24#2

16777216 24

$ns=.16777216 3 8$,n

16777216 3 8

_3{.ns

1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1

1 1 1 1 1 1 0 1


1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 0


1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1

That fixed my problem, with the right dimensions. Now comes the hard part.
The problem now is to find all the 3x8 grids that only

have 2x2 blocks of non-overlapping 1s in them, and no isolated 1s or
non-2x2 groups of 1s.

Skip


On Tue, May 26, 2020 at 12:34 PM Skip Cave <s...@caveconsulting.com> wrote:

> odo=:#: i.@(*/)
>
> $n=.odo 24#2
>
> 16777216 24
>
> _3{. n
>
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1
>
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
>
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
>
> _48{. ,n
>
> 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1
> 1 1 1 1 1 1 1 1 1 1 1
>
> $ns=.16777224 3 8$,n
>
> 16777224 3 8
>
> _3{.ns
>
> 0 0 0 0 0 0 0 0
>
> 0 0 0 0 0 0 0 0
>
> 0 0 0 0 0 1 0 1
>
>
> 0 0 0 0 0 0 0 0
>
> 0 0 0 0 0 0 0 0
>
> 0 0 0 0 0 1 1 0
>
>
> 0 0 0 0 0 0 0 0
>
> 0 0 0 0 0 0 0 0
>
> 0 0 0 0 0 1 1 1
>
>
> Shouldn't the last few 3x8 arrays in ns be almost all ones, and the last
> array definitely all ones?
>
>
>
> Skip Cave
> Cave Consulting LLC
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to