Enigmatic Code

Programming Enigma Puzzles

Tag Archives: by: Keith Austin

Enigma 916: 9001 calculations

From New Scientist #2071, 1st March 1997 [link]

Take a very large sheet of lined paper. Write the numbers 1000, 1001, 1002, …, 9998, 9999, down the left-hand side of the page, one number on each line. For each number, calculate the product of the first two digits and subtract from it the product of the last two digits; write your answer at the right hand end of the line for that number. For example, 7251 gives: 7×2 – 5×1 = 14 – 5 = 9, while 3849 gives: 3×8 – 4×9 = 24 – 36 = –12. When you have done the 9000 calculations add all your 9000 answers together.

Now I am only going to ask you to find the final total, and so if you are clever enough to find that total without actually doing all the calculations then you can still solve the puzzle.

What is the final total you obtain?

[enigma916]

Enigma 912: Football from 1 to 9

From New Scientist #2067, 1st February 1997 [link]

My three local football teams, Albion, United, and Victoria all play in the Footiefun League. The league awards a certain number of points for a win, and a certain smaller number, greater than 0, of points for a draw. I forget what the two numbers are, but I do recall that at least one of them is a whole number.

Last week my local newspaper printed the details for the three local teams for the league as follows:

The teams were ordered according to their points. Curiously, the nine entries in the table were the numbers 1, 2, 3, …, 8, 9.

Write out the table as it appeared in the paper.

[enigma912]

Enigma 940: Fill in the squares

From New Scientist #2095, 16th August 1997 [link]

You will need a large sheet of squared paper. In the row of squares across the top of the sheet write the numbers 0, 1, 2, 3, …, in that order, one number to each square. Similarly, in the column of squares down the left-hand edge of the sheet write the numbers 0, 1, 2, 3, …, in that order, one number to each square.

The remaining square are each filled in turn with one of the numbers 0, 1, 2, 3, … according to the following rule:

Select any empty square which has all the squares to the left of it in the same row filled and all the squares above it in the same column filled. Find the smallest number which is not in these squares to the left or above and write it in our selected empty square.

For example consider the following situation where we want to fill in the empty square which is in the row that begins with 2 and in the column that has 3 at the top (it is marked with “*”).

The numbers to the left and above our square are 0, 2 and 3 and so we fill it with 1 — the smallest number if we exclude 0, 2 and 3.

What number do we write in the square which is in the row that begins with 12345 and in the column that has 9876 at the top?

[enigma940]

Enigma 646a: Christmas fair

From New Scientist #1800, 21st December 1991 [link]

A few days before Christmas, two of the nuns from the abbey set off, with a cart full of food, to visit the 10 villages in their valley. The cart contained 12 boxes of apples, 19 boxes of beetroot, 15 boxes of carrots, 21 boxes of jars of damson jam, 20 boxes of bottles of elderberry wine and 23 boxes of fennel. The purpose of the visits was to allow the villagers to obtain supplies of those foods where their own harvests had failed.

At the first village the villagers wished to exchange at the following rate:

They would give 3 boxes of apples and 3 boxes of beetroot in exchange for 1 box of carrots and 13 boxes of fennel.

Similarly, at the other villages there were the following exchange rates:

The villagers would give these boxes (A), in exchange for these boxes (B).

(A) → (B)

(6 carrots, 22 fennel) → (3 apples, 3 elderberry)
(4 beetroot, 7 damson, 11 elderberry) → (10 carrots)
(7 apples, 5 carrots) → (4 damson, 15 fennel)
(8 apples, 1 damson, 14 elderberry) → (2 beetroot)
(21 elderberry, 2 fennel) → (3 beetroot, 4 damson)
(1 damson) → (5 apples, 1 beetroot, 23 elderberry)
(1 apple, 4 carrots) → (2 damson, 3 elderberry)
(2 beetroot, 1 elderberry) → (4 apples, 2 carrots)
(7 beetroot, 5 carrots) → (10 elderberry, 1 fennel)

In each village the villagers would say how many of their exchanges they wanted to make: for example, the first village exchange would be 3 apples and 3 beetroot for 1 carrot and 13 fennel, or 6 apples and 6 beetroot for 2 carrots and 26 fennel, or 9 apples and 9 beetroot for 3 carrots and 39 fennel, or …

