Subject: An easy riddle
From: mslamm@pluto.cc.huji.ac.il (Zvi Lamm)
Date: 31 Jan 1995 11:27:41 GMT

This is a simple riddle I arrived at while playing with J. Some of you
may find it too trivial, but those of you who teach may try it on their
students and tell us the result...

The idea is to investigate the hook +* whichdyadically means add to sign
of.
Now we define
	check=.(+*)/@(,@((*&1 _1)"0@i.))
check 2, check 3 , check 4 etc are all 1!!! Why??? (I said it is easy...)

When teaching, note that with just to more chars we can have a nice trace
	check2=.(+*)/\.@(,@((*&1 _1)"0@i.))

Exercise: explain the trace.
Exercise 2: modify check2 so that it gives the trace of check 1, check 2
etc. up to a parameter n.

Really simple, but I find silly simple examples really helpful. I just
saw it is always one and went on to investigate... It wasn't hard to
write the J tacit defintion, whcih goes to show I am getting a little
better.... :-)

--
