Thursday 14 June 2012

[Aptitude] PnC: How many triangles are present in this figure (without manual counting)!

[Aptitude] PnC: How many triangles are present in this figure (without manual counting)!

How many triangles in following figure? This question was asked in actual CSAT-2011 Paper II.
aptitude
Answer Choices
  • A.27
  • B.26
  • C.23
  • D.22
If you start counting manually 1,2,3,4 ….You might overcount or skip a few a triangles
And the answer choice are so close to each other, you’ll have to count it 2-3 times to verify the answer = waste of time.
But We can use the principles of PnC to solve this problem quickly and precisely.
First consider this straight line with five points, A,B,C,D and E.
aptitude
The distance between two consecutive points is 1 cm. e.g. AB=1, BC=1 and so on.

How many line segments of 1 cm are present in this figure?

Total “5” dots, we’ve to pick “2” consecutive dots
formula to pick k consecutive things out of “n” total things = n – k +1.
Total selections = 5-2+1=4
Manually counting :AB,BC,CD,DE=total 4.

How many line segments of 2 cm are present in this figure?

aptitude
For example AC=2.
But AC is made up of AB+BC, so we’ve to choose three consecutive dots and we get one line segment of 2 cm.
Total “5” dots, we’ve to pick “3” consecutive dots
Total selection =5-3+1=3
Manually counting: AC,BD,CF=total 3.
Let’s try one more:

How many line segments of 3 cm present in this figure?

aptitude

AD=3cm
But AD=AB+BC+CD so you pick four consecutive dots A,B,C,D and you get one line segment.
So total selection =n-k+1=5-4+1=2
Manually count: AD,BF.
We’ll use this principle to solve this triangle figure problem.
aptitude
I’m labeling the three “Main” outer corners of this triangles as A, B and C.
Consider this: You pick up any two dots on any straight line and you’ll get one triangle.
Except that Danger zone highlighted in “RED”. Those are not triangles, they’re parallelograms.

My approach

Start from line segment BC, take each horizontal line and the dots and move towards “A”. (Bottom up)
triangle2

You can see in above figure, There are four horizontal lines 1,2,3,4
Assume that distance between any two consecutive dots =1cm.
Bottom up from Line #2,3,4 is easy because there is no danger zone.
Start with Line#1. It has danger zone (red).

Line#1, Size=1cm

I want triangles of size 1 on line #1 (BC)
But there are two red zones.
triangle fig3

So we can only use the three middle points D,E,F of line#1.
Total 3(n) middle points and we want line segment of 1cm
So we’ve to pick 2(k) consecutive points
Total selection
=n-k+1
=3-2+1
=2 triangles
In above figure you can see two of them yellow triangle. Notice that I’ve ignored green “top down” triangle. We’ll calculate all of the “top-down” triangles later.

Line#1, Triangles Size=2cm

The red zone doesn’t hurt us here.
Directly total points on Line#1= 5. So n=5.
We want triangle of size 2cm, therefore have to pick three consecutive dots so k=3
Total triangles
=n-k+1
=5-3+1
=3
I hope your concept is clear by now. Else re-read the article again upto this point. Because now I’m constructing a table to quickly finish the whole thing.

Consider this code

S3(n,k)
It says equilateral Triangle of Size 3cm.
To get a line segment of size 3 cm you’ve take 4 consecutive points, right?
so k is always “4” for this case.
The code will become S3(n,4)
The “n” (total dots) will vary according to line number 1,2,3,4

Construct a table

      Total Triangles=Consecutive dots (n,k)
Line number Total Dots (n) on this line n+1 S1(n,2) S2(n,3) S3(n,4) S4(n,5)
1 (danger zone) 5 6 2 3    
2 4 5        
3 3 4        
4 2 3        
Line#1 was danger zone, so I carefully calculated it outside table.
But the remaining lines are easy. Now fill up the empty-cells by doing simple subtraction in your head.
For example line#3, S2(n,3)
S2(n,3)
=n-k+1
=(n+1)-k
Simply check (n+1) cell of Line3 and subtract (k=3) from it.
4-3=1. Write “1″ in the corresponding cell (highlighted in green). Repeat the procedure for all the remaining cells.
      Total Triangles=Consecutive dots (n,k)
Line number Total Dots (n) on this line n+1 S1(n,2) S2(n,3) S3(n,4) S4(n,5)
1 (danger zone) 5 6 2 3    
2 4 5        
3 3 4   1    
4 2 3        

Repeat for other cells

      Total Triangles=Consecutive dots (n,k)
Line number Total Dots (n) on this line n+1 S1(n,2) S2(n,3) S3(n,4) S4(n,5)
1 (danger zone) 5 6 2 3 2 1
2 4 5 3 2 1 0
3 3 4 2 1 0 -1
4 2 3 1 0 -1 -2
In some cells we got negative numbers, it simplify means those lines don’t have the ‘aukaat’ to construct the triangle of that size.
So, Discard those negative numbers or replace them with zeros.
      Triangles
Line number Total Dots (n) on this line n+1 S1(n,2) S2(n,3) S3(n,4) S4(n,5)
1 (danger zone) 5 6 2 3 2 1
2 4 5 3 2 1 0
3 3 4 2 1 0 0
4 2 3 1 0 0 0
Total triangles xxx xxx 8 6 3 1
Add the last row
8+6+3+1=18
That means total 18 triangles from bottom-up.
But we have not yet counted the “top-down”
Now we go reverse: from line #4 towards line #2. The Line#1 is irrelevant here because we can’t construct a “Top-down” triangle on it.
topdown
Make a new table. Discard the cells where you get negative answer and replace it with zeros.
This time line #2 becomes danger zone. But as you can see, there is only one “top down” triangle possible, the green colored. So Line 2’s row is filled after manual verification.
      Triangles
Line number Total Dots (n) on this line n+1 S1(n,2) S2(n,3) S3(n,4) S4(n,5)
4 2 3 1 0 0 0
3 3 4 2 1 0 0
2 (danger) 4 5 1 0 0 0
Total triangles xxx xxx 4 1 0 0
Total of last row=4+1+0+0=5
Means there are 5 top-down triangles.

Final answer

=bottom up triangles + top down triangles
=18+5
=23
Answer choice (c) There are 23 triangles in the given figure.
from  MRUNAL'S BLOG

No comments:

Post a Comment