It was Christmas Eve when the two nuns ended their journey. As they rode up the road towards the abbey, the younger remarked that in their final load the number of boxes of each food was a multiple of the number of boxes of apples. For example, there were 6 times as many boxes of beetroot as boxes of apples. Similarly there were twice as many boxes of carrots, 5 times as many boxes of damson jam, 3 times as many boxes of elderberry wine and 4 times as many boxes of fennel as there were boxes of apples.

The younger nun continued, “Have we been doing our work under market forces?”. The older nun smiled and, as the sound of carols from the abbey reached them, replied, “Under that greater force which makes us work to meet the needs of others”.

How many boxes of apples were there in the final load?

[enigma646a] [enigma646]

Enigma 640: Rally round

From New Scientist #1794, 9th November 1991 [link]

The rally circuit is 100 kilometres round. The rally organiser takes exactly the amount of petrol your car required to drive 100 kilometres, divides it in any way she chooses into a number of cans, and places the cans at various points on the circuit, which looks like this:

The organiser tells you how much is in each can, and where each can is. You select one of the points where a can is; then your car, with no petrol in its tank, is taken to that point. You then have to drive round in the direction of the arrows using only the petrol the organiser has provided. You are not allowed to walk round the circuit to get petrol. The distance you travel before you run out of petrol is measured.

There are two questions:

1. If the organiser arranges the petrol so as to make your job as hard as possible, and you then choose your starting point so as to make your distance as large as possible, how far do you travel?

2. The rules are changed so that the organiser puts out only the amount of petrol your car requires to drive 90 kilometres. Irrespective of how she organised the petrol, can you always select a starting point so that you are certain to be able to travel at least 45 kilometres?

[enigma640]

Enigma 877: Fantastic football

From New Scientist #2032, 1st June 1996 [link] [link]

Our league consists of four teams: Albion, City, United and Victoria. Each plays each of the other teams once in a season and the six matches are played on six consecutive Saturdays. Penalty shoot-outs are used to ensure there are no draws. Before the first match and after each match a league table is drawn up with the teams ordered by the number of points they have and teams with the same points in alphabetical order.

For each match the winner receives the number of points equal to their position in the league immediately before the match. If the winner was equal on points with one or more other teams then it receives the average of the positions of these teams, including itself. For example, suppose City wins the first and third matches and Victoria the second. Before the first match the table is:

1-A-0, 2-C-0, 3-U-0, 4-V-0 (position-team-points), so City receives (1 + 2 + 3 + 4)/4 = 2.5 points. Before the second match the table is 1-C-2.5, 2-A-0, 3-U-0, 4-V-0, so Victoria receives (2 + 3 + 4)/3 = 3 points. Before the third match the table is 1-V-3, 2-C-2.5, 3-A-0, 4-U-0, so City receives 2 points.

1. What is the largest total number of points a team can receive in a season?
2. What is the largest possible total number of points for all four teams at the end of the season?
3. What is the smallest possible total number of points for all four teams at the end of the season?

[enigma877]

Enigma 638: Umpires all

From New Scientist #1792, 26th October 1991 [link]

The Smith, Brown and Jones families each contain at least two children. The number of Smith children is the smallest, and the number of Jones children is the largest. On three successive days of the holiday all three families gathered at one of their homes for a singles tennis tournament.

When they were at the Smiths’ home, each Brown child played each Jones child once. One match was umpired by Mrs Smith, and every other match was umpired by a Smith child; each child umpired the same number of matches.

Similarly, at the Browns’ home, each Smith child played each Jones child once, with Mr Brown umpiring one match and a Brown child umpiring every other match; each child umpired the same number of matches.

Finally, at the Joneses’ home, each Smith child played each Brown child once, with Mrs Jones umpiring one match, and a Jones child umpiring every other match; each child umpired the same number of matches.

The question is straightforward: how many children are there in each family?

[enigma638]

Enigma 882: The long, long…

From New Scientist #2037, 6th July 1996 [link]

Last night I dreamt I went to Wanderley again. In my dream, my guide, Matthew, showed me a long line of pieces of paper going off endlessly into the far distance. Each piece of paper had a different number on it. The first piece of paper had 7 on it, the second had 0.235, the third 416.3, and so on. Matthew told me that I had to walk along the line, with no doubling back, selecting some of the pieces of paper just as I wished except that I always had to select a piece with a number that was larger than the number on the last piece I had selected. I could wait as long as I liked between selections but I had to keep on making selections.

After considerable effort making an exhaustive search I found that I always came to a dead end, unable to complete the task because the number I had just chosen was larger than all the numbers remaining ahead of me in the line.

