Simple Combinatorics

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 .


The answer is 13.

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.

3 solutions

First of all , to form a triangle there must be 3 line segments .Therefore choose 3 line segments as ( 6 3 ) 6 \choose 3 . But among these groups, there are 7 groups which do not satisfy the triangle inequality : For a Δ \Delta 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 : ( 6 3 ) 6 \choose 3 - 7 7 = 13 \boxed{13}

You forgot the (2,3,4) group.

Prakhar Dhumas - 6 years, 5 months ago

Log in to reply

Really I didn't forget it , (2,3,4) isn't a part of the answer as

  • 2 + 3 4 2+ 3 \geq 4
  • 4 + 3 2 4+ 3 \geq 2
  • 2 + 4 3 2+ 4 \geq 3

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 ?

A Former Brilliant Member - 6 years, 5 months ago

For some reason, I did 20 7 = 10 20 \ - \ 7 \ = \ 10 . IITian in the making.

Kunal Verma - 6 years, 1 month ago

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....

Ayush Pattnayak - 5 years, 2 months ago
Bill Bell
Mar 1, 2015

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 :)

A Former Brilliant Member - 6 years, 3 months ago
Alisina Zayeni
Dec 11, 2017

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

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...