Discrete Practical 1
Discrete Practical 1
Out[174]= True
In[175]:= pairQ@1D
Out[175]= False
Out[179]= True
Out[180]= False
881, 1<, 81, 2<, 81, 3<, 81, 4<, 81, 5<, 81, 6<,
82, 2<, 82, 4<, 82, 6<, 83, 3<, 83, 6<, 84, 4<, 85, 5<, 86, 6<<
Out[181]=
Practical-2
In[19]:= div6
881, 1<, 81, 2<, 81, 3<, 81, 4<, 81, 5<, 81, 6<,
82, 2<, 82, 4<, 82, 6<, 83, 3<, 83, 6<, 84, 4<, 85, 5<, 86, 6<<
Out[19]=
2 kusum discrete practical.nb
In[20]:= Flatten@div6, 1D
Flatten@div6D
Flatten@div6, 0D
881, 1<, 81, 2<, 81, 3<, 81, 4<, 81, 5<, 81, 6<,
82, 2<, 82, 4<, 82, 6<, 83, 3<, 83, 6<, 84, 4<, 85, 5<, 86, 6<<
Out[22]=
In[23]:= findDomain@div6D
In[25]:= reflexiveQ@div6D
Out[25]= True
Out[26]= False
H*ANTISYMMETRIC RELATION*L
antisymmetricQ @R_ ? relationQD := Module@8u<,
In[27]:=
Out[28]= True
Out[29]= False
In[31]:= transitiveQ@div6D
Out[31]= True
In[32]:= transitiveQ@sumD
Out[32]= False
H*PARTIAL ORDER*L
partialorderQ @R_ ? relationQD := reflexiveQ@RD && antisymmetricQ @RD && transitiveQ@RD
In[33]:=
Out[34]= True
Out[35]= True
kusum discrete practical.nb 3
PRACTICAL-3
Out[45]= True
Out[47]= 881, 2<, 81, 3<, 81, 5<, 82, 4<, 82, 6<, 83, 6<<
In[48]:= ? Rule
lhs -> rhs or lhs ® rhs represents a rule that transforms lhs to rhs.
4 kusum discrete practical.nb
In[49]:= ? LayeredGraphPlot
4 6
Out[51]= 5 2 3
In[52]:= r2 = 881, 1<, 81, 2<, 81, 3<, 81, 4<, 82, 2<, 82, 3<, 82, 4<, 83, 3<, 83, 4<, 84, 4<<
Out[52]= 881, 1<, 81, 2<, 81, 3<, 81, 4<, 82, 2<, 82, 3<, 82, 4<, 83, 3<, 83, 4<, 84, 4<<
kusum discrete practical.nb 5
Out[53]=
881, 1<, 81, 2<, 81, 3<, 81, 5<, 81, 6<, 81, 10<, 81, 15<, 81, 30<, 82, 2<, 82, 6<,
82, 10<, 82, 30<, 83, 3<, 83, 6<, 83, 15<, 83, 30<, 85, 5<, 85, 10<, 85, 15<,
Out[55]=
85, 30<, 86, 6<, 86, 30<, 810, 10<, 810, 30<, 815, 15<, 815, 30<, 830, 30<<
6 kusum discrete practical.nb
30
6 10 15
Out[56]=
2 3 5
Out[57]= 88<, 81<, 82<, 83<, 81, 2<, 81, 3<, 82, 3<, 81, 2, 3<<
In[58]:= b = Tuples@a, 2D
888<, 8<<, 88<, 81<<, 88<, 82<<, 88<, 83<<, 88<, 81, 2<<, 88<, 81, 3<<, 88<, 82, 3<<,
88<, 81, 2, 3<<, 881<, 8<<, 881<, 81<<, 881<, 82<<, 881<, 83<<, 881<, 81, 2<<,
Out[58]=
881<, 81, 3<<, 881<, 82, 3<<, 881<, 81, 2, 3<<, 882<, 8<<, 882<, 81<<, 882<, 82<<,
882<, 83<<, 882<, 81, 2<<, 882<, 81, 3<<, 882<, 82, 3<<, 882<, 81, 2, 3<<, 883<, 8<<,
883<, 81<<, 883<, 82<<, 883<, 83<<, 883<, 81, 2<<, 883<, 81, 3<<, 883<, 82, 3<<,
883<, 81, 2, 3<<, 881, 2<, 8<<, 881, 2<, 81<<, 881, 2<, 82<<, 881, 2<, 83<<,
881, 2<, 81, 2<<, 881, 2<, 81, 3<<, 881, 2<, 82, 3<<, 881, 2<, 81, 2, 3<<,
881, 3<, 8<<, 881, 3<, 81<<, 881, 3<, 82<<, 881, 3<, 83<<, 881, 3<, 81, 2<<,
881, 3<, 81, 3<<, 881, 3<, 82, 3<<, 881, 3<, 81, 2, 3<<, 882, 3<, 8<<, 882, 3<, 81<<,
882, 3<, 82<<, 882, 3<, 83<<, 882, 3<, 81, 2<<, 882, 3<, 81, 3<<, 882, 3<, 82, 3<<,
882, 3<, 81, 2, 3<<, 881, 2, 3<, 8<<, 881, 2, 3<, 81<<, 881, 2, 3<, 82<<, 881, 2, 3<, 83<<,
881, 2, 3<, 81, 2<<, 881, 2, 3<, 81, 3<<, 881, 2, 3<, 82, 3<<, 881, 2, 3<, 81, 2, 3<<<
Out[60]= 81<
In[64]:=
PRACTICAL-4
Out[66]= True
Out[67]= False
In[68]:= ? AppendTo
AppendTo@s, elemD appends elem to the value of s, and resets s to the result.
Out[71]= 86<
In[72]:= ? If
Out[74]= 82<
8 kusum discrete practical.nb
Out[75]= 86<
Out[77]= True
Out[79]= 81<
Out[80]= 81<
Out[83]= 81<
Out[84]= 83<
Out[85]= 81<
PRACTICAL-5
Out[87]= 881, 1<, 81, 2<, 81, 3<, 81, 4<, 82, 2<, 82, 4<, 83, 3<, 84, 4<<
In[88]:= hasGlbQ@div4D
Out[88]= True
kusum discrete practical.nb 9
In[90]:= hasLubQ@div4D
Out[90]= False
In[92]:= latticeQ@div4D
Out[92]= False
881, 1<, 81, 2<, 81, 3<, 81, 4<, 81, 5<, 81, 6<, 81, 12<, 81, 15<, 81, 20<, 81, 30<,
81, 60<, 82, 2<, 82, 4<, 82, 6<, 82, 12<, 82, 20<, 82, 30<, 82, 60<, 83, 3<, 83, 6<,
Out[94]=
83, 12<, 83, 15<, 83, 30<, 83, 60<, 84, 4<, 84, 12<, 84, 20<, 84, 60<, 85, 5<, 85, 15<,
85, 20<, 85, 30<, 85, 60<, 86, 6<, 86, 12<, 86, 30<, 86, 60<, 812, 12<, 812, 60<,
815, 15<, 815, 30<, 815, 60<, 820, 20<, 820, 60<, 830, 30<, 830, 60<, 860, 60<<
Out[95]= False
In[96]:= latticeQ@r2D
Out[96]= True
In[97]:=
In[98]:=
In[99]:=
In[100]:=