- is always a verb, which negates its right argument. -1 0 1 is - (1 0 1), or _1 0 _1; so p. solves -x^2 - 1 = 0. I expect you want _1 0 1.

 -E

On Sun, 24 Oct 2021, More Rice wrote:

Thank you Elijah.  There is a lot for me to unpack in your approach.  I
need a cup of coffee and chew on it deeply in the morning.

Thanks again Raul.  I looked at the p. verb before - this verb feels kind
of strange.

For this specific case (x^6+1=0) and the example in NuVoc, they work
nicely!  I tried something even simpler when I first saw it:  x^2 - 1 = 0.
The answer looks very strange.

  p. -1 0 1
+--+--------+
|_1|0j1 0j_1|
+--+--------+

So, I have always thought the p. verb is designed for a special kind of
polynomial which I don't currently understand, and opted to use the Euler
formula based approach instead.

Or am I using the p. wrong?


Maurice

On Sat, Oct 23, 2021 at 9:00 PM Elijah Stone <[email protected]> wrote:

Here is a fun party trick:

    rt=. (] %: -@[) * [: ^ [: j. ] %~ 1p1 + 2p1 * i.@]
    pw=. ^ :. rt
    f=. 1 + ] pw 6:
    (f^:_1) 0
0.866025j0.5 6.12323e_17j1 _0.866025j0.5 _0.866025j_0.5 _1.83697e_16j_1
0.866025j_0.5
    f (f^:_1) 0
_2.22045e_16j6.10623e_16 0j3.67394e_16 _2.22045e_16j_6.10623e_16
_2.22045e_16j2.05391e_15 0j1.10218e_15 0j3.10862e_15

(Sadly, the inverter is not smart enough to invert e.g. 1 + pw&3 + pw&6,
so p. is probably the more practical solution.)

  -E

On Sat, 23 Oct 2021, More Rice wrote:

> Thank you for the notes - I'll keep it in my bookmark as reference!
>
> I started out this morning with my pre-calculus book trying to practice J
> sentences with.  I wanted the numeric answers for complex roots.  Like:
>
> // matlab version
> syms x
> eqn = x^6+1 == 0
> solve(eqn, x)
>
> But, it seems J only gives the principal root (?), not all 6 of them; so,
> another opportunity for practise.  But, I ended up writing like ...
> "matlab":
>
>   ^ 0j1 * (1p1 + 2p1 * i.6) % 6  NB. 1st version
>
> That was why I was browsing NuVoc, looking for examples/ideas, hoping to
> see something to make my J sentence looks more ... "J-idiomatic" (while
> learning something out of the process).
>
> This is all I can I come up with today:
>
>   ^ 0j1 * 6 %~ 1p1 + 2p1 * i.6   NB. 2nd version
>
> How would the same answer look like in the eyes of J Masters?
>
>
> thanks for your thoughts.
>
> On Sat, Oct 23, 2021 at 4:18 PM 'Pascal Jasmin' via Programming <
> [email protected]> wrote:
>
>> a more hollistic explanation,
>>
>> Most conjunctions, and including the & and @ famillies, produce verb
>> phrases when bound.  A verb or verb phrase can/has to produce different
>> results/computations depending on monadic or dyadic cases.  In u@v, u
is
>> always monadic, and v is ambivalent.  in u&v, v is always monadic, and
u is
>> the valence of the verb phrase.
>>
>> A missing "composing conjunction" in J is ([ u v)  where u is always
>> dyadic and v is ambivalent.  But the fact that it is easy to write as a
>> fork suggests a dedicated conjunction is not needed.
>>
>>
>> On Saturday, October 23, 2021, 03:30:09 p.m. EDT, Raul Miller <
>> [email protected]> wrote:
>>
>>
>>
>>
>>
>> https://www.jsoftware.com/help/dictionary/d631.htm
>>
>>   x u&.v y ↔ vi (v x) u (v y)
>>
>> Here:
>>   u is +
>>   v is *:
>>   vi is %: (or *:inv)
>>   x is 3
>>   y is 4
>>
>> So these are equivalent
>>   3 +&.*: 4
>>   %: (*:3) + (*: 4)
>>   *:inv (*:3) + (*: 4)
>>
>> I hope this makes sense.
>>
>> --
>> Raul
>>
>> On Sat, Oct 23, 2021 at 3:03 PM More Rice <[email protected]> wrote:
>> >
>> > Hello,
>> >
>> > (Sorry for the previous empty email - web page problem)
>> >
>> > please excuse another newbie question ...
>> >
>> > Ref: https://code.jsoftware.com/wiki/Vocabulary/starco
>> >
>> >    pythag =:  +&.*:
>> >    3 pythag 4
>> > 5
>> >
>> > + operated dyadically and acted on both x and y - ok.
>> >
>> > but how does *: know to act on x as well?  Isn't pythag using the
monadic
>> > definition of *: to square y only?
>> >
>> > so magical ...
>> >
>> > thank you for the pointer and have a great weekend.
>> >
>> >
>> > Maurice
>> > ----------------------------------------------------------------------
>> > For information about J forums see
http://www.jsoftware.com/forums.htm
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
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