Dan,
I have one clear problem with your solution for N =
38: the last solution, 12 2, produces 14, not 4, boxes. A
lesser problem is that I meant, but did not explicitly
require, that the width>inc because I want actual overlap.
It appears that if that implicit condition is met, then the
"clear problem" might disappear.
I cannot quite understand the principle behind your
code yet, so I cannot comment on it yet. But it looks like
you are on the right track, if in fact you are not correct.
Thanks.
On Fri, 4 May 2007, Dan Bron wrote:
+ Brian,
+
+ I don't have the energy to write up a longer answer, but is this the
following what you seek?
+
+ P =: verb define
+ 4 P y
+ :
+ dc =. <: card =. x
+ N =. y
+
+ 'm n' =. N #:~ 0 , dc
+ |: (1 , n) + (1 , dc) * (,:&:i. -) m
+ )
+
+ For a given N , that verb will produce all the pairs of inc,width which
satisfy your cut-stipulations:
+
+ P 38
+ 1 35
+ 2 32
+ 3 29
+ 4 26
+ 5 23
+ 6 20
+ 7 17
+ 8 14
+ 9 11
+ 10 8
+ 11 5
+ 12 2
+
+ 8 14 e. P 38
+ 1
+
+ 98 106 e. P 400
+ 1
+
+ The optional stipulation is satisfied with {:@:P .
+
+ -Dan
+ ----------------------------------------------------------------------
+ For information about J forums see http://www.jsoftware.com/forums.htm
+
(B=) <----------my "sig"
Brian Schott
Atlanta, GA, USA
schott DOT bee are eye eh en AT gee em ae eye el DOT com
http://schott.selfip.net/~brian/
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm