Thursday, 7 January 2016

Friday, 1 January 2016

Ds Assignment solution by shabi :)

Ds assignment No 3
Let R be the following relation:
(a,b) R (c,d) if and only if (a<c or a=c and b<d or b=d)
(a) Is R is reflexive?prove it or disprove it
(b) Is R is symmetric? Prove it or disprove it
(c) Is R is transitive? Prove it or disprove it

Sol:
     (a)    According to the definition of reflexivity that is :Let R be a binary relation on A.
 • R is reflexive if for all x e A, (x,x) e  R. (Equivalently, for all x e A, x R x.)
So by given condition that is
a<c or A=C  and B<D or B=D which contradicts the reflexive property
Hence it is not reflexive


      (b)    According to the definition of  symmetry that is :
• R is symmetric if for all (x,y) e A, (x,y) e R implies (y,x) e R. (Equivalently, for all (x,y) e A, x R y implies that y R x.)
So by the give condition that is
A<C or A=C and B<D or B=D which contradicts the property of symmetry
Hence it is not symmetric 

       (c)    According to the the definition of transitive that is :
• R is transitive if for all (x,y,z) e A, (x,y) e R and (y,z) e R implies (x,z) e R. (Equivalently, for all x,y,z e A, x R y and y R z implies x R z.)
So by the given condition that is
A<C or A=C and B<D or B=D  which follows the transitive property  
As (a,b) R (c,d) so aRc and aRd also bRc and bRd  as a<=c then b<c  if C<=d then also (a,b)<=d  
Hence it is transitive 

Saturday, 12 December 2015

If a(t), b(t), and c(t) are the lengths of the three sides of a
triangle t in non-decreasing order (i.e. a(t) b(t) c(t)), we define the sets:
X := {Triangle t : a(t) = b(t)}
Y := {Triangle t : b(t) = c(t)}
T := the set of all triangles
Using only set operations on these three sets, define:
(a) The set of all equilateral triangles (all sides equal)
(b) The set of all isosceles triangles (at least two sides equal)
(c) The set of all scalene triangles (no two sides equal)
Solution:
(a) We require a(t) = b(t) and b(t) = c(t) (this obviously implies a(t) = c(t)), so the
set is X Y
(b) An isosceles triangle
t can have 
1. a(t) = b(t), or 2. b(t) = c(t), or 3. a(t) = c(t).
Now we have assumed that a(t), b(t), and c(t) are in non-decreasing order, so the last condition holds if and only if both the first two do. So the required set is X Y .
(c) A scalene triangle has its two smaller sides a(t) and b(t) unequal (set T \ X)  and its two larger sides b(t) and c(t) unequal (set T \ Y ). Since the sides are listed in the non-decreasing order, either of the above conditions guarantees  a(t) 6= c(t).
So the required set is (T \ X) (T \ Y ).
An alternative argument is: A triangle is scalene if and only if it is not isosceles.
So using the result of the previous part, the set of scalene triangles is T \(X Y ).
It’s easy to confirm that the answers given by the two arguments are actually the
same - this is an instance of a general rule called De Morgan’s Law.