Raul,

        You are correct that I should not have used the term
partition because I want overlaps between the intervals. I
am sorry for that confusion.

        I believe your verb part is meant to have the width
as the left argument (x) and N as the right argument (y). If
that is right then I believe part does create intervals that
satisfy the requirements, but I guess there was another
requirement that I did not make clear, namely that the
intervals must be constructible with  <;._3 and yours don't.
That is the overlaps are not the same between intervals.

        I guess I needed to be more careful in stating my
problem. I apologize for this lack of clarity.

On Fri, 4 May 2007, Raul Miller wrote:

+ On 5/4/07, Brian Schott <[EMAIL PROTECTED]> wrote:
+ >        Consider the following expression. For what values
+ > of width, inc, and N do the following three properties of
+ > partition hold?
+ > a)      the cardinality (#) of partition = 4,
+ > b)      #&, of each box of partition = width,
+ > c)      the last atom in the last box of partition = N-1
+
+ I think you are describing a sequence of four boxes,
+ each of which contains width atoms, with the last
+ atom of each box held constant.
+
+ Without any other constraints, it seems to me that the
+ other atoms in these boxes could be picked randomly
+ and */ of the shape of any of these boxes needs to total
+ to width.
+
+ However, since you are calling this a partition, that
+ implies you have some input data that you are partitioning?
+ If so, this need not be solvable (since N-1 need not be
+ an atom in this data which is being partitioned.
+
+ > Sample answer 1 with N = 400:
+ >
+ >   (#,{:)&,each((1,inc ),:1,width) <;._3 ,: i. 400[inc =. 98[width=.106
+ > +-------+-------+-------+-------+
+ > |106 105|106 203|106 301|106 399|
+ > +-------+-------+-------+-------+
+
+ Ok, here it looks like what you want is integers 0..N-1 broken up
+ into four groups, but I would not call this a partition (because, for
+ example, the index 98 appears in two different groups).
+
+ If indices can be repeated you have a huge variety of potential
+ solutions (depending on which indices you duplicate).  Also,
+ note that in this particular case you have applied a shape of 1 106
+ to the contents of each of the boxes, but 1 2 1 53 1 (for example)
+ would also be a viable shape.
+
+ Anyways, assuming that width does not exceed N, I think
+ this will at least do what you've specified:
+
+ part=:] (] - 0&>.@>:@-~&{:)L:0 [EMAIL PROTECTED] <"1@|:@:(+/) 0 1 2 3 * 4 
>[EMAIL PROTECTED] ]
+
+ >        To be completely honest, I think I have a suitable
+ > answer for my immediate needs, the solution above with N =
+ > 400, but I wonder if there is a general solution and problem
+ > formulation.
+
+ Given the loose constraints, I think there are many general solutions,
+ some probably more concise than mine.
+
+ --
+ Raul
+ ----------------------------------------------------------------------
+ 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

Reply via email to