Exercise #4

As we've seen in some of the lab exercises, computers are really good at counting. This week's assignment is to transfer this talent from the purely numerical realm to one that involves a human language.

Part A

Write and test a procedure that takes two integer arguments, start and finish, and displays each of the integers in the range from start to finish on a separate line. (Notice that the numbers are to be displayed, not returned, by the procedure; I don't care what your procedure returns and expect that in Chez Scheme it will probably return the #<void> value.)

If start is less than finish, the procedure should display the numbers in the range in ascending order; if start is greater than finish, it should display them in descending order. In either case, start should be the first number displayed and finish the last one.

Part B

Here are the words for the numbers from 1 to 10 in the Aleut language:

1 'ataqan
2 a`lak
3 qankun
4 sicin
5 cang
6 at'ung
7 ul'ung
8 qamc'ing
9 sic'ing
10 `a`tiq

The words for the numbers from 2 to 10 have ``multiplicative'' or adverbial forms:

2 times a`lgi`dim
3 times qanku`dim
4 times sici`dim
5 times cangi`dim
6 times at'un`gi`dim
7 times ul'ungi`dim
8 times qamc'ingi`dim
9 times sic'ingi`dim
10 times `a`ti`dim

The multiples of 10 from 20 to 90 are formed by combining the relevant multiplicative form with the word for 10:

20 a`lgi`dim `a`tiq
30 qanku`dim `a`tiq
40 sici`dim `a`tiq
50 cangi`dim `a`tiq
60 at'un`gi`dim `a`tiq
70 ul'ungi`dim `a`tiq
80 qamc'ingi`dim `a`tiq
90 sic'ingi`dim `a`tiq

The words for other numbers in the range from 11 to 99 are formed by concatenating the word for the appropriate multiple of ten, the word for the digit in the units place, and the word signaxt'a, which means ``exceeds'':

11 `a`tiq 'ataqan signaxt'a
12 `a`tiq a`lak signaxt'a
19 `a`tiq sic'ing signaxt'a
21 a`lgi`dim `a`tiq 'ataqan signaxt'a
37 qanku`dim `a`tiq ul'ung signaxt'a
99 sic'ingi`dim `a`tiq sic'ing signaxt'a

The word for 100 is sisaq, and the words for the multiples of 100 from 200 to 1000 are formed by combining the relevant multiplicative form with sisaq:

200 a`lgi`dim sisaq
300 qanku`dim sisaq
400 sici`dim sisaq
500 cangi`dim sisaq
600 at'un`gi`dim sisaq
700 ul'ungi`dim sisaq
800 qamc'ingi`dim sisaq
900 sic'ingi`dim sisaq
1000 `a`ti`dim sisaq

The words for the remaining numbers in the range from 101 to 1099 are formed by concatenating the words for the appropriate number of hundreds, the appropriate number of tens (if non-zero), and the appropriate units digit (if non-zero), and adding signaxt'a at the end:

101 sisaq 'ataqan signaxt'a
102 sisaq a`lak signaxt'a
109 sisaq sic'ing signaxt'a
110 sisaq `a`tiq signaxt'a
111 sisaq `a`tiq 'ataqan signaxt'a
168 sisaq at'un`gi`dim `a`tiq qamc'ing signaxt'a
201 a`lgi`dim sisaq 'ataqan signaxt'a
456 sici`dim sisaq cangi`dim `a`tiq at'ung signaxt'a
1099 `a`ti`dim sisaq sic'ingi`dim `a`tiq sic'ing signaxt'a

Write and test a Scheme procedure that takes any integer in the range from 1 to 1099 as argument and returns a string that gives the Aleut word for that integer. (Include a precondition test that enforces the range restriction.)

My source for this information about Aleut prose numerals is The Aleut language: the elements of Aleut grammar with a dictionary in two parts containing basic vocabularies of Aleut and English, by Richard Henry Geoghegan (Washington, D.C.: U.S. Government Printing Office, 1944), pp. 30-31.

Part C

Use or adapt the procedures you wrote in parts A and B to produce a Scheme procedure that takes two parameters, start and finish, and counts from start to finish by displaying the Aleut word for each integer in that range. Both parameters should be integers in the range from 1 to 1099. Test your procedure.


This document is available on the World Wide Web as

http://www.math.grin.edu/courses/Scheme/spring-1998/exercise-4.html

created February 18, 1998
last revised June 21, 1998

John David Stone (stone@math.grin.edu)