Thanks, Bill,
Under no circumstances do I want to bother experienced and effective J
users like yourself with change. I did say originally that: "The existence
of a J mutation would need to be totally transparent to J programmers,
requiring them to make no adjustments whatsoever." I only want to attract a
much larger group of potential users - teachers - a group that intersects
little with J users.
The only reason that I submitted this to the chat forum was to get some
help. It has been successful. I have had a lot of help and am very grateful
for it.
It is very difficult to express Mathematics on an ASCII page, but I will
do my best. I will use Ric's method of representing Sigma with a large "E"
and "/" for square root. In a classroom, I would want to develop the
mathematical formula - maybe on a blackboard or Powerpoint - in parallel
with an S model. As the formula develops, it can be tested at each step with
the S model (which would be the same as the J model until we try to store
it). In what is below, the mathematical formula is after NB.
In doing this, you will note that there is nothing that that resembles
Computer Science. No subroutines, one line only and no administrative
inserts like: program =: dyad : 0. S - or unstored explicit one line J -
is just an alternative language for expressing mathematical formulae.
One might ask whether two languages at the same time can cause
confusion. I can only say that some of my grandchildren have gone
through French immersion programs where they learn in French.
Their English is better as a result, because the differences highlight
the structure of language and it has helped them better understand
their own language.
Don.
========== J session ===========================================
NB. The sum of the values is:
+/y NB. Ey
24
NB. the number of values is:
#y NB. N
6
NB. the sum divided by the number is:
24 % 6
4
NB. We can do this in one step:
(+/y) % #y NB. Ey/N
4
NB. The deviations from the mean are:
y - (+/y) % #y NB. y - Ey/N
0 1 2 _2 _1 0
NB. the sum of their squares is
+/ *: 0 1 2 _2 _1 0
10
NB. or combined: 2
+/ *: y - (+/y) % #y NB. E (y - Ey/N)
10
NB. now multiply by the reciprocal of
1 less than the number of values 2
(%<:#y) * +/ *: y - (+/y) % #y NB. 1/N-1 E (y - Ey/N)
NB. and finally take the square root:
%: (%<:#y) * +/ *: y - (+/y) % #y 2
~ NB. / 1/N-1 E (y - Ey/N)
1.41421
NB. It is again helpful to define the formula as a verb for easy reuse.
stddev=: %: (%<:#y) * +/ *: (]) - (+/) % # 2
NB. stddev = / 1/N-1 E (y - Ey/N)
stddev y
1.41421
stddev 3 7 4 5 8 2 3 4 5
1.94365
=====================================================
---- Original Message -----
From: "bill lam" <[email protected]>
To: <[email protected]>
Sent: Thursday, April 23, 2009 10:16 AM
Subject: Re: [Jchat] Language S
> On Thu, 23 Apr 2009, Don Watson wrote:
>> %: (<:#y) %~ +/ *: y - (+/y) % #y
>> 1.41421
>> NB. It is again helpful to define the formula as a verb for easy
>> reuse.
>> NB. Remember from all our previous work that before we store it,
>> we take out all of the "y"s to the left of a right parenthesis
>> NB. Where a "y" is to the left of a verb, we need to replace it with
>> (])
>> stddev=: %: (<:#) %~ +/ *: (]) - (+/) % #
>
> I see you point now. It is easier to arrive a pseudo tacit form
> without knowing what a fork is. However I prefer to write tacit form
> if that is within my capacity otherwise I just write explicit
> definition shamelessly, not even bother to cheat with `13 :'.
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> 唐詩028 韋應物 初發揚子寄元大校書
> 悽悽去親愛 泛泛入煙霧 歸棹洛陽人 殘鐘廣陵樹
> 今朝為此別 何處還相遇 世事波上舟 沿洄安得住
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm