A partition of a set S is a collection of n disjoint subsets P1, P2, ... Pn that satisfies the following three conditions − No subset is empty − Pi ≠ ∅ for all 0 < i ≤ n Union covers the entire set − P1 ∪ P2 ∪ ... ∪ Pn = S Subsets are mutually disjoint − Pa ∩ Pb = ∅ for a ≠ b S = { a, b, c, d, e, f, g, h } ... Read More
A spanning tree of a weighted, connected, undirected graph G whose total edge weight is less than or equal to the weight of every other possible spanning tree is called a Minimum Spanning Tree (MST). The weight of a spanning tree is the sum of all the weights assigned to each of its edges. The two most popular algorithms to find an MST are Kruskal's Algorithm and Prim's Algorithm. Kruskal's Algorithm Kruskal's algorithm is a greedy algorithm that builds the MST by picking the smallest weighted edge at each step, as long as it does not form a ... Read More
Mathematical logic uses formal notation to represent statements, determine their truth values, and reason about them systematically. The key building blocks are propositions, predicates, well-formed formulas, and quantifiers. Proposition A proposition is a declarative statement that has either a truth value "true" or a truth value "false". A proposition consists of propositional variables and connectives. We denote the propositional variables by capital letters (A, B, etc). The connectives connect the propositional variables. Some examples of propositions − "The sun rises in the east" − True "12 + 5 = 20" − False "x + 2 ... Read More
Mathematics provides the theoretical foundation for computer science, engineering, and many other fields. It can be broadly classified into two categories − Continuous Mathematics − It is based upon the continuous number line or the real numbers. It is characterized by the fact that between any two numbers, there are almost always an infinite set of numbers. For example, a function in continuous mathematics can be plotted as a smooth curve without breaks. Discrete Mathematics − It involves distinct, separated values. Between any two points, there are a countable number of points. For example, if we have a ... Read More
A logical connective is a symbol used to connect two or more propositional or predicate logics in such a manner that the resultant logic depends only on the input logics and the meaning of the connective used. There are five fundamental connectives in mathematical logic − OR (∨) − Disjunction AND (∧) − Conjunction NOT (¬) − Negation IF-THEN (→) − Implication IF AND ONLY IF (⇔) − Biconditional OR (∨) − Disjunction The OR operation of two propositions A and B (written as A ∨ B) is true if at least one of ... Read More
Kirchhoff's theorem (also known as the Matrix Tree Theorem) provides a way to find the number of spanning trees in a connected graph using matrices. Instead of manually listing all spanning trees, this theorem lets you compute the count using the determinant of a special matrix derived from the graph. How Kirchhoff's Theorem Works The process involves three steps − Create the Adjacency Matrix (A) − Fill entry A[i][j] as 1 if there is an edge between vertex i and vertex j, else 0. Create the Degree Matrix (D) − A diagonal matrix where D[i][i] equals ... Read More
A Hamiltonian graph is a connected graph that contains a cycle which visits every vertex exactly once and returns to the starting vertex. This cycle is called a Hamiltonian cycle. A Hamiltonian path (or walk) passes through each vertex exactly once but does not need to return to the starting vertex. Unlike Eulerian graphs (which require traversing every edge), Hamiltonian graphs focus on visiting every vertex. Sufficient Conditions for Hamiltonian Graphs There is no simple necessary and sufficient condition to determine if a graph is Hamiltonian. However, two important theorems provide sufficient conditions − Dirac's Theorem ... Read More
In graph theory, isomorphism and homomorphism are ways to compare the structure of two graphs. Isomorphism checks whether two graphs are structurally identical, while homomorphism is a more relaxed mapping that preserves adjacency but does not require a one-to-one correspondence. Isomorphism Two graphs G and H are called isomorphic (denoted by G ≅ H) if they contain the same number of vertices connected in the same way. Formally, there must exist a bijective function f: V(G) → V(H) such that two vertices are adjacent in G if and only if their images are adjacent in H. Checking ... Read More
The cardinality of a set S, denoted by |S|, is the number of elements in the set. This number is also referred to as the cardinal number. If a set has an infinite number of elements, its cardinality is ∞. Examples of Cardinality |{1, 4, 3, 5}| = 4 (finite set with 4 elements) |{1, 2, 3, 4, 5, ...}| = ∞ (infinite set of natural numbers) |{}| = 0 ... Read More
A function assigns to each element of a set, exactly one element of a related set. Functions find their application in various fields like representation of the computational complexity of algorithms, counting objects, study of sequences and strings, to name a few. Function − Definition A function or mapping (defined as f: X → Y) is a relationship from elements of one set X to elements of another set Y (X and Y are non-empty sets). X is called the Domain and Y is called the Codomain of function f. Function f is a relation on X ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Economics & Finance