Ds mini finale
Ds mini finale
Ds mini finale
Multigraph example :-
A multigraph is a type of graph where multiple edges (more than one)
can exist between the same pair of vertices. In a multigraph, it is
allowed to have multiple edges (also called parallel edges) between
the same pair of nodes.
Example of a Multigraph:
Let’s consider a multigraph with the following vertices and edges:
• Vertices: V={A,B,C}.
• Edges: E={{A,B},{A,B},{B,C}.
In this multigraph:
• There are two edges between A and B, indicating multiple
connections between these two vertices.
• There is one edge between B and C.
This can be visually represented as:
css
Copy code
A —— B —— C
| |
----
The Cartesian product of two sets A and B, denoted by A×B, is the set
of all possible ordered pairs where the first element of each pair comes
from set A and the second element comes from set B.
Mathematically, the Cartesian product A×B is defined as:
A×B={(a,b)∣a∈A and b∈B}.
• Here, A is any element of set A, and B is any element of set B.
• Each element of the Cartesian product is an ordered pair,
meaning the order of elements matters (i.e., (a,b)≠(b,a) .
Example of Cartesian Product
Let’s consider two sets:
• Set A={1,2}
• Set B={a,b}
The Cartesian product A×B consists of all possible ordered pairs where
the first element is from A and the second element is from B.
A×B={(1,a),(1,b),(2,a),(2,b)}.
What is Difference between subset and proper set?
1. Subset ( A⊆B ):
A set A is called a subset of a set B if every element of A is also an
element of B. This is written as:
A⊆B
In other words, if all elements of A are contained in B, then A is a
subset of B.
• Note: A set is always a subset of itself. That is, A⊆A.
• A subset can either be equal to the original set B or a smaller set
with fewer elements than B.
Example:
Let:
A={1,2},B={1,2,3,4}
• Subset: A⊆B because all elements of A (1 and 2) are also in B.
Key Differences:
Property Subset Proper Subset
Every element of A is in B (can Every element of A is in B,
Definition
be equal to B) and A≠B
Notation A⊆B A⊂B
Equality A can be equal to B A cannot be equal to B
Example A={1,2},B={1,2}⇒A⊆B A={1,2},B={1,2,3}⇒A⊂B
Self- A set is always a subset of A set is never a proper
subset itself subset of itself
A —— B
| |
D —— C
This satisfies the condition, as no two adjacent vertices share the same
color.
Applications of Graph Coloring:
Graph coloring has many applications in real-world problems,
particularly in scenarios involving resource allocation, scheduling, and
optimization. Some of the key applications include:
8. What is Tautology?
In logic, a tautology is a statement that is always true, regardless of
the truth values of the individual components or variables involved. It
is a formula or proposition that is true in every possible interpretation.
Tautologies are often used in logical proofs and reasoning to
demonstrate that a conclusion is universally valid. In simple terms, no
matter what values you assign to the components of a tautology, the
overall result is always true.
Example of a Tautology:
Consider the logical statement:
P∨¬P
Where:
• P is a logical variable (it can be true or false),
• ¬P represents the negation of P (if P is true, ¬P is false, and vice
versa),
• ∨ represents the logical OR operation.
This statement says "P OR not P."
Truth Table for P∨¬P :
P ¬P P∨¬P
True False True
False True True
• When P is True, ¬P is False, and P∨¬P evaluates to True.
• When P is False, ¬P is True, and P∨¬P evaluates to True.
In both cases, P∨¬P is True, so the statement is a tautology.
Why is it a Tautology?
A tautology is a logical expression that is always true, and P∨¬PP \vee
\neg PP∨¬P is true regardless of whether PPP is true or false. The key is
that, in any case, either PPP is true, or ¬P\neg P¬P (not PPP) is true, so
the whole statement is always true. This makes it a tautology.
Another Example:
Consider the logical expression:
P→(Q∨¬Q)
Where:
• P is a proposition,
• Q is another proposition,
• → represents logical implication (if-then),
• ∨ represents logical OR, and
• ¬Q represents the negation of Q.
This expression says: "If P is true, then Q OR not Q is true."
Since Q∨¬Q is a tautology (as shown above, it's always true), the entire
statement P→(Q∨¬Q) is always true, regardless of the truth value of P.
Truth Table for P→(Q∨¬Q):
P Q Q∨¬ P→(Q∨¬Q)