Matthew then set me a second similar task. Again I had to walk along selecting some of the pieces of paper, as I wished, but this time the number on each piece of paper selected was to be smaller than the number on the last piece I had selected.

After another exhaustive search, I found that, again, I always came to a dead end, unable to complete the task because, this time, the number I had just chosen was smaller than all the numbers remaining ahead of me in the line.

Question 1. Is it actually possible to have such a line of numbers in real life so that I cannot complete either of Matthew’s tasks?

In the following night’s dream, Matthew laid out a certain number of pieces of paper, again each having a different number on it. He also changed his tasks so that I only had to select 10 pieces of paper as I walked along, with the numbers all getting larger or all getting smaller.

Question 2. What is the smallest number of pieces of paper he had to lay out so as to be certain I could complete at least one of his tasks, whatever the numbers on the pieces of paper?

[enigma882]

Enigma 885: Speed of the light

From New Scientist #2040, 27th July 1996 [link]

The Brrm Brrm Motor Company is test its new C car, which does 10 miles to the gallon. Unfortunately the C is slowed down by the weight of the petrol it is carrying. So its maximum speed, in mph, at any point is 50 minus the amount of petrol, measured in gallons, in the tank at that point.

The car begins its test run of 400 miles with 40 gallons in the tank. The driver keeps to C’s maximum speed throughout the journey. Thus he travels initially at 10 mph and finishes the test going 50 mph.

How long does the test take, to the nearest hour?

[enigma885]

Enigma 634: Biscuit routine

From New Scientist #1788, 28th September 1991 [link]

Rosemary was getting tea for 124 visitors. There were 17 biscuits in each packet, and she wanted to buy a number of packets so that each visitor had the same number of biscuits and there was one biscuit left over for her to have after she had washed up.

Rosemary had a routine for finding the answer. First, she calculated that if each visitor had one biscuit, then she would need 7 packets and 5 extra biscuits. She noted the number 5, and looked at the question of 5 visitors and 17 biscuits in each packet. That was easy — she would buy 3 packets, giving 51 biscuits, so that each visitor had 10 biscuits and there was one left over for her. She noted the number 10, and returned to her original question. She gave each of the 124 visitors 10 biscuits, and adding one more for her gave 1241 biscuits, which is exactly 73 packets.

The next day, Rosemary had 53 visitors and 113 biscuits per packet, but the problem was the same, namely, to have one biscuit left over for her.

Because the number of visitors was less than the number of biscuits, she had to include an extra routine. First, she changed to the question of 113 visitors and 53 biscuits per packet. Now she could use her first-day routine, and she found the answer was 32 packets and 15 biscuits per visitor. Next she subtracted the 32 from the 113 to get 81, and the 15 from the 53 to get 38. Then the original question of 53 visitors and 113 biscuits per packet had its answer: 38 packets and 81 biscuits per person.

On the third day, Rosemary had 293 visitors and 119 biscuits per packet. Again, she wanted to buy a number of packets so that each visitor had the same number of biscuits and there was one left over for her. Also, for the visitors’ health, she decided that each one should get less than a packet.

Either by using Rosemary’s routine, or by your own method, calculate the number of packets she should buy on the third day.

News

This brings the total number of Enigma puzzles on the site to 1,500 (with 292 puzzles remaining to post), nearly 84% of all Enigma puzzle published in New Scientist.

For the past year or so I have endeavoured to post 7 puzzles a week between Enigmatic Code and S2T2, so that people who have found themselves with time on their hands because of the pandemic are not at a loose end. However I now find that I need to make time for other things, so I don’t expect to maintain this posting frequency in the future.

However, there are now 2,381 puzzles available between the two sites, so I hope there are enough for people to keep people amused for the time being. (They are weekly puzzles, so that is over 45 years worth).

Happy Puzzling!

[enigma634]

Enigma 897: Look four ways

From New Scientist #2052, 19th October 1996 [link]

On Faraway Island the symbols:

stand for 0, 1, 2, …, 8, 9 in some order.

The following array contains four addition sums:

Place the puzzle on the table with the top facing North. As you are reading it now you are South of the array and get an addition sum by taking the two 2-figure numbers in the centre and their sum, which is below the horizontal line near you. Now walk around the puzzle so that you are due West of the array and you get a new addition sum by following the same procedure. Similarly, by standing North and East in turn you get two further addition sums. Each of these four sums is correct.

What [number] does:

represent?

[enigma897]

 

Enigma 619: Pussycat (ii)

