Solution to January’s Puzzle: Counting Triangles Can you figure out how many triangles Figure A contains? Can you think of a methodical approach or formula to calculate this number?

To follow the explanation of this puzzle’s solution, examine Figure B, in which the points in the diagram are marked with letters. To find a methodical approach for solving the puzzle, you must identify a repeating pattern in the diagram. Note that the diagram contains a repeating pattern of floors or levels. Each floor except the top one consists of two lines crossing each other, as well as a ceiling.

To create a formula for counting the triangles, you must determine the effect of adding each floor. You can start by drawing only the outermost triangle (ABC). So far, your count is 1. Add the ceiling of the first floor (DE), and the triangle ADE adds 1 to the count. Next, add the lines crossing each other within the first floor (DC, BE). The new triangles formed as a result of adding these two lines include 4 one-celled triangles (DBF, FBC, EFC, DFE), 4 two-celled triangles (DBC, BCE, CED, EDB) and 2 three-celled triangles (ABE, ADC), thus adding 10 new triangles to the count. So adding the first floor (including the ceiling and the two lines crossing each other) adds 11 to the original count of 1.

Add another floor by marking the lines GH, DH, and GE. This adds 11 new triangles (as the first floor also added), plus 2 new four-celled triangles (GBE, HDC). In other words, the first floor adds 11 to the count, and every additional floor beyond the first adds 13 to the count.

Although the top floor doesn’t have a ceiling (no line exists between points J and K), you can imagine the floor as if there were a ceiling (namely, add 13 to the count), then subtract the triangles that are eliminated by removing the floor. Four triangles are eliminated (AJK, JLK, JGK, JHK). So the total number of triangles you get is 1 + 11 + 13 + 13 - 4 = 34.

The general formula for n floors when the top floor has no ceiling is: 1 + 11 + [(n - 1) × 13] - 4. If you simplify the formula by expanding the parentheses (i.e., 1 + 11 + (n × 13) - 13 - 4), you get (n × 13) - 5. So for 3 floors you get (3 × 13) - 5 = 34. Now you can easily calculate the number of triangles for any given number of floors.

February’s Puzzle: Counterfeit Coins
This puzzle is from Clifford Jensen. Suppose you have 10 stacks of coins, with 10 coins in each stack. One stack consists of 10 counterfeit coins and the other 9 stacks each consist of 10 legitimate coins. Each legitimate coin weighs exactly 1 gram. Each counterfeit coin weighs exactly 0.9 grams. You have a digital scale that’s graduated in tenths of grams. Using the scale to take only one reading, determine which stack has the 10 counterfeit coins. You can weigh any number of coins from any number of stacks, but must you weigh them all together (i.e., you can take only one reading from the scale).

End of Article




You must log on before posting a comment.

If you don't have a username & password, please register now.

Reader Comments

I don't understand your reasoning for eliminating triangles AJK, JLK, JGK, and JHK. And in doing so, would you not also eliminate any other triangle that uses point A? AJH, AGE, ADC, ABC, AKG, AHD and AEB?

Can you please elaborate as to why you eliminated them?

KTran

Article Rating 3 out of 5

Unfortunately, the answer of 34 is incorrect. If the triangles are accurately counted, you will find that 38 is correct answer. You may want to revisit this puzzle and post a correction for it. Other than that - Thanks for all of the great content, and keep up the good work!

JeffBrown

Article Rating 1 out of 5

Readers, thanks for pointing out the error in the puzzle. Itzik's answer of 34 triangles is correct, but the figures we posted are not. The Figures A and B that you refer to have a line (JK in Figure B) that was not in the figures Itzik originally provided to us. I apologize for the incorrect additional line, which was accidentally introduced when the article was edited. We'll post the correct figures as soon as possible. Thanks for reading! Anne Grubb, Web site strategic editor, SQL Server Magazine

AnneG_editor

Article Rating 4 out of 5

Just wanted to note that the figures are now correct as posted. Sorry for the confusion! --Lavon Peters, Senior Editor

lpeters@penton.com

Article Rating 5 out of 5

Place 1 coin from stack 1, 2 coins from stack 2,..., 9 coins from stack 9, and 10 coins from stack 10 on the scale and weigh. CASE weight WHEN 54.9 THEN Stack 1 is counterfeit WHEN 54.8 THEN Stack 2 is counterfeit WHEN 54.7 THEN Stack 3 is counterfeit WHEN 54.6 THEN Stack 4 is counterfeit WHEN 54.5 THEN Stack 5 is counterfeit WHEN 54.4 THEN Stack 6 is counterfeit WHEN 54.3 THEN Stack 7 is counterfeit WHEN 54.2 THEN Stack 8 is counterfeit WHEN 54.1 THEN Stack 9 is counterfeit WHEN 54.0 THEN Stack 10 is counterfeit

tg66sql

Article Rating 3 out of 5

Number the stacks from 1 to 10. Place coins from each stack on the scale equal to the number of the stack (1 from stack 1, 2 from stack 2, etc.). Subtract from 10 the weight mod 10 to get the stack that has the counterfeit coins. (Assuming the bad coins are in stack 3, the total weight is 547, and the stack can be found by the following calculation: 10 - (547%10) = 3.

cehepker

Article Rating 4 out of 5

In my previous comment, replace subtract from 10 by subtract from 1 and use total weight mod 1 not mod 10.

cehepker

Article Rating 4 out of 5