Skip to content

Sweeten your Combinations (Comp)

Vector 3:4, page 114

The text of this article is not yet online. No complete scan of this issue has been found. The only copy found, on vector.org.uk, is damaged: its page images are lost, but the text machine-read from them survives, shown below (help find a scan).

Unedited OCR text, machine-read from a scan now lost: it contains errors, and its APL is wrong. Shown for searching.

VECTOR Vol.3 No.4

Prize Competition: Sweeten your Combinations

by Derek Wilson

A popular brand of sweets comes in coats of many colours, and is sold in tubes and packs. These are filled at random from the set colours. What is the probability that a tube will be missing one or more colours?

The problem is to write a function which takes a left argument of the number of sweets in a pack and a right argument of the number of colours, and returns a vector of all the probabilities. The first element is the probability that there will be exactly 1 colour in the pack, the next element the probability that there will be exactly 2 colours, and so on. For example, if there were only 5 sweets ina pack and 3 colours available, then the result would be as follows: 5 COLOURS 3 8.01234567901 B.3783703704 26172839506

Competition rules

= Entries must be in legible English or APL as appropriate and should preferably be machine produced.

= Entrants must declare the type of computer and the version and release level of the APL interpreter on which any functions were written.

= The date and the entrants’ full name and address must appear on each sheet of the entry.

= Entries should be physically separate from other contributions such as letters, and should be clearly marked Competition Entry”.

= All submissions should be sent to the Editor.

i Members of the B.A.A. committee, activities working group or journal working group are ineligible.

B DOS format diskettes containing APL*PLUS, IBM or SHARP APL workspaces are acceptable; diskettes will be returned.

= Unless otherwise stated, entrants should submit only one entry. We encourage submission of alternative approaches, but the entrant must indicate clearly which one answer is the entry in the competition.

= Non-members of the B.A.A. are encouraged to enter the competition. If they should win, then part of their prize will comprise free B.A.A. membership for the current year.

® Late competition entries may be accepted if the competition has not yet been judged.

114

VECTOR Vol.3 No.4

Introduction to Technical Contributions

Our first contribution comes from the statistics department of the University of New South Wales, Australia. J B Douglas responds to Dick Bowman’s domino difficulties (See VECTOR Vol.3, No.1) with a short piece entitled Polynomial Curve Fitting’.

In the same issue of VECTOR, John Sullivan wrote about Fast Fibbing”. His article has stimulated two replies from our readers. Joseph de Kerf  the Chairman of the Belgian APL-CAM Users Society (BACUS) has contributed his thoughts on the subject. Alan Sykes has written from the Department of Management Science and Statistics at the University College of Swansea, providing an APL2 view of the subject.

David Piper is a consultant with Cocking and Drury; his latest foray into the depths of APL2 is entitled Using Name Association for Data Translation’.

Paul Chapman is an independent consultant who is currently employed by the I-APL team to write the free APL interpreter for schools. Paul has made his arduous and lonely task more bearable by writing an I-APL diary, the first instalment of which is published in this issue of VECTOR. Watch out for more diary instalments in future issues!

Call for Technical Articles If you are interested in publishing an article in the technical section of VECTOR, please contact David Ziemann or Jonathan Barman, the technical editors. Our backlog of articles has now been exhausted, so we can guarantee to get you in print immediately.

If you receive VECTOR regularly, you will appreciate the articles and correspondence created by others. You are of course familiar with your own work and views, but others are not; please consider sharing your knowledge with the other readers by making a contribution of your own. Please note we are trying to orient future issues of VECTOR around more specific themes. Obviously we are particularly keen to receive articles based on these topics. Our current plans for volume 4 of VECTOR are as follows:

Number Copy date Issue date Theme 1 24 April July 87 Graphics and user interface 2 24 July October 87 Applications 3 16Qctober January 88 Education

115

H.M.W. PROGRAMMING CONSULTANTS LTD

Why not discover more about

* Consultancy/Support Service

* APL on the IBM PC

* VM/CMS Packages

Ring Ken Jackson at

H.M.W. PROGRAMMING CONSULTANTS LTD 142 FELTHAM HILL ROAD, ASHFORD, MIDDLESEX TW15 1HN Telephone: Ashford 41232