From New Scientist #1773, 15th June 1991 [link]

Pussicato had a 15 × 11 canvas divided into small squares. He painted “(ii)” in some of the small squares, so:

enigma-619

Pussicato then altered some of the “(ii)”s so that each that he altered became a cat, so:

=(ii)=

He explained that no two cats were in the same horizontal row or vertical column, and that, given that condition, he had produced as many cats as possible from the existing “(ii)”s.

Pussicato then explained that he had to clear the canvas of “(ii)”s and cats for a new picture. He would do this be selecting some of the 15 rows and 11 columns, and then painting over the rows and columns he had selected, so covering up everything in those rows and columns. He wanted to select the rows and columns so that the total number he head to select was as small as possible.

How many cats did Pussicato produce? What was the total number of rows and columns he had to select?

[enigma619]

Enigma 900: Divide and multiply

From New Scientist #2055, 9th November 1996 [link]

Make a pile of 20 matches. Divide the pile into two smaller piles. Take one of the piles in front of you which contains more than one match and divide it into two smaller piles. Take any one of the piles in front of you that contains more than one match and divide it into two smaller piles. Continue in this way until you have 20 piles, each containing one match.

Question 1: How many divisions did you have to make?

Now I want you to repeat the above routine but this time keep a record of each division you make. For example, you might do 20 → 7 + 13, 13 → 11 + 2, 11 → 4 + 7, …, 2 → 1 + 1.

When you have finished, work out the following, (7×13) + (11×2) + (4×7) + … + (1×1). That is your score.

Question 2: What is the smallest score you can get?

Question 3: What is the largest score you can get?

[enigma900]

Enigma 907: Many ways to the goal

From New Scientist #2061, 21st December 1996 [link]

There are 11 villages, A, B, …, K, joined by roads as shown on the map [above]. Earlier in the year the villagers met to choose which village should host the annual carol service. The village has to be chosen so that the roads can all be made one-way, in such a fashion that any driver, starting from any village, is certain eventually to reach the chosen village.

Question 1: Which villages can be chosen for the carol service?

The other day I found the people had chosen the village and were partway through making all the roads one-way. So far the following were one-way, in the direction from the first village named to the second:

EC, CD, EH, HJ, DG, IE, KA, AI, FB, BI.

Question 2: Which of the villages are possibly the one that has been chosen for the carol service?

[enigma907]

Enigma 613: Series of paintings

From New Scientist #1767, 4th May 1991 [link]

Pussicato has been showing his latest endless series of paintings called Series I. Each painting is a row of squares with each square coloured Red or Green. The series begins:

and goes on for ever. Pussicato explained that each one was painted as the mood took him and so there is no simple pattern to the series.

Pussicato has just been commissioned to paint a second endless series of paintings:

Each painting is a single square and is to be coloured Red or Green. This second series will be called Series II and is to relate to Series I as follows.

If we choose any number, say 358, and we then take paintings 1 to 358 of Series II and put them together in a row, in order, then we can find a painting in Series I which begins, at the left, with that row. For example, if Series II begins R, G, G, R, R, … and we choose the number 4, then we require a Series I painting which begins with RGGR. In fact, painting 6, RGGRRG, will do. Pussicato has to paint Series II so that we can do this for every possible number 1, 2, 3, 4, 5, …

How many more of the Series I paintings do you need to see before you can be sure that it’s possible for Pussicato to paint Series II as required?

[enigma613]

Enigma 903: The wages of min

From New Scientist #2058, 30th November 1996 [link]

Faironia has introduced a minimum wage, which is the average wage multiplied by 2/3 and rounded to the nearest pound. Workers paid less than the minimum wage have their pay raised to the minimum wage. However, this increases the average wage of Faironia. So the calculation is done again starting from this new wage situation. The whole process is repeated until we reach a stable situation, that is to say one where doing the calculation again would have no effect on the wages. At the start of the process, one third of the population earns £100 each, one third £350 each and one third £1000 each.

Question 1: What is the pattern of earnings in the stable situation?

Justonia has also introduced the same policy. Here, half the population get £1000 and the other half get a smaller sum which is a whole number of pounds. To reach the stable situation the pattern of wages has to change seven times. But if the lower pay had been £1 more then the pattern would only have had to change six times.

Question 2: What was the lower pay at the start of the process?

[enigma903]

Enigma 609: Pleasant crossings

From New Scientist #1763, 6th April 1991 [link]

