The Wayback Machine - https://web.archive.org/web/20241118083639/https://www.geeksforgeeks.org/last-minute-notes-discrete-mathematics/
Open In App

Last Minute Notes – Discrete Mathematics

Last Updated : 28 Jun, 2021
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow
See Last Minute Notes on all subjects here.

Propositional Logic

  1. Implication( →): For any two propositions p and q, the statement “if p then q” is called an implication and it is denoted by p → q.
  2.  \begin{tabular}{ |c|c|c| }      \hline     p & q & p\rightarrow q\\     \hline     \hline     T & T & T\\     \hline     T & F & F\\     \hline     F & T & T\\     \hline     F & F & T\\     \hline     \end{tabular}
  3. if and only if(↔): For any two propositions p and q, the statement “p if and only if(iff) q” is called a biconditional and it is denoted by p ↔ q.
  4.  \begin{tabular}{ |c|c|c| }      \hline     p & q & p\leftrightarrow q\\     \hline     \hline     T & T & T\\     \hline     T & F & F\\     \hline     F & T & F\\     \hline     F & F & T\\     \hline     \end{tabular} De Morgan’s Law :
    •  \neg (p\wedge q) \equiv \neg p \vee \neg q
    •  \neg (p\vee q) \equiv \neg p \wedge \neg q
      Special Conditional Statements 1.Implication : p\rightarrow q 2.Converse : The converse of the proposition p\rightarrow q is q\rightarrow p 3.Contrapositive : The contrapositive of the proposition p\rightarrow q is \neg q\rightarrow \neg p 4.Inverse : The inverse of the proposition p\rightarrow q is \neg p\rightarrow \neg q Types of propositions based on Truth values 1.Tautology – A proposition which is always true, is called a tautology. 2.Contradiction – A proposition which is always false, is called a contradiction. 3.Contingency – A proposition that is neither a tautology nor a contradiction is called a contingency. There are two very important equivalences involving quantifiers
    1.  \forall x(P(x)\wedge Q(x)) \equiv \forall xP(x) \wedge \forall xQ(x)
    
    2.  \exists x(P(x)\vee Q(x)) \equiv \exists xP(x) \vee \exists xQ(x) 
    
    Rules of inference   \begin{tabular}{||c||c||c||} \hline Rule of Inference & Tautology & Name\\ \hline  \rule{0pt}{8ex} \shortstack[l]{p \\ p\rightarrow q \\ \rule{1cm}{0.5pt}\\ \therefore q}& (p\wedge (p\rightarrow q)) \rightarrow q & Modus Ponens \\ \hline  \rule{0pt}{8ex} \shortstack[l]{\neg q \\ p\rightarrow q \\ \rule{1cm}{0.5pt}\\ \therefore \neg p}& (\neg q \wedge (p\rightarrow q)) \rightarrow \neg p & Modus Tollens \\ \hline  \rule{0pt}{8ex} \shortstack[l]{p\rightarrow q \\ q\rightarrow r \\ \rule{1.3cm}{0.5pt}\\ \therefore p \rightarrow r}& ((p\rightarrow q) \wedge (q\rightarrow r)) \rightarrow (p\rightarrow r) & Hypothetical syllogism \\ \hline  \rule{0pt}{8ex} \shortstack[l]{ \neg p \\ p\vee q \\ \rule{0.8cm}{0.5pt}\\ \therefore q} & (\neg p \wedge (p\vee q)) \rightarrow q & Disjunctive Syllogism \\ \hline  \rule{0pt}{8ex} \shortstack[l]{p \\ \rule{1.5cm}{0.5pt} \\ \therefore (p \vee q)}& p\rightarrow (p\vee q) & Addition \\ \hline  \rule{0pt}{8ex} \shortstack[l]{ (p\wedge q)\rightarrow r \\ \rule{2.3cm}{0.5pt}\\ \therefore p\rightarrow (q\rightarrow r)} & ((p\wedge q)\rightarrow r) \rightarrow (p\rightarrow (q\rightarrow r)) & Exportation\\ \hline  \rule{0pt}{8ex} \shortstack[l]{p\vee q\\\neg p\vee r \\ \rule{1.2cm}{0.5pt} \\ \therefore q\vee r}& ((p\vee q) \wedge(\neg p\vee r)) \rightarrow q\vee r & Resolution \\ \hline   \end{tabular}

    Combinatrics

    Permutation: A permutation of a set of distinct objects is an ordered arrangement of these objects.

         \begin{flalign*} P(n, r) &= n * (n-1) * ... * (n-r+1)\\ &= \frac{n * (n-1) * ... * (n-r+1) * (n-r) *...* 2 * 1}{(n-r) * (n-r-1) * .... * 2 * 1}\\ &= \frac{n!}{(n-r)!} \end{flalign*}

    Combination: A combination of a set of distinct objects is just a count of the number of ways a specific number of elements can be selected from a set of a certain size. The order of elements does not matter in a combination.  \therefore P(n, r) = C(n, r) * P(r, r)\\ which gives us-

         \begin{flalign*} C(n, r) &= \frac{P(n, r)}{P(r, r)}\\ &= \frac{n!}{(n-r)!} * \frac{1}{r!}\\ &= \frac{n!}{r!(n-r)!}& \end{flalign*}

    Binomial Coefficients: The r-combinations from a set of n elements if denoted by \binom{n}{r}. This number is also called a binomial coefficient since it occurs as a coefficient in the expansion of powers of binomial expressions. Let x and y be variables and n be a non-negative integer. Then

         \begin{flalign*} (x+y)^n &= \sum_{j=0}^{n} \binom{n}{j} x^{n-j}y^j\\ &= \binom{n}{0}x^{n} + \binom{n}{1}x^{n-1}y +...+ \binom{n}{n-1}xy^{n-1} + \binom{n}{n}y^{n} \end{flalign*}

    The binomial expansion using Combinatorial symbols
    (a+b)^n = ^nC_0 a^n b^0 + ^nC_1 a^{n-1} b^1 + ^nC_2 a^{n-2} b^2 .. + ^nC_{n-k} a^k b^{n-k} .. +^nC_n a^0 b^n

    Set Theory

    A Set is an unordered collection of objects, known as elements or members of the set. An element ‘a’ belong to a set A can be written as ‘a ∈ A’, ‘a ∉ A’ denotes that a is not an element of the set A. Equal sets Two sets are said to be equal if both have same elements. For example A = {1, 3, 9, 7} and B = {3, 1, 7, 9} are equal sets. NOTE: Order of elements of a set doesn’t matter. Subset A set A is said to be subset of another set B if and only if every element of set A is also a part of other set B. Denoted by ‘⊆‘. ‘A ⊆ B ‘ denotes A is a subset of B. To prove A is the subset of B, we need to simply show that if x belongs to A then x also belongs to B. To prove A is not a subset of B, we need to find out one element which is part of set A but not belong to set B. asubsetB ‘U’ denotes the universal set. Above Venn Diagram shows that A is a subset of B. Size of a Set Size of a set can be finite or infinite. For example
    Finite set: Set of natural numbers less than 100.
    Infinite set: Set of real numbers.
    Size of the set S is known as Cardinality number, denoted as |S|. Note: Cardinality of a null set is 0. Power Sets The power set is the set all possible subset of the set S. Denoted by P(S). Example: What is the power set of {0, 1, 2}? Solution: All possible subsets {∅}, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}. Note: Empty set and set itself is also the member of this set of subsets. Cardinality of power set is 2^n, where n is the number of elements in a set. Cartesian Products Let A and B be two sets. Cartesian product of A and B is denoted by A × B, is the set of all ordered pairs (a, b), where a belong to A and b belong to B.
    A × B = {(a, b) | a ∈ A ∧ b ∈ B}.
    The cardinality of A × B is N*M, where N is the Cardinality of A and M is the cardinality of B. Note: A × B is not the same as B × A. Union Union of the sets A and B, denoted by A ∪ B, is the set of distinct element belongs to set A or set B, or both. Intersection The intersection of the sets A and B, denoted by A ∩ B, is the set of elements belongs to both A and B i.e. set of the common element in A and B. Disjoint Two sets are said to be disjoint if their intersection is the empty set .i.e sets have no common elements. Set Difference Difference between sets is denoted by ‘A – B’, is the set containing elements of set A but not in B. i.e all elements of A except the element of B. Complement The complement of a set A, denoted by A^\complement, is the set of all the elements except A. Complement of the set A is U – A.
      Formula:
    1. A\cup B =n(A) + n(B) - n(A\cap B)


    2. A-B=A\cap \bar{B}


    Group A non-empty set G, (G, *) is called a group if it follows the following axiom:
    • Closure:(a*b) belongs to G for all a, b ∈ G.
    • Associativity: a*(b*c) = (a*b)*c ∀ a, b, c belongs to G.
    • Identity Element:There exists e ∈ G such that a*e = e*a = a ∀ a ∈ G
    • Inverses:∀ a ∈ G there exists a-1 ∈ G such that a*a-1 = a-1*a = e

    Relations And Functions

    |A| = m and |B| = n, then 1. No. of functions from A to B = nm
    2. No. of one to one function = (n, P, m)
    3. No. of onto function =nm – (n, C, 1)*(n-1)m + (n, C, 2)*(n-2)m …. +(-1)m*(n, C, n-1), if m >= n; 0 otherwise
    4. Necessary condition for bijective function |A| = |B|
    5. The no. of bijection function =n!
    6. No. of relations =2mn
    7. No. of reflexive relations =2n(n-1)
    8. No. of symmetric relations = 2n(n+1)/2
    9. No. of Anti Symmetric Relations = 2n*3n(n-1)/2
    10. No. of asymmetric relations = 3n(n-1)/2
    11. No. of irreflexive relations = 2n(n-1)
    12. A relation is a partial order if
        1) Reflexive
        2) Antisymmetric
        3) Transitive
    
    13. Meet Semi Lattice :
        For all a, b belongs to L a∧b exists 
    14. Join Semi Lattice
        For all a, b belongs to L a∨b exists 
    15. A poset is called Lattice if it is both meet and join semi-lattice
    16. Complemented Lattice : Every element has complement
    17. Distributive Lattice : Every Element has zero or 1 complement .
    18. Boolean Lattice: It should be both complemented and distributive. Every element has exactly one complement.
    19. A relation is an equivalence if
        1) Reflexive
        2) symmetric
        3) Transitive
    

    Graph Theory

    1. No. of edges in a complete graph = n(n-1)/2
    2. Bipartite Graph : There is no edges between any two vertices of same partition . In complete bipartite graph no. of edges =m*n
    3. Sum of degree of all vertices is equal to twice the number of edges.
    4. Maximum no. of connected components in graph with n vertices = n
    5. Minimum number of connected components =
    0 (null graph)
    1 (not null graph) 
    
    6. Minimum no. of edges to have connected graph with n vertices = n-1
    7. To guarantee that a graph with n vertices is connected, minimum no. of edges required = {(n-1)*(n-2)/2 } + 1
    8. A graph is euler graph if it there exists atmost 2 vertices of odd – degree
    9. Tree
        -> Has exactly one path btw any two vertices
        -> not contain cycle
        -> connected
        -> no. of edges = n -1
    
    10. For complete graph the no . of spanning tree possible = nn-2
      11. For simple connected planar graph
    • A graph is planar if and only if it does not contain a subdivision of K5 and K3, 3 as a subgraph.
    • Let G be a connected planar graph, and let n, m and f denote, respectively, the numbers of vertices, edges, and faces in a plane drawing of G. Then n – m + f = 2.
    • Let G be a connected planar simple graph with n vertices and m edges, and no triangles. Then m ≤ 2n – 4.
    • Let G be a connected planar simple graph with n vertices, where n ? 3 and m edges. Then m ≤ 3n – 6.

