A Valentine's Day Problem

On Valentine's day as usually happens , there was a girl who had recieved 2 proposals . The boys who had proposed to her were Pratik Shastri and Vraj Mehta . The girl however liked both of them , so she was in a fix .

However I knew that both were Scholars so I asked her conduct a test to decide who would get to be her boy friend .

Given below is her test :

" A given line segment is divided at random into 3 3 parts . What is the probability that they form the sides of a possible triangle ? "

Eventually one of them did go on to solve the question correctly and win the heart of his Lady Love .

Your question : What is the correct answer as answered by the Lucky Boy ?

Kudos to those who can guess who won the girl's heart .


The answer is 0.25.

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.

2 solutions

Let A B AB be the line segment in question of length l l . Let C C and D D be the points which divide A B AB into 3 3 parts .

Let A C = x , C D = y AC=x,CD=y , Then D B = l x y DB=l-x-y

Clearly x + y < l x+y<l , therefore the sample space is given by the region enclosed by Δ O P Q \Delta OPQ , where O P = O Q = l OP=OQ=l .

Area of Δ O P Q = l 2 2 \Delta OPQ=\frac{l^{2}}{2}

Now if the parts A C , C D AC,CD and D B DB form a triangle , then x + y > l x y i . e . x + y > l 2 ( 1 ) x+y>l-x-y \quad i.e. \quad x+y>\frac{l}{2} \quad (1) x + l x y > y i . e . y < l 2 ( 2 ) x+l-x-y>y \quad i.e. \quad y<\frac{l}{2} \quad (2) y + l x y > x i . e . x < l 2 ( 3 ) y+l-x-y>x \quad i.e. \quad x<\frac{l}{2} \quad (3)

From ( 1 ) , ( 2 ) (1),(2) and ( 3 ) (3) , we get the event needed as the region enclosed by Δ R S T \Delta RST

Therefore the probability of the event is a r ( Δ R S T ) a r ( Δ O P Q ) = 1 2 l 2 l 2 l 2 2 = 1 4 \dfrac{ar( \Delta RST)}{ar( \Delta OPQ)} = \frac{\frac{1}{2} \frac{l}{2} \frac{l}{2}}{\frac{l^{2}}{2}} = \frac{1}{4}

Well well ,now what was your guess for the Lucky Boy ?

Upvote the comment containing the name of your guess .

Brock Brown
Feb 11, 2015

Well, time for some random Monte Carlo simulations in Python.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
from random import random
def triangle(a,b,c):
    sides = set([a,b,c])
    hypotenuse = max(sides)
    smaller = sides-set([hypotenuse])
    return sum(smaller) > hypotenuse
yes = 0.0
trials = 1000000
for trial in xrange(trials):
    slice_1 = random()
    slice_2 = random()
    if slice_1 > slice_2:
        slice_1,slice_2 = slice_2,slice_1
    a = slice_1
    b = slice_2 - slice_1
    c = 1 - slice_2
    if triangle(a,b,c):
        yes += 1
print "Answer:", yes/trials

Cool !!! So even probability can be calculated using Python . I'll try to solve this question using Java .

A Former Brilliant Member - 6 years, 4 months ago

Log in to reply

Monte Carlo sampling is an awesome way to get a great approximation, it's not exact though. The answer can change a little bit each time you use it, but the Law of Large Numbers says as your number of trials tends to infinity your answer will be more and more correct (with high probability). As an example, my output wasn't exactly 0.25; a few of the results I got included 0.250319, 0.249589, 0.249741, and 0.250336.

I have a few issues with the Law of Large Numbers (I think it's more of a theorem), but not enough to not use Monte Carlo sampling.

Also, some info for your Java program, the random function returns a random number between 0 and 1.

random random

Brock Brown - 6 years, 4 months ago

Log in to reply

Nice ¨ \ddot\smile , also I have downloaded the book : L e a r n P y t h o n t h e H a r d W a y \it{Learn Python the Hard Way} and have planned to study it bit by bit everyday .

A Former Brilliant Member - 6 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...