You are given 6 line segments of length 2,3,4,5,6 and 7 units, the number of triangles that can be formed from these line segments is :
You can try more of my Questions here .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
You forgot the (2,3,4) group.
Log in to reply
Really I didn't forget it , (2,3,4) isn't a part of the answer as
Hence a triangle would be possible with the three . And weren't we trying to eliminate those groups for which a triangle is not possible ?
For some reason, I did 2 0 − 7 = 1 0 . IITian in the making.
Log in to reply
Yes , if you did that without any reason , you've got some really nice intuition :D
Hopefully you make it to one of the top-tier IITs
And i counted 7c3 instead of 6c3....
I used facilities from the Python sympy and itertools modules. (Programmers are supposed to be lazy.)
The code attempts to construct a triangle from each combination of three lengths. If the result is indeed a triangle then the code increments its count.
Programmers aren't lazy at all sir ,it's just that they view the world as a simple place .
My friend @Brock Brown is the best programmer you'll ever find . You must see his solutions sir , those are a class apart .
Btw nice solution sir , I think I'll try to write a solution using JAVA :)
Note that in triangle ABC one segment Plus another segment bigger than the other else segment.so we must choose 3 numbers which the sum of the two of them are bigger than another segment.
(2.3.4) (2.4.5)
(2.5.6)
(2.6.7)
Those are for two
(3.4.5) ( 3.4.6) (3.4.7)
(3.5.6) ( 3.5.7)
(3.6.7)
Those are for three
(4.5.6) ( 4.5.7)
(4.6.7)
And these are for four
So we have 13 triangles
Problem Loading...
Note Loading...
Set Loading...
First of all , to form a triangle there must be 3 line segments .Therefore choose 3 line segments as ( 3 6 ) . But among these groups, there are 7 groups which do not satisfy the triangle inequality : For a Δ ABC : For the triangle to exist , sum of any two sides must be greater than the third .
The groups are : (2,3,7) , (2,3,6) , (2,3,5) , (2,4,6) , (2,4,7) , (2,5,7) and (3,4,7) .
Therefore the required answer is : ( 3 6 ) - 7 = 1 3