Here's why... f=:0:@% ::1: _ f _ Linda 1
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Raul Miller Sent: Monday, November 16, 2015 1:46 PM To: Programming forum Subject: Re: [Jprogramming] Why is subtraction and division of rational numbers so hard? You might also like to see: L=:(-_),(-2%~1-~%:5),0,(2%~1-~%:5),_ 0:@% ::1:"0/~ L 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 Thanks, -- Raul On Mon, Nov 16, 2015 at 11:50 AM, Linda A Alvord <[email protected]> wrote: > Thanks Raul and Don, Here are some NaN meaNderings: > > > > [L=:(-_),(-2%~1-~%:5),0,(2%~1-~%:5),_ > > __ _0.618034 0 0.618034 _ > > > > %/~L > > |NaN error: scriptd > | %/~L > |[-2] c:\users\user\j804-user\temp\25.ijs > > > > > > L%/L > > |NaN error: scriptd > | L %/L > |[-4] c:\users\user\j804-user\temp\25.ijs > > > > L%/}.}:L > > _ __ __ > 1 __ _1 > 0 0 0 > _1 _ 1 > __ _ _ > > > > (}.}:L)%/L > > 0 1 __ _1 0 > 0 0 0 0 0 > 0 _1 _ 1 0 > > > > > > (}.}:L)%table L > > ----------T--------------------------┐ > │% │__ _0.618034 0 0.618034 _│ > +---------+--------------------------+ > │_0.618034│ 0 1 __ _1 0│ > │ 0│ 0 0 0 0 0│ > │ 0.618034│ 0 _1 _ 1 0│ > L---------+--------------------------- > > > > L%/table }.}:L > > ----------T---------------------┐ > │%/ │_0.618034 0 0.618034│ > +---------+---------------------+ > │ __│ _ __ __│ > │_0.618034│ 1 __ _1│ > │ 0│ 0 0 0│ > │ 0.618034│ _1 _ 1│ > │ _│ __ _ _│ > L---------+---------------------- > > > > Linda > > > > > > -----Original Message----- > > > > > From: [email protected] > [mailto:[email protected]] On Behalf Of Linda A > Alvord > Sent: Monday, November 16, 2015 9:31 AM > To: [email protected] > Subject: Re: [Jprogramming] Why is subtraction and division of rational > numbers so hard? > > > > Don, Can you identify which ones of the twenty five items in the pairs don't > work? > > > > %/~ 1r3%i.5 > > |NaN error > > | %/~1r3%i.5 > > > > Linda > > > > -----Original Message----- > > From: <mailto:[email protected]> > [email protected] > > [ <mailto:[email protected]> > mailto:[email protected]] On Behalf Of Don Kelly > > Sent: Monday, November 16, 2015 12:59 AM > > To: <mailto:[email protected]> [email protected] > > Subject: Re: [Jprogramming] Why is subtraction and division of rational > numbers so hard? > > > > Could it be that 1r3 % i.1 =(1/3)%0 so the result of the summation is > infinity + some numbers? > > try > > -/~ 1r3 %1 +i.5 > > > > 0 1r6 2r9 1r4 4r15 > > > > _1r6 0 1r18 1r12 1r10 > > > > _2r9 _1r18 0 1r36 2r45 > > > > _1r4 _1r12 _1r36 0 1r60 > > > > _4r15 _1r10 _2r45 _1r60 0 > > > > > > or > > -/~ 1r3 %1r1000000+i.5 > > > > 0 1000000000000r3000003 2000000000000r6000003 1000000000000r3000001 > > 4000000000000r12000003 > > > > _1000000000000r3000003 0 1000000000000r6000009000003 > > 2000000000000r9000012000003 1000000000000r4000005000001 > > > > _2000000000000r6000003 _1000000000000r6000009000003 0 > > 1000000000000r18000015000003 2000000000000r24000018000003 > > > > _1000000000000r3000001 _2000000000000r9000012000003 > > _1000000000000r18000015000003 0 1000000000000r36000021000003 > > > > _4000000000000r12000003 _1000000000000r4000005000001 > > _2000000000000r24000018000003 _1000000000000r36000021000003 0 > > > > > > Don Kelly > > > > > > On 11/15/2015 1:05 AM, Linda A Alvord wrote: > >> How would you explain to a 4th grade student why subtraction and > >> division of fraction is so difficult for J. Here is a dialog I wrote > >> to review all the big ideas students should remember from third grade. > >> Tables show how some verbs like + and times are commutative and * and > >> % are not. If the > > verb > >> is commutative you need only "master" a little more than half of the > > table. > >> > >> > >> > >> > >> > >> > >> > >> +/~i.5 > >> > >> > >> i. > >> 0 1 2 3 4 > >> > >> 1 2 3 4 5 > >> > >> 2 3 4 5 6 > >> > >> 3 4 5 6 7 > >> > >> 4 5 6 7 8 > >> > >> > >> > >> > >> > >> > >> > >> -/~i.5 > >> > >> > >> > >> 0 _1 _2 _3 _4 > >> > >> 1 0 _1 _2 _3 > >> > >> 2 1 0 _1 _2 > >> > >> 3 2 1 0 _1 > >> > >> 4 3 2 1 0 > >> > >> > >> > >> > >> > >> > >> > >> */~i.5 > >> > >> > >> > >> 0 0 0 0 0 > >> > >> 0 1 2 3 4 > >> > >> 0 2 4 6 8 > >> > >> 0 3 6 9 12 > >> > >> 0 4 8 12 16 > >> > >> > >> > >> > >> > >> > >> > >> %/~i.5 > >> > >> > >> > >> 0 0 0 0 0 > >> > >> _ 1 0.5 0.333333 0.25 > >> > >> _ 2 1 0.666667 0.5 > >> > >> _ 3 1.5 1 0.75 > >> > >> _ 4 2 1.33333 1 > >> > >> > >> > >> > >> > >> > >> > >> 1r3%i.5 > >> > >> > >> > >> _ 1r3 1r6 1r9 1r12 > >> > >> > >> > >> > >> > >> > >> > >> +/~ 1r3%i.5 > >> > >> > >> > >> _ _ _ _ _ > >> > >> _ 2r3 1r2 4r9 5r12 > >> > >> _ 1r2 1r3 5r18 1r4 > >> > >> _ 4r9 5r18 2r9 7r36 > >> > >> _ 5r12 1r4 7r36 1r6 > >> > >> > >> > >> > >> > >> -/~ 1r3%i.5 > >> > >> > >> > >> |NaN error > >> > >> | -/~1r3%i.5 > >> > >> > >> > >> > >> > >> */~ 1r3%i.5 > >> > >> > >> > >> _ _ _ _ _ > >> > >> _ 1r9 1r18 1r27 1r36 > >> > >> _ 1r18 1r36 1r54 1r72 > >> > >> _ 1r27 1r54 1r81 1r108 > >> > >> _ 1r36 1r72 1r108 1r144 > >> > >> > >> > >> > >> > >> > >> > >> %/~ 1r3%i.5 > >> > >> > >> > >> |NaN error > >> > >> | %/~1r3%i.5 > >> > >> > >> > >> > >> > >> > >> > >> t=: 13 :'>:/~i.y' > >> > >> > >> > >> t 5 > >> > >> > >> > >> 1 0 0 0 0 > >> > >> 1 1 0 0 0 > >> > >> 1 1 1 0 0 > >> > >> 1 1 1 1 0 > >> > >> 1 1 1 1 1 > >> > >> > >> > >> > >> > >> > >> > >> (t 5)*+/~i.5 > >> > >> > >> > >> 0 0 0 0 0 > >> > >> 1 2 0 0 0 > >> > >> 2 3 4 0 0 > >> > >> 3 4 5 6 0 > >> > >> 4 5 6 7 8 > >> > >> > >> > >> > >> > >> > >> > >> (t 5)**/~i.5 > >> > >> > >> > >> 0 0 0 0 0 > >> > >> 0 1 0 0 0 > >> > >> 0 2 4 0 0 > >> > >> 0 3 6 9 0 > >> > >> 0 4 8 12 16 > >> > >> > >> > >> > >> > >> > >> > >> (t 5)*+/~ 1r3%i.5 > >> > >> > >> > >> _ 0 0 0 0 > >> > >> _ 2r3 0 0 0 > >> > >> _ 1r2 1r3 0 0 > >> > >> _ 4r9 5r18 2r9 0 > >> > >> _ 5r12 1r4 7r36 1r6 > >> > >> > >> > >> > >> > >> > >> > >> (t 5)**/~ 1r3%i.5 > >> > >> > >> > >> _ 0 0 0 0 > >> > >> _ 1r9 0 0 0 > >> > >> _ 1r18 1r36 0 0 > >> > >> _ 1r27 1r54 1r81 0 > >> > >> _ 1r36 1r72 1r108 1r144 > >> > >> > >> > >> > >> > >> > >> > >> Linda I > >> > >> > >> > >> > >> > >> ---------------------------------------------------------------------- > >> For information about J forums see <http://www.jsoftware.com/forums.htm> > http://www.jsoftware.com/forums.htm > >> > > > > ---------------------------------------------------------------------- > > For information about J forums see <http://www.jsoftware.com/forums.htm> > http://www.jsoftware.com/forums.htm > > > > ---------------------------------------------------------------------- > > For information about J forums see <http://www.jsoftware.com/forums.htm> > 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