The road network in Crossovia was built in two stages. The first stage consisted of the following layout of North-South and East-West roads; where two roads crossed, a bridge took one road over the other. The circles marked crossings where, in the second stage, links were to be built between the two roads crossing at that point.

For the second stage the designer carried out the following plan:

(a) She selected as many circled crossings as she could, subject to the condition that no two she selected lay on the same N-S or E-W road.
(b) At the selected crossings she built a link road which allowed traffic to go from the E-W road to the N-S road.
(c) At the unselected circled crossings she built a link road which allowed traffic to go from the N-S road to the E-W road.

When the network was complete the roads were labelled as follows: a road is an A road if it contains no link E-W → N-S; a road is a B road if it contains a link E-W → N-S and you can drive from the road, by the network, to an A road running E-W; all other roads are C roads.

Question 1: You are driving along a road and you find there is no link to take you off it. Is it N-S or E-W? Is it A or B or C?

Question 2: You make the following journey: road-link-road-link-road-link-road-link-road. You find there is no link to take you off your final road. Was your starting road N-S or E-W? Was it A or B or C?

Question 3: You are driving E-W on a B road and you turn off, by a link road, onto another road. Is the road you are now on A or B or C?

Question 4: You are driving on a road and you turn off, by a link road, onto a B road running E-W. Was the first road you were on A or B or C?

[enigma609]

Enigma 605: Singular singles

From New Scientist #1759, 9th March 1991 [link]

The Sunnycourt Tennis Club has 22 members, and each year it organises a Saturday afternoon tournament consisting of a number of singles matches. The matches are selected so that everyone in the club has at least one game, but the total number of games is always less than 22.

Last year, after the list of games had been settled, the secretary looked to see if there were 8 games which involved 16 different players. As there were 8 courts available she had hoped to take a photograph with them all in use. Unfortunately, the list did not include 8 such games.

During this last winter, the club decided that this year’s tournament should involve one game fewer than last year. The secretary then did some calculations and found that however the games were selected, she was certain to be able to find 8 games in the list which involved 16 different players.

How many games were there in the tournament last year?

[enigma605]

Enigma 600: Green questions

From New Scientist #1754, 2nd February 1991 [link]

The 10 towns in Colouritania are joined by various roads. The map shows the 10 towns as small circles; I had drawn those roads I can remember. There are some other roads, each joining a pair of towns. There are no road junctions outside the towns, but one road can cross over another by means of a bridge.

Each day, for the past 1022 days, at 0600 hours, the 10 towns have each been allocated a colour, blue or yellow, with at least one town of each colour. The pattern of blue and yellow among the 10 towns has been different on each day.

On each of these 1022 days, at 0605 hours, the following descriptions have been applied: a road is said to be green if it joins a blue town and a yellow town; a town is said to be green if it has more green roads leaving it than non-green roads, or the same number of each.

Which of the following statements are true and which are false?

(a) We can say for certain there was a day when all the roads were green.
(b) We can say for certain there was not a day when all roads were green.
(c) We can say for certain there was a day when no road was green.
(d) We can say for certain there was a day when all the towns were green.

[enigma600]

Enigma 595b: Sorting parcels

From New Scientist #1748, 22nd December 1990 [link]

The Reverend Brown watched as the Sunday School children sorted the Christmas food parcels for the local people in need. The children had drawn a diagram on the floor, so:

The children showed Rev Brown how they used the diagram to sort the parcels into order according to their weight. Ten children took a parcel and stood at the top of one of the 10 vertical lines. They then walked down their lines, keeping abreast, until they reached the first horizontal line, BI.

The two children in lines B and I compared their parcels and, as I was lighter, they exchanged places. If B had been lighter or if the weights had been equal they would have stayed where they were.

All 10 children they carried on until they reached the next horizontal line, AC, when the process was repeated. They then carried on until they reached the bottom of the vertical lines, at which point the parcels were in order, with the lightest at A and the heaviest at J.

The example the children showed Rev Brown was as follows:

Rev Brown asked if the diagram would sort correctly every possible row of 10 parcels, whatever they weighed. The children did not know, but they said they had tested every possible row of 10 parcels each weighing 1 or 2 pounds and they all had been sorted correctly.

Which of the following rows can we say for certain will be sorted correctly by the diagram?

(a) 3 2 2 1 2 1 2 1 1 1
(b) 3 2 1 3 2 1 3 2 1 1
(c) 5 8 7 2 1 6 4 3 9 2

[enigma595b] [enigma595]