Senior Division 1987
1 TOWER BUILDING
The  *  symbol is your building block. With the  *  and the PRINT 
command any tower can be built. 

In the towers shown below, the size (number of rows) of each triangle 
can vary between 1 and 9. Each tower is built with three triangles of 
size X,Y,Z respectively.

Write a program to generate the following towers. 

Test your program for inputs (3,5,4) and (7,3,5).

Sample Run

ENTER THREE DIGITS  A,B,C: 3,5,4

           *
          ***
         *****
           *
          ***
         *****
        *******
       *********
           *
          ***
         *****
        *******


2 SAFE CRACKING
To open a safe requires knowing three single digits (0-9).  For 
example, the three digits  5 - 4 - 9  are a combination.  A secret 
message has been found that says, " the combination is the last three 
digits (100's, 10's and 1's) of the number:	
		
			    7
			  8
			9    ".

[That's (9^8)^7]

Write a program to crack the safe. Print your answer in the form   X - 
Y - Z.

Sample Run

THE COMBINATION IS  ? -  ? -  ?


3 BIRTHDAY OF THE WEEK
"On what day of the week were you born?" I asked this question of a 
group of 14 people and received six different answers. I expected to get 
seven different answers -- one for each day of the week (MONDAY, 
TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, 
AND SUNDAY). 

Call the day of the week you were born your BIRTHDAY OF THE 
WEEK.

Assume that every day of the week is equally likely to be a birthday of 
the week. What would the results be if you asked a group of 14 people 
to tell you their birthday of the week? How many different birthdays of 
the week would you expect from 14 people chosen at random? 5? 6? 7? 

Write a program to simulate the experiment of picking 14 birthdays of 
the week from the 7 days of the week. Repeat the experiment 100 
times and use the results to estimate the percentage of times that in a 
group of 14 people the number of different BIRTHDAYS OF THE 
WEEK is 1, 2, 3, 4, 5, 6, or 7.
 
Sample Run

NUMBER OF 
DIFFERENT 
BIRTHDAYS
OF THE WEEK      PERCENTAGE
-----------      ----------
1			0
2			0
3			0
4			1
5			18
6			52
7			29




4 WORD SEARCH
If you look carefully at the puzzle below you will recognize the words 
THE, BEST, CONTEST, hidden in rows of the puzzle. Your job is to 
write a program that will  find the words for you. 

You may assume that all words appear in rows and read forward (left 
to right) or backward (right to left). 


          Puzzle                    
H A F B T H E W
J B S Y O Y J S
L G B E S T Y U
T S C O L T E D
J T F S D O W L
W T S E T N O C

Your program should print the word, the row and the column where it 
begins and its direction (forward or backward). 

Sample Run

  	   ROW  COLUMN  DIRECTION     
THE	    1	     5    FORWARD	
BEST	    3	     ?    FORWARD
CONTEST  ?	     8    BACKWARD
					


 
5 NUMBER SPIRALS
The numbers in the square below reveal a spiral pattern. 

Write a program to generate Number Spirals of size N where 1 _ N _ 9 
and N is odd. Each spiral should go from 1 to N2 and begin in the 
center of the square and wind to the outside in a counter-clockwise 
direction..

Test your program for N=5 and 7. 

Sample Run

ENTER AN ODD NUMBER BETWEEN 
1 AND 9: 5


		21 20 19 18 17 
		22 7  6  5  16
		23 8  1  4  15
		24 9  2  3  14
		25 10 11 12 13		



	ICPSC 1987
	Senior Division Problems


