You are looking for a solution given any F?

If F is [, no solution is possible.

Henry Rich

Yuvaraj Athur Raghuvir wrote:
> Dear J Forum,
> 
> I have an interesting problem for which I need more insights to proceed.
> 
> I have to determine three unknowns:
> (a) W where 2 = $W = w1, w2
> (b) L where 3 = $ L = l1 , l2 , l3
> (c) F a dyad that takes scalar inputs
> 
> Such that
> (6 1 5 2 3 4) -: \:; L F"0 0/ W NB. the order of values is known.
> 
> For example,
>     F =: *
>     (6 1 5 2 3 4) -: \:; L F"0 0/ W  [W =. 3 9 [L =. 20 16 12
> 0
> 
> I designed a test that is essentially a blind brute force on the inputs
> assuming F is given:
> F =: 4 : 'x^2 - y^2' NB. for example
> odometer =: #: i.@(*/)
> test =: 3 : 0
>  n =. y
>  w =. odometer n,n
>  l =. odometer n,n,n
>  NB. I get a length error if I use bigger inputs. So chunking into 100's
>  for_i. i. 100 %~ {. $l do.
>   for_j. i. 100 %~ {. $w do.
>    b =. ('' -: I. (6 1 5 2 3 4) -:"1 1 (>@[ \:@,"_1@:(F"0 0/"1 1) >@])/
> (_100{.(100*>:i){. l);(_100{.(100*>:j){. w))
>    smoutput i,j
>    if. b<1 do. break. [smoutput 'found it';i;j end.
>   end.
>  end.
>  ''
> )
> 
> I am not convinced that I can find a solution this way since the functional
> forms are far too many to be tried out notwithstanding my other assumptions.
> 
> 
> Any suggestions?
> 
> Regards,
> Yuva
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to