Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!mach1!torn!howland.reston.ans.net!ira.uka.de!news.dfn.de!news.uni-bielefeld.de!wiwimac1.uni-bielefeld.de!Berni
From: Berni@nw42.wiwi.uni-bielefeld.de (Bernhard Strohmeier)
Subject: APL2 programming contest: The fastest #contab# function
Sender: news@hermes.hrz.uni-bielefeld.de (News Administrator)
Message-ID: <Berni.9.0@nw42.wiwi.uni-bielefeld.de>
Date: Wed, 12 May 1993 08:24:18 GMT
Nntp-Posting-Host: wiwimac1.uni-bielefeld.de
Organization: Fak. WiWi, Statistik und Informatik
Lines: 40

Hello,
I am looking for the fastest APL2 function which computes the contingency 
table from a (n x 2)-matrix of sample pairs of discrete random variables X 
and Y.

Example:  
MAT      
  2 2       
  2 3      
  3 4      
  1 3      
  3 4     
 -3 1    
0.2 2
  3 4
  2 2
  1 3
  
contab MAT
   
X\Y  1  2  3  4  
-3  .1  0  0  0  
.2   0 .1  0  0
 1   0  0 .2  0
 2   0 .2 .1  0
 3   0  0  0 .3

I wrote the first version of #contab# a week ago, but my collegue P.Wolf 
immediately wrote #contab1# which was about 4 times faster. Then I 
improved my function (#contab2#) and was ahead ... 
The state of the art is #contab11#, which was unfortunately written
by P.Wolf who proposes, that probably only a few people in the world can 
write a faster #contab# function. 

(#contab11# on a 1000 by 2 matrix needs [486/33Mhz APL*PLUS II 387 V.5]
15 .quad MF-timer ticks)

We would be happy, if you would join the #contab# contest.

Bernhard Strohmeier
