




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































( C o mm ont oCSE&I SE ) Su bjec t Co de: 10 CS 34 I. A. Ma rks : 25 Ho urs/Wee k : 04 Ex am Ho urs: 03 To ta l Hou rs : 52 Ex am Ma rks : 100 PA R T– A U N IT – 1 6 Hou rs Se tTh eor y: Se ts an dSu bs ets,Se t Op erationsand th e La ws of Se t Th eory, Co untingan d Ve n nDi agrams,A Fi rstWo rdon Pr obabilit y, Co un tablean dUn count ab leSets U N IT – 2 7 Hou rs Fu ndamental s of Lo gi c: Ba sic Co nnectives an d Tr uth Ta bles, Lo gi c Eq ui valence – The La w sof Lo gic, Lo gicalIm plication– Ru lesof Inference U N IT – 3 6 Hou rs Fu ndamental s of Lo gi c co ntd.: T he Us e of Qu an tifiers, Qu antifiers, Defi ni ti on s an d the Pr oof sof Th eorems U N IT – 4 7 Hou rs Pr opertie s of th e In tegers: Ma thematical In du ct ion, Th e We ll Or dering Pr inciple – Ma thematica lIn du ct ion,Re cursiveDefinitions PA RT – B U N IT – 5 7 Hou rs Re lation san dFu nctions: Ca rtesianPr oductsan d Re lat ion s, Fu nctions– Pl ain an dOn e-to- On e , On to Fu n ct ions – St irling Nu mbers of the S ec ond Ki nd , Spe ci al Fu nct io ns, The Pi geo n- ho lePr inciple,Fu nctionCo mpositionan dIn v er seFu nctions U N IT – 6 7 Hou rs Re lation sco ntd.:Pr opertieso fRe lations,Co mputerR eco gn ition– Ze ro - O ne Ma t ri cesan d Di recte dG ra phs,Pa rtialOr ders– H as seDi agram s, Eq uivalenceRe lationsan dPa rtiti on s U N IT – 7 6 Hou rs Gr oups : De finiti on s, Ex amples, an d El ementary Pr operties, Homomorphisms, Is omorphisms ,an dC yc licGr oups,Co sets,an dLa grange’sTh eorem. Co din gTh eory an dRi ngs:El ementsof Co dingT he or y, Th eHa mmingM et ric,Th ePa rity C h ec k,an dGe neratorMatrices D EP T. OF CSE,SJ BIT Pa ge 1
U N IT – 8 6 Hou rs Gr ou p Co des: De coding wi th Co set Le aders, Ha mming Ma trices Ri ngs an d Modular Ar ithmetic : Th e Ri ng St ructure – De finition an d Ex am ples, Ri ng P ro pe rt i es an d Su bstructures ,Th eIn tegersMo dulon Te x tB oo k:
U N IT – I Se tTh e ory: 6 Hou rs Se tsan dS u bsets, Se tOp erationsan dth eLa wsof Se tTh eor y, Co untingan dVe nnDiagrams, A Fi rstWo rdon Pr obabilit y, Co untableand Un countableSets D EP T. OF CSE,SJ BIT Pa ge 4
U NI TI 6 H ou rs S e t Theo ry Se ts : A s e t is a co llection of ob je cts, ca lled el em ents of th e s et. A se t ca n be b y li sting it s el ements b et ween br aces:A = { 1 , 2 , 3 , 4 , 5 }. Th e sy mb ol e is (o r b el on gs to ) a set. Fo r in st an ce 3 e A. I ts ne gatio n is re pres en tedby /e , e.g. 7 /e A. If th e se t Is fi nite, it s nu mb er of ele me nt s i s re pres en ted| A| ,e.g. if A={ 1 , 2 , 3 , 4 , 5 } then |A | = 5 So m ei mp o rta nt se tsar eth e fo llowing:
Th e su m 60 + 18 5 + 2 35 = 48 0 is th e nu mb er of st udents ta king ex ac tly one of th ose co urs es. Ve n n Di agrams: Ve n n di agrams ar e gr aphic re presenta- ti ons of se ts as en clo sedar eas in th e plane. Fo r in stance, in fi gure 2. 1 ,th e re ctangle re pre se nts th e un iversal se t (t he se t of al l el ement s co n- si dered in a gi ven pr oblem) an d th e sh aded re gion re p re sents a se t A. Th e ot her fi gu resre pres en tva rious se t opera ti o ns. D EP T. OF CSE,SJ BIT Pa ge 8
Ge neralize d Un ion an d In ters ec ti on : Gi ven a co llec- ti on of se tsA 1 , A 2 , ..., AN , th eir un ionis de fin ed as th e se tof elements th at b el ongto at le ast on e of th ese ts (h er e n re presents an in te ger in th e ra nge fr om 1 to N): D EP T. OF CSE,SJ BIT Pa ge 10
An alogously , t heir in tersection is th e s et of el eme nt s th at b el ong to a ll t he sets si mul ta ne ously: Th es e de finitions ca n be ap plied to in finite co llections of se ts as we ll.Fo r instance as sum et hatSm = {k n| k = 2 , 3 , 4 ,... } =se tof multiples of n gr eater th an n. Th en P ar titio ns : A pa rtition of a se t X is a co llection S of no n ov erlappingno n empty su bset s of X wh oseun ion is th ewh oleX. Fo ri nstance a pa rtition of X={ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 }couldbe S = {{ 1 , 2 , 4 , 8 } ,{ 3 , 6 } ,{ 5 , 7 , 9 , 10 }}. Gi ve n a pa rtition S of a se t X , ev ery el ementof X b el ongs to ex actly on eme mb er of S. Ex ample :Th e di vision of th ein tegersZ in to ev enan d o dd nu mb er s is a pa rtition: S = {E ,O} ,w hereE = { 2 n| n e Z} ,O = { 2 n+ 1 | ne Z}. Examp le : Th e di visions of Z in ne gative in te ge rs, p os itive in tegers an d ze ro is a pa rtition :S = {Z +^ , Z - , { 0 }}. Or dere d Pa irs, Ca rtesian Pro du ct: A n or dinary pa ir {a ,b} is a se t wi th tw o el ements. In a se t t he or der of the el ement sis ir relevant, so {a ,b} = {b, a}. If th e or der of th e el ements is relevant, th e n we us e a di fferent ob je ct ca lledor dered pa ir, re presented (a ,b). No w(a ,b) = (b, a ) (u nless a = b). In ge ne ral ( a ,b) = (a!, b!) i ff a = a!^ an db = b!. D EP T. OF CSE,SJ BIT Pa ge 11
Pr op er ties of pr obabil ity: Le t P be a pr obability fu nc- ti onon a sa mple sp ace S. T he n: TH ECO NCEPTOF PROBALITY: Pr (A)=|A |/ |S| wh ere|A |is an ev entan d|S| is sam plespace Pr (A)=|A |/ |S |=(|S|- |A |)/|S|= 1 - (| A|/|S|)= 1 - Pr (A). Pr (A)= 0 if an don lyif Pr (A)= 1 an dPr (A)= 1 if an don l yif Pr (A )= 0 AD DITIO NTHEROM: D EP T. OF CSE,SJ BIT Pa ge 13
Su ppos eA an dB ar e 2 ev entsis a sa mplesp aceS th enA UB is an ev entin S co nsist in gof ou tcome sth at ar ein A or B or bo than dA ∩ B is an ev entis S co nsi st i ng of ou tcomes th atarecomm on to A an d B. ac cordingly by the pr inciple o f ad di ti on we ha ve |A UB |= |A |+|B|- |A ∩B |and fo rmula 1 gives Pr (AUB)=|AUB|/|S|=(|A|+|B |- |A ∩B|)/|S| = |A |/|S | +|B|/|S| - |A ∩ B| / |S| Pr (AUB )=P r(A)+Pr( B) - Pr (A∩ B) MU TUAL YEX CLUSIVEEV ENTS: Tw oev entsA a ndB in a sa mplesp acear esa idto be mu tualex cl usiveif A ∩ B =Ø t he n Pr ( A∩B )= 0 an dthe ad di ti ont heorem re ducesto Pr (AUB)=Pr(A)+Pr(B) If A 1 , A 2 …….An a re mu tualy ex cl usive ev e nt s, th en Pr (A 1 U A 2 U…….UAn)= Pr(A 1 )+Pr(A 2 )+….+Pr(An ) CO NDITIONA LPROBABILITY: I f E is an ev entin a fi nitesa mpleS wi thPr (E)> 0 th enth epr obability th atan ev ent A in S oc cur s wh en E ha s al ready o cc urred is ca lledt he pr obability of A re lative to E or the co nditiona lpr obability of A , gi venE Th i spr obabilit y, de notedby Pr (A|E)is de finedby Pr (A|E)=| A∩ E| /|E |fr omth is|A ∩ E| =|E|. Pr(A|E) Pr ( A∩ E) =| A∩ E| / S= |=|E|/|S|. Pr (A|E)=Pr(E). P r(A|E) Ex am ple:Fi nd th epr obability of ob t ai ning a su m of 10 af terro llingtw ofa irdi ce. Fi nd th epr obability of that ev entifweknowthat at leasto ne of th e di cesh ows 5 p oi nts. A n sw er : We ca ll E — “o btaining su m 10 ”an d F — “a tl ea st on eof t he di ce sh ows 5 p oi nts”. Th e nu mb er of p os sibleou t co m es is 6 × 6 —
U N IT – II Fu ndamentalsof L og ic: 7 Hou rs Ba sicCo nnectivesan dT ru thTa bl es, Lo gicEquivalence Th eLa wsof Logic, Lo gicalImplication Ru lesof In fe r ence D EP T. OF CSE,SJ BIT Pa ge 16
U N IT II 7 H ou rs Fu ndamental sof L ogic I nt r od uction: Propos i ti on s: A pr oposition is a de clarative se ntence t hat is ei ther tr ue or fa lse(but no t b ot h). Fo r in stance , th e fo llowing ar e pr op os itions: “P arisi s in Fr ance” (t rue), “L ondon is in De nmar k” (f alse), “ 2 < 4 ” (t rue), “ 4 = 7 (f alse)”. Ho wever th e fo llowing ar e not pr op os it io ns: “w hat is yo ur na me?” (t his is a qu estion), “d o yo ur ho mework” ( this i s a co mm an d), “t his se nt e nce is fa lse” (ne it her tr ue no r fa lse), “x is a n ev en num be r” (i t de p en ds on wh at x re pres en ts), “S o cr ates” (i t is no t ev en a se ntence). Th e t ru th or fa lseho od of a pr op os i ti on is ca l led its tr uthva lue. Ba si cCo nnectivesan dTruth Ta bl es: Co nnective s ar e us ed fo rmaking co mpound pr opositions. Th e ma in on es are th e fo llowing(p and q r e pres en t gi ve nprop os itions): Meani ng “not p” “ p an dq” “ p or q (or b oth)” “e ithe r p or q, bu t no t b oth” “i fp th en q” “ p if an d on ly if q” Th e tr uth va lue of a co mp ou nd pr op os ition de p en ds on ly on th e va lue of it s co mponen ts. Wr iting F fo r“f alse” an d T fo r“t rue”, we ca nsu mmarize th em eaning o f th eco nnectivesin th efo llowingway: p q ¬p T T F T F F F T T F F T No t e t ha t ∨ r ep res en ts a no n-ex cl usive or , i. e., p ∨ q is tr ue wh enan y of p, q is true D EP T. OF CSE,SJ BIT Pa ge 17 R ep re se nt ed ¬p p ∧ q p ∨ q p ⊕ q p → q p ↔ q Name N e ga ti on Co njuncti on Disj u nction Ex clusiv eOr Im pl i ca tion Bi c ondi ti onal p →p ↔ q T T F F T F T T
p ∧ q p ∨ q p ⊕ q T T T F
i s fa lse: “i f 2 < 4 t he n Lo nd on is in De nm ar k” (t rue → false). I n mi gh t se em st ra ng e th at “p → q” is co nsidered tr ue wh en p is fa l se , rega rd l es s o f th e tr uthva lue of q. T hi s wi llb ec omecl earer wh enwe st udypr edicates su ch as “if x is a mu ltiple of 4 th en x is a mu ltiple of 2 ”. That im pl ic ati on is ob viously tr ue, al thoug h fo rth e pa rtic ul ar ca s ex = 3 it b ec omes“i f 3 is a mu ltiple of 4 t hen 3 i sa mu ltiple of 2 ”. T h e pr op os ition p ↔ q, re ad “p if an d on ly if q ”, is ca lled bi con- di tional. It is true pr ecis ely wh en p an d q ha ve th e sa me tr uth va lue,i. e., th ey ar e both tr ue or b ot h f a l se. L ogica l Eq uivalence: No te th at th e co mpo un d pr op os i- tions p → q an d ¬p ∨ q ha veth esa met ru thvalues: p q ¬p (^) ¬p ∨ (^) q p → T T F T T T F F F F F T T T T F F T T T Wh e n tw o co mp ou nd pr op os itions ha ve th e sa me tr uth va lues no ma tter wh at tr ut h va lu e th eir co nst it uent pr opo si ti ons ha ve, th ey ar e ca lled lo gical ly eq uivalent. Fo r in stanc e p → qan d¬p ∨ q ar e lo gicallyequivalent, an d we wr ite it: p → q ≡ ¬p ∨ q No t e th at th at tw opr op os itions A an d B ar e lo gically eq uiva le ntpr ecisely wh en A ↔ B i sa ta utology. Ex ampl e: De Mo rgan’s La ws fo r Logi c. Th e fo llowing pr op os itions ar e lo gi ca lly eq u iv alent: ¬ (p ∨ q) ≡ ¬p ∧ ¬q ¬( p∧ q) ≡ ¬p ∨ ¬q D EP T. OF CSE,SJ BIT Pa ge 19
p q ¬p ¬q (^) p ∨ (^) q ¬(p ∨ (^) q) ¬p ∧ (^) ¬q p ∧ (^) q ¬(p ∧ (^) q) ¬p ∨ (^) ¬q T T F F T F F T F F T F F T T F F F T T F T T F T F F F T T F F T T F T T F T T Ex ampl e: Th e fo llowingpr op os itionsar elo gicallyequivalent: p ↔ q ≡ (p → q) ∧ (q → p) Ag ain , th is ca n be ch ec kedwi th th e tr uthtabl es : p q p →q → (^) (p → q) ∧ (^) (q p ↔ q T T T T T T T F F T F F F T T F F F F F T T T T Ex ercis e: Ch eckth efo llowinglo gicalequivalences: ¬( p→ q) ≡ p ∧ ¬q p → q ≡ ¬q → ¬p ¬( p↔ q)≡ p ⊕ q C on vers e, C on trapo si tive: Th e co nverse of a co nditional pr op os ition p → q is t h e pr opo si ti on q → p. As we ha ve se en, th e bi - co nditio na l proposition is eq uivalen tto th ec onjunctionof a co nditionalpr op os ition an it sco nverse. p ↔ q ≡ (p → q) ∧ (q → p) So ,fo r in stance, s ay ing th at “J oh n is ma rried if an d on ly if he ha s a sp ou se” is t he sa m eas sa ying “i fJ oh n is ma rried th en he ha s a sp ou se”an d “i fhe ha s a sp ou sethen h e is ma rr ied”. D EP T. OF CSE,SJ BIT Pa ge 20