Similar Reads

Pandas Series dt.minute | Extract Minute from DateTime Series in Pandas
Pandas Series.dt.minute attribute returns a NumPy array containing the minutes of the DateTime in the underlying data of the given series object. Example C/C++ Code import pandas as pd sr = pd.Series(['2012-10-21 09:30', '2019-7-18 12:30', '2008-02-2 10:30', '2010-4-22 09:25', '2019-11-8 02:22']) idx = ['Day 1', 'Day 2', 'Day 3', 'Day 4', 'Day 5']
2 min read
Discrete Mathematics | Types of Recurrence Relations - Set 2
Prerequisite - Solving Recurrences, Different types of recurrence relations and their solutions, Practice Set for Recurrence Relations The sequence which is defined by indicating a relation connecting its general term an with an-1, an-2, etc is called a recurrence relation for the sequence. Types of recurrence relations First order Recurrence relat
4 min read
Discrete Mathematics - GATE CSE Previous Year Questions
Solving GATE Previous Year's Questions (PYQs) not only clears the concepts but also helps to gain flexibility, speed, accuracy, and understanding of the level of questions generally asked in the GATE exam, and that eventually helps you to gain good marks in the examination. Previous Year Questions help a candidate practice and revise for GATE, whic
4 min read
Discrete Mathematics | Representing Relations
Prerequisite - Introduction and types of Relations Relations are represented using ordered pairs, matrix and digraphs: Ordered Pairs - In this set of ordered pairs of x and y are used to represent relation. In this corresponding values of x and y are represented using parenthesis. Example: {(1, 1), (2, 4), (3, 9), (4, 16), (5, 25)}This represent sq
2 min read
Types of Sets in Discrete Mathematics
A set in discrete mathematics is a collection of distinct objects, considered as an object in its own right. Sets are fundamental objects in mathematics, used to define various concepts and structures. In this article, we will discuss Types of Sets in Discrete Structure or Discrete Mathematics. Also, we will cover the examples. Let's discuss one by
13 min read
Types of Proofs - Predicate Logic | Discrete Mathematics
The most basic form of logic is propositional logic. Propositions, which have no variables, are the only assertions that are considered. Because there are no variables in propositions, they are either always true or always false.Example - P: 2 + 4 = 5. (Always False) is a proposition.Q: y * 0 = 0. (Always true) is a proposition.The majority of math
14 min read
Discrete Mathematics | Hasse Diagrams
Hasse Diagram A Hasse diagram is a graphical representation of the relation of elements of a partially ordered set (poset) with an implied upward orientation. A point is drawn for each element of the partially ordered set (poset) and joined with the line segment according to the following rules:   If p<q in the poset, then the point correspondin
10 min read
Four Color Theorem and Kuratowski’s Theorem in Discrete Mathematics
The Four Color Theorem and Kuratowski's Theorem are two fundamental results in discrete mathematics, specifically in the field of graph theory. Both theorems address the properties of planar graphs but from different perspectives. In this article, we will understand about Four Color Theorem and Kuratowski’s Theorem in Discrete Mathematics, their de
14 min read
Prime Numbers in Discrete Mathematics
Prime numbers are the building blocks of integers, playing a crucial role in number theory and discrete mathematics. A prime number is defined as any integer greater than 1 that has no positive divisors other than 1 and itself. Understanding prime numbers is fundamental to various mathematical concepts and applications, including cryptography, codi
9 min read
PDNF and PCNF in Discrete Mathematics
PDNF (Principal Disjunctive Normal Form)It stands for Principal Disjunctive Normal Form. It refers to the Sum of Products, i.e., SOP. For eg. : If P, Q, and R are the variables then (P. Q'. R) + (P' . Q . R) + (P . Q . R') is an example of an expression in PDNF. Here '+' i.e. sum is the main operator. You might be confused about whether there exist
4 min read
Python | Pandas DatetimeIndex.minute
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas DatetimeIndex.minute attribute outputs an Index object containing the minute values present in each of the entries of the Datetim
2 min read
Python | Pandas Period.minute
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Period.minute attribute return an integer value. The returned value represents the number of minutes in the given Period object.
2 min read
Python | Pandas PeriodIndex.minute
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas PeriodIndex.minute attribute return an Index object containing the minute value for each period in the given PeriodIndex object.
2 min read
Python | Pandas Timestamp.minute
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Timestamp.minute attribute return the minute value in the given Timestamp object. If the minute value has not been set then it re
2 min read
Basics of Discrete Event Simulation using SimPy
SimPy is a powerful process-based discrete event simulation framework written in Python. Installation : To install SimPy, use the following command - pip install simpy Basic Concepts : The core idea behind SimPy is the generator function in Python. The difference between a normal function and a generator is that a normal function uses the "return"
3 min read
Discrete Colour Scale in Plotly Python
In the Cartesian plane for X and Y coordinates, colors can be used to represent data on the graph to make it more understandable. This color label can be used to display continuous or discrete data both. Python Plotly can be used to display both the color representation i.e. continuous(moments in time) and discrete(categorical). In this article, we
2 min read
Python - Discrete Geometric Distribution in Statistics
scipy.stats.geom() is a Geometric discrete random variable. It is inherited from the of generic methods as an instance of the rv_discrete class. It completes the methods with details specific for this particular distribution. Parameters : x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale parameter. Default = 1 mo
2 min read
Python - Discrete Hyper-geometric Distribution in Statistics
scipy.stats.hypergeom() is a hypergeometric discrete random variable. It is inherited from the of generic methods as an instance of the rv_discrete class. It completes the methods with details specific for this particular distribution. Parameters : x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale parameter. Defa
2 min read
Python - Yule-Simon Discrete Distribution in Statistics
scipy.stats.yulesimon() is a Yule-Simon discrete random variable. It is inherited from the of generic methods as an instance of the rv_discrete class. It completes the methods with details specific for this particular distribution. Parameters : x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale parameter. Default
2 min read
Python - Zipf Discrete Distribution in Statistics
scipy.stats.zipf() is a zipf discrete random variable. It is inherited from the of generic methods as an instance of the rv_discrete class. It completes the methods with details specific for this particular distribution. Parameters : x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale parameter. Default = 1 moments
2 min read
Python - Skellam Discrete Distribution in Statistics
scipy.stats.skellam() is a Skellam discrete random variable. It is inherited from the of generic methods as an instance of the rv_discrete class. It completes the methods with details specific for this particular distribution. Parameters : x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale parameter. Default = 1 m
2 min read
Python - Poisson Discrete Distribution in Statistics
scipy.stats.poisson() is a poisson discrete random variable. It is inherited from the of generic methods as an instance of the rv_discrete class. It completes the methods with details specific for this particular distribution. Parameters : x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale parameter. Default = 1 m
2 min read
Python - Uniform Discrete Distribution in Statistics
scipy.stats.randint() is a uniform discrete random variable. It is inherited from the of generic methods as an instance of the rv_discrete class. It completes the methods with details specific for this particular distribution. Parameters : x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale parameter. Default = 1 m
2 min read
Python - Planck Discrete Distribution in Statistics
scipy.stats.planck() is a Planck discrete random variable. It is inherited from the of generic methods as an instance of the rv_discrete class. It completes the methods with details specific for this particular distribution. Parameters : x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale parameter. Default = 1 mom
2 min read
Python - Logarithmic Discrete Distribution in Statistics
scipy.stats.logser() is a Logarithmic (Log-Series, Series) discrete random variable. It is inherited from the of generic methods as an instance of the rv_discrete class. It completes the methods with details specific for this particular distribution. Parameters : x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale
2 min read
Python - Negative Binomial Discrete Distribution in Statistics
scipy.stats.nbinom() is a Negative binomial discrete random variable. It is inherited from the of generic methods as an instance of the rv_discrete class. It completes the methods with details specific for this particular distribution. Parameters : x : quantiles loc : [optional]location parameter. Default = 0 scale : [optional]scale parameter. Defa
2 min read
Generating Basic Discrete Time Signals
Generating basic discrete-time signals for Discrete-Time Signal ProcessingUnit Step, Unit Impulse, Unit Ramp, exponential signals are very commonly used signals in signal processing to perform various operations. Unit step signal is given byUnit impulse signal is given byUnit ramp signal is given byExponential signal is given by Examples: Input : U
2 min read
Discrete Linear Convolution of Two One-Dimensional Sequences and Get Where they Overlap in Python
In this article, we will be looking at the approach to returning the discrete linear convolution of two one-dimensional sequences and getting where they overlap in Python. Numpy np.convolve() To return the discrete linear convolution of two one-dimensional sequences, the user needs to call the numpy.convolve() method of the Numpy library in Python.
3 min read
Get Discrete Linear Convolution of 2D sequences and Return Middle Values in Python
In this article let's see how to return the discrete linear convolution of two one-dimensional sequences and return the middle values using NumPy in python. numpy.convolve method : The numpy.convolve() Converts two one-dimensional sequences into a discrete, linear convolution. In signal processing, the convolution operator is used to describe the e
4 min read
Calculate the n-th Discrete Difference in Python
In this post, we will see how we can calculate the n-th Discrete Difference in Python. We will use the numpy.diff() and, MaskedArray.diff() methods in Python to calculate the first difference and for higher values, the diff() method is called recursively to perform the same set of tasks. Calculate the n-th Discrete Difference using the numpy.diff()
3 min read
Article Tags :
Practice Tags :
three90RightbarBannerImg