From 3ee35eee0f855e7d1f7128b23b9f239efc506fae Mon Sep 17 00:00:00 2001 From: Reaper-ai Date: Thu, 11 Jun 2026 12:55:48 +0530 Subject: [PATCH 1/2] initial skelleton + basic info --- app/sem4/discrete/[chapter]/page.tsx | 132 +++++ .../discrete/components/ChapterQuizInline.tsx | 47 ++ app/sem4/discrete/components/sidebar.tsx | 92 ++++ app/sem4/discrete/content/chapter0.tsx | 97 ++++ app/sem4/discrete/content/chapter1.tsx | 501 ++++++++++++++++++ app/sem4/discrete/content/chapter2.tsx | 415 +++++++++++++++ app/sem4/discrete/content/chapter3.tsx | 297 +++++++++++ app/sem4/discrete/content/chapter4.tsx | 431 +++++++++++++++ app/sem4/discrete/content/chapter5.tsx | 287 ++++++++++ app/sem4/discrete/content/chapter6.tsx | 13 + app/sem4/discrete/layout.tsx | 29 + app/sem4/discrete/page.tsx | 5 + 12 files changed, 2346 insertions(+) create mode 100644 app/sem4/discrete/[chapter]/page.tsx create mode 100644 app/sem4/discrete/components/ChapterQuizInline.tsx create mode 100644 app/sem4/discrete/components/sidebar.tsx create mode 100644 app/sem4/discrete/content/chapter0.tsx create mode 100644 app/sem4/discrete/content/chapter1.tsx create mode 100644 app/sem4/discrete/content/chapter2.tsx create mode 100644 app/sem4/discrete/content/chapter3.tsx create mode 100644 app/sem4/discrete/content/chapter4.tsx create mode 100644 app/sem4/discrete/content/chapter5.tsx create mode 100644 app/sem4/discrete/content/chapter6.tsx create mode 100644 app/sem4/discrete/layout.tsx create mode 100644 app/sem4/discrete/page.tsx diff --git a/app/sem4/discrete/[chapter]/page.tsx b/app/sem4/discrete/[chapter]/page.tsx new file mode 100644 index 0000000..ba3a142 --- /dev/null +++ b/app/sem4/discrete/[chapter]/page.tsx @@ -0,0 +1,132 @@ +import Link from "next/link"; +import { Ch0Content } from "../content/chapter0"; +import { Ch1Content } from "../content/chapter1"; +import { Ch2Content } from "../content/chapter2"; +import { Ch3Content } from "../content/chapter3"; +import { Ch4Content } from "../content/chapter4"; +import { Ch5Content } from "../content/chapter5"; +import { Ch6Content } from "../content/chapter6"; +import BookmarkButton from "../../../components/BookmarkButton"; + + +import ChapterQuizInline from "../components/ChapterQuizInline"; +import { ArrowBigLeft, ArrowBigRight } from "lucide-react"; +import { Righteous } from "next/font/google"; +import { moduleQuizzes } from "@/lib/quizData"; + +const righteous = Righteous({ + subsets: ["latin"], + weight: "400", + variable: "--font-righteous", +}); + +const chapters = [ + { id: "ch0", title: "Course Outline", component: Ch0Content }, + { id: "ch1", title: "Sets and Logic", component: Ch1Content }, + { id: "ch2", title: "Relations and Functions", component: Ch2Content }, + { id: "ch3", title: "Combinatorics and Counting", component: Ch3Content }, + { id: "ch4", title: "Graph Theory", component: Ch4Content }, + { id: "ch5", title: "Recurrence Relations", component: Ch5Content }, + { id: "ch6", title: "Boolean Algebra and Automata", component: Ch6Content }, +]; + +type ChapterProps = { + params: { chapter: string }; +}; + +export default function ChapterPage({ params }: ChapterProps) { + const currentIndex = chapters.findIndex((c) => c.id === params.chapter); + + const chapter = chapters[currentIndex]; + + if (!chapter) { + return

Chapter not found

; + } + + const ChapterComponent = chapter.component; + + const prevChapter = currentIndex > 0 ? chapters[currentIndex - 1] : null; + const nextChapter = currentIndex < chapters.length - 1 ? chapters[currentIndex + 1] : null; + + const chapterQuizSlugMap: Record = {}; + const chapterQuiz = moduleQuizzes.find((quiz) => quiz.slug === chapterQuizSlugMap[params.chapter]); + + return ( +
+
+

Discrete Mathematics

+ +
+

{chapter.title}

+ +
+ +
+ {prevChapter ? ( + + + Previous + + ) : ( +
+ )} + + {nextChapter ? ( + + Next + + + ) : ( +
+ )} +
+ +
+ + + + {chapterQuiz ? ( +
+ +
+ ) : null} +
+ +
+ {prevChapter ? ( + + + {prevChapter.title} + + ) : ( +
+ )} + + {nextChapter ? ( + + {nextChapter.title} + + + ) : ( +
+ )} +
+
+ ); +} diff --git a/app/sem4/discrete/components/ChapterQuizInline.tsx b/app/sem4/discrete/components/ChapterQuizInline.tsx new file mode 100644 index 0000000..109d4de --- /dev/null +++ b/app/sem4/discrete/components/ChapterQuizInline.tsx @@ -0,0 +1,47 @@ +"use client"; + +import { useState } from "react"; +import type { Quiz } from "@/lib/quizData"; +import QuizClient from "@/app/quiz/[slug]/QuizClient"; + +interface Props { + quiz: Quiz; +} + +export default function ChapterQuizInline({ quiz }: Props) { + const [showQuiz, setShowQuiz] = useState(false); + + if (showQuiz) { + return setShowQuiz(false)} />; + } + + return ( +
+
+

+ Ready to test your {quiz.moduleTitle} knowledge? +

+

+ {quiz.moduleTitle} +

+

+ {quiz.description} +

+
+ {Math.min(5, quiz.questions.length)} questions + · + No time limit + · + Instant feedback +
+ +
+
+ ); +} diff --git a/app/sem4/discrete/components/sidebar.tsx b/app/sem4/discrete/components/sidebar.tsx new file mode 100644 index 0000000..fda4623 --- /dev/null +++ b/app/sem4/discrete/components/sidebar.tsx @@ -0,0 +1,92 @@ +"use client"; +import { Righteous } from "next/font/google"; +import Link from "next/link"; +import { usePathname } from "next/navigation"; +import { useState, useEffect } from "react"; + +const righteous = Righteous({ + subsets: ["latin"], + weight: "400", + variable: "--font-righteous", +}); + +export default function Sidebar() { + const pathname = usePathname(); + const [open, setOpen] = useState(false); + + useEffect(() => { + if (window.innerWidth >= 768) { + setOpen(true); + } + }, []); + + const chapters = [ + { id: "ch0", title: "Course Outline" }, + { id: "ch1", title: "Sets and Logic" }, + { id: "ch2", title: "Relations and Functions" }, + { id: "ch3", title: "Counting and Combinatorics" }, + { id: "ch4", title: "Graph Theory" }, + { id: "ch5", title: "Recurrence Relations" }, + { id: "ch6", title: "Boolean Algebra" }, + ]; + + return ( + <> +
setOpen(false)} + /> + +
+ + + +
+ + ); +} diff --git a/app/sem4/discrete/content/chapter0.tsx b/app/sem4/discrete/content/chapter0.tsx new file mode 100644 index 0000000..4fba9f0 --- /dev/null +++ b/app/sem4/discrete/content/chapter0.tsx @@ -0,0 +1,97 @@ +export function Ch0Content() { + return ( +
+

+ Welcome to Discrete Mathematics — + a foundational course designed to explore mathematical structures that are fundamentally discrete rather than continuous. This course serves as the backbone for algorithm design, computer architecture, cryptography, and formal systems. +

+ +
+ +
+

+ Module I: Mathematical Logic and Proofs +

+
    +
  • Propositional Logic, connectives, truth tables, and logical equivalences
  • +
  • Predicate Logic, universal and existential quantifiers, and rules of inference
  • +
  • Proof Techniques: direct proofs, contradiction, contraposition, and mathematical induction
  • +
+
+ +
+ +
+

+ Module II: Set Theory, Relations, and Functions +

+
    +
  • Set fundamentals, operations, identities, and Venn diagrams
  • +
  • Relations, properties (reflexive, symmetric, transitive), and equivalence classes
  • +
  • Partial orderings, posets, and Hasse diagrams
  • +
  • Functions: injective, surjective, bijective, composition, and inverse functions
  • +
+
+ +
+ +
+

+ Module III: Combinatorics and Counting +

+
    +
  • Basic counting principles: sum rule and product rule
  • +
  • Inclusion-Exclusion Principle and the Pigeonhole Principle
  • +
  • Permutations and combinations with or without repetitions
  • +
  • Introduction to generating formulas and configurations
  • +
+
+ +
+ +
+

+ Module IV: Graph Theory +

+
    +
  • Graph fundamentals: vertices, edges, degree, directed vs undirected graphs
  • +
  • Paths, cycles, connectivity, and connected components
  • +
  • Trees, spanning trees, Eulerian graphs, and Hamiltonian circuits
  • +
  • Planar graphs, Euler's formula, and basic graph coloring principles
  • +
+
+ +
+ +
+

+ Module V: Recurrence Relations +

+
    +
  • Formulating recurrence relations from real-world and structural problems
  • +
  • Solving linear homogeneous recurrence relations with constant coefficients
  • +
  • Non-homogeneous recurrence relations and an overview of generating functions
  • +
+
+ +
+ +
+

+ Module VI: Boolean Algebra and Automata +

+
    +
  • Boolean functions, algebraic properties, and simplification techniques
  • +
  • Karnaugh Maps (K-maps) and logical gate minimizations
  • +
  • Formal languages, grammars, and an introduction to Finite State Automata
  • +
+
+ +
+ +

+ By the end of this course, you will possess a rigorous mathematical toolkit capable of analyzing discrete computations, modeling graph networks, minimizing hardware architectures, and formally proving engineering properties. +

+
+ ); +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter1.tsx b/app/sem4/discrete/content/chapter1.tsx new file mode 100644 index 0000000..de0f29e --- /dev/null +++ b/app/sem4/discrete/content/chapter1.tsx @@ -0,0 +1,501 @@ +export function Ch1Content() { + return ( +
+

+ Mathematical Logic provides the formal, unambiguous framework required to construct valid mathematical arguments, design digital hardware, and verify software systems. It eliminates conversational ambiguities by mapping statements to absolute truth values. +

+ +
+ + {/* Section 1: Propositional Logic */} +
+

1. Propositional Logic & Connectives

+

+ A Proposition is a declarative statement that is either strictly True (T) or False (F), but never both simultaneously, ambiguous, or dependent on subjective interpretation. +

+ +
+
+

Valid Propositions

+
    +
  • "7 is a prime number." (True)
  • +
  • "The earth is perfectly flat." (False)
  • +
  • "2 + 2 = 5." (False)
  • +
+
+
+

Invalid Statements

+
    +
  • "Bring me a glass of water." (Command/Imperative)
  • +
  • "Is the exam tomorrow?" (Question/Interrogative)
  • +
  • "x + 5 = 9." (Open statement; truth depends on x)
  • +
+
+
+ +

Core Logical Operators & Complete Truth Tables

+

+ Compound propositions are formed by modifying or joining primitive propositions using logical operators. +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperationSymbolCore Evaluative Rule
Negation¬pFlips the truth value. ¬T = F, ¬F = T.
Conjunction (AND)p ∧ qTrue **only** if both p and q are true.
Disjunction (OR)p ∨ qFalse **only** if both p and q are false. Inclusive OR.
Exclusive OR (XOR)p ⊕ qTrue if p and q have **different** truth values.
Conditional (Implication)p → qFalse **only** when a True premise leads to a False conclusion.
Biconditional (IFF)p ↔ qTrue **only** when p and q share identical truth values.
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pq¬pp ∧ qp ∨ qp ⊕ qp → qp ↔ q
TTFTTFTT
TFFFTTFF
FTTFTTTF
FFTFFFTT
+
+ +
+

⚠️ Critical Edge Cases of Conditional Operators:

+

+ 1. **Vacuous Truth:** The implication $p \rightarrow q$ is automatically **True** whenever the premise $p$ is False (Rows 3 and 4). For example: "If 2 + 2 = 5, then I am the King of France" evaluates as a completely valid, true mathematical implication. +
+ 2. **Directional Dependency:** $p \rightarrow q$ is **not** logically equivalent to $q \rightarrow p$. Order of operators matters significantly. +

+
+
+ +
+ + {/* Section 2: Conversions of Implication */} +
+

2. Conversions of an Implication

+

+ Given a base conditional statement p → q, three related variations can be derived: +

+ +
    +
  • Converse: $q \rightarrow p$. (Swapping the premise and conclusion).
  • +
  • Inverse: $\neg p \rightarrow \neg q$. (Negating both the premise and conclusion).
  • +
  • Contrapositive: $\neg q \rightarrow \neg p$. (Negating and swapping both components).
  • +
+ +
+

Equivalence Pairings:

+

1. Implication ≡ Contrapositive: (p → q) ≡ (¬q → ¬p)

+

2. Converse ≡ Inverse: (q → p) ≡ (¬p → ¬q)

+

Proof: Look at the truth table under Row 2 ($p=T, q=F$). The implication is False. Its contrapositive is $\neg q \rightarrow \neg p \equiv T \rightarrow F$, which is also False.

+
+
+ +
+ + {/* Section 3: Laws of Propositional Logic */} +
+

3. Laws and Algebraic Properties of Propositional Logic

+

+ Propositions satisfy multiple logical equivalence laws, which allow complex logical expressions to be algebraically simplified without relying on massive truth tables. +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Law NameEquivalence Relations
Identity Lawsp ∧ T ≡ p
p ∨ F ≡ p
Domination Lawsp ∨ T ≡ T
p ∧ F ≡ F
Idempotent Lawsp ∨ p ≡ p
p ∧ p ≡ p
Double Negation¬(¬p) ≡ p
Commutative Lawsp ∨ q ≡ q ∨ p
p ∧ q ≡ q ∧ p
Associative Laws(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
Distributive Lawsp ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
De Morgan's Laws¬(p ∧ q) ≡ ¬p ∨ ¬q
¬(p ∨ q) ≡ ¬p ∧ ¬q
Absorption Lawsp ∨ (p ∧ q) ≡ p
p ∧ (p ∨ q) ≡ p
Negation Lawsp ∨ ¬p ≡ T (Law of Excluded Middle)
p ∧ ¬p ≡ F (Law of Contradiction)
Conditional Equivalencep → q ≡ ¬p ∨ q
+
+
+ +
+ + {/* Section 4: Predicate Logic */} +
+

4. Predicate Logic & Quantifier Properties

+

+ Predicate Logic expands on propositional logic by dealing with variables over specified domains using assertions and quantifiers. A predicate $P(x)$ assigns a property to a variable $x$. It becomes a proposition only when $x$ is assigned a specific value or bounded by a quantifier. +

+ +

Quantifiers & Bounding Rules

+
    +
  • Universal Quantifier (∀x): The statement $∀x P(x)$ asserts that $P(x)$ is strictly True for **every single** element within the specified domain. It behaves like an infinite chain of conjunctions: $P(x_1) \wedge P(x_2) \wedge P(x_3) \dots$
  • +
  • Existential Quantifier (∃x): The statement $∃x P(x)$ asserts that there exists **at least one** element within the domain for which $P(x)$ evaluates to True. It behaves like an infinite chain of disjunctions: $P(x_1) \vee P(x_2) \vee P(x_3) \dots$
  • +
+ +

Properties and Logical Equivalences of Quantifiers

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Logical Rule / EquivalenceStructural ExpressionEdge Cases & Constraints
Quantifier De Morgan (1)¬(∀x P(x)) ≡ ∃x ¬P(x)To disprove a universal rule, you only need to find a single counterexample.
Quantifier De Morgan (2)¬(∃x P(x)) ≡ ∀x ¬P(x)Asserting something does not exist means it is false for every element in the domain.
Universal Distributivity∀x (P(x) ∧ Q(x)) ≡ ∀x P(x) ∧ ∀x Q(x)**Warning:** ∀x (P(x) ∨ Q(x)) is **NOT** equivalent to ∀x P(x) ∨ ∀x Q(x).
Existential Distributivity∃x (P(x) ∨ Q(x)) ≡ ∃x P(x) ∨ ∃x Q(x)**Warning:** ∃x (P(x) ∧ Q(x)) is **NOT** equivalent to ∃x P(x) ∧ ∃x Q(x).
+
+ +
+

💡 Critical Counter-Intuitive Edge Case (Nested Quantifiers):

+

+ ∃y ∀x P(x, y) → ∀x ∃y P(x, y) is TRUE, but its converse is FALSE. +

+

+ Let $P(x, y)$ be the statement "y loves x". +
+ - $\exists y \forall x P(x, y)$ means: "There is a specific person $y$ who loves absolutely everyone $x$." (A universal lover exists). +
+ - $\forall x \exists y P(x, y)$ means: "For every person $x$, there is someone $y$ who loves them." (Everyone has at least one lover, but it can be a different person for each $x$). +
+ Clearly, the first statement implies the second, but the second does not imply the first. **Order of nested quantifiers cannot be swapped freely.** +

+
+
+ +
+ + {/* Section 5: Rules of Inference */} +
+

5. Rules of Inference

+

+ Rules of inference are templates used to deduce a valid conclusion from a set of true assertions (premises). They form the foundation of logical reasoning and logical steps. +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Rule NameSymbolic Layout / StepNatural Description
Modus Ponensp
p → q
∴ q
If an implication is true and its premise is true, the conclusion must be true.
Modus Tollens¬q
p → q
∴ ¬p
If an implication is true and its conclusion is false, its premise must be false.
Hypothetical Syllogismp → q
q → r
∴ p → r
Implications are transitive. Chains can be merged into a single link.
Disjunctive Syllogismp ∨ q
¬p
∴ q
If an 'OR' statement is true and one component is false, the other component must be true.
+
+
+ +
+ + {/* Section 6: Proof Techniques */} +
+

6. Comprehensive Proof Techniques with Structural Examples

+

+ A formal mathematical proof demonstrates that a mathematical statement is true. Below are the core proof strategies used across computer science and discrete mathematics. +

+ + {/* 6.1 Direct Proof */} +
+

I. Direct Proof ($p \rightarrow q$)

+

+ **Strategy:** Assume the premise $p$ is strictly true, and use definition expansions and logical steps to deduce that conclusion $q$ must also be true. +

+
+

Theorem: If $n$ is an odd integer, then $n^2$ is an odd integer.

+

Proof Construction:

+
    +
  1. Assume $n$ is an odd integer by default premise.
  2. +
  3. By algebraic definition, $n = 2k + 1$ for some integer $k$.
  4. +
  5. Compute $n^2$: $n^2 = (2k + 1)^2 = 4k^2 + 4k + 1$.
  6. +
  7. Factor the expression: $n^2 = 2(2k^2 + 2k) + 1$.
  8. +
  9. Let $m = 2k^2 + 2k$. Since integers are closed under addition and multiplication, $m$ is also an integer.
  10. +
  11. Therefore, $n^2 = 2m + 1$, which satisfies the definition of an odd integer. ∴ Q.E.D.
  12. +
+
+
+ + {/* 6.2 Proof by Contraposition */} +
+

II. Proof by Contraposition

+

+ **Strategy:** Since $(p \rightarrow q) \equiv (\neg q \rightarrow \neg p)$, we can prove the implication by assuming that the conclusion $q$ is **False** ($\neg q$) and dervining that the premise $p$ must also be **False** ($\neg p$). +

+
+

Theorem: If $3n + 2$ is an odd integer, then $n$ is an odd integer.

+

Proof Construction:

+
    +
  1. Assume the contrapositive hypothesis: The conclusion is false, meaning $n$ is an **even** integer.
  2. +
  3. By definition of an even integer, $n = 2k$ for some integer $k$.
  4. +
  5. Substitute $n$ into the expression: $3n + 2 = 3(2k) + 2 = 6k + 2$.
  6. +
  7. Factor out a 2: $3n + 2 = 2(3k + 1)$.
  8. +
  9. Let $m = 3k + 1$, which is an integer. Thus, $3n + 2 = 2m$.
  10. +
  11. This shows that $3n + 2$ is an even integer, which means the premise is false.
  12. +
  13. Since we showed $\neg q \rightarrow \neg p$, the original theorem $p \rightarrow q$ is proven. ∴ Q.E.D.
  14. +
+
+
+ + {/* 6.3 Proof by Contradiction */} +
+

III. Proof by Contradiction

+

+ **Strategy:** Assume that the target theorem statement is completely **False**. Use this assumption to reason through steps until you arrive at a logical impossibility or an absolute contradiction ($r \wedge \neg r$). This proves that your initial assumption was incorrect, meaning the theorem must be true. +

+
+

Theorem: $\sqrt{2}$ is an irrational number.

+

Proof Construction:

+
    +
  1. Assume the contradiction setup: $\sqrt{2}$ is **not** irrational, meaning it is a **rational** number.
  2. +
  3. By definition of rational numbers, $\sqrt{2} = a / b$ where $a, b$ are integers, $b \neq 0$, and the fraction is written in **irreducible terms** (meaning $\text{gcd}(a, b) = 1$; they share no common factors).
  4. +
  5. Square both sides: $2 = a^2 / b^2 \implies a^2 = 2b^2$.
  6. +
  7. Since $a^2$ is a multiple of 2, $a^2$ must be an even integer. This implies that $a$ itself must be an even integer (as the square of an odd integer is always odd).
  8. +
  9. Since $a$ is even, we can write $a = 2k$ for some integer $k$.
  10. +
  11. Substitute $a$ back into the equation: $(2k)^2 = 2b^2 \implies 4k^2 = 2b^2 \implies b^2 = 2k^2$.
  12. +
  13. This implies that $b^2$ is an even integer, which means $b$ itself must also be an even integer.
  14. +
  15. If both $a$ and $b$ are even, they both share a common factor of 2. This directly contradicts our initial definition rule that $\text{gcd}(a,b) = 1$.
  16. +
  17. Because this assumption leads to a clear contradiction, our initial assumption ($\sqrt{2}$ is rational) must be false. Therefore, $\sqrt{2}$ is irrational. ∴ Q.E.D.
  18. +
+
+
+ + {/* 6.4 Mathematical Induction */} +
+

IV. Mathematical Induction

+

+ **Strategy:** To prove a predicate proposition $P(n)$ is true for all positive integers $n \ge 1$: +
+ 1. **Base Case:** Prove the statement holds true for the smallest valid boundary element, typically $P(1)$. +
+ 2. **Inductive Hypothesis:** Assume that the property holds true for an arbitrary step state $n = k$, meaning $P(k)$ is true. +
+ 3. **Inductive Step:** Use this assumption to prove that the property must then hold true for the next step state $n = k + 1$, showing $P(k) \rightarrow P(k+1)$. +

+
+

Theorem: Prove that the sum of the first $n$ positive integers is given by: $1 + 2 + 3 + \dots + n = \frac{n(n + 1)}{2}$.

+

Proof Construction:

+
    +
  • + 1. Base Case (n = 1): +
    + Left-Hand Side (LHS) = $1$. +
    + Right-Hand Side (RHS) = $\frac{1(1 + 1)}{2} = \frac{2}{2} = 1$. +
    + Since LHS = RHS, $P(1)$ is true. +
  • +
  • + 2. Inductive Hypothesis: +
    + Assume that $P(k)$ is true for some arbitrary positive integer $k$. That is: +
    + $1 + 2 + 3 + \dots + k = \frac{k(k + 1)}{2}$. +
  • +
  • + 3. Inductive Step (Prove n = k + 1): +
    + We need to show that: $1 + 2 + 3 + \dots + k + (k + 1) = \frac{(k + 1)((k + 1) + 1)}{2} = \frac{(k + 1)(k + 2)}{2}$. +
    + Group the first $k$ terms on the left side: +
    + $\underline{(1 + 2 + 3 + \dots + k)} + (k + 1)$. +
    + Substitute the inductive hypothesis into the underlined part: +
    + $= \frac{k(k + 1)}{2} + (k + 1)$. +
    + Find a common denominator to add the terms: +
    + $= \frac{k(k + 1) + 2(k + 1)}{2}$. +
    + Factor out the common term $(k + 1)$ from the numerator: +
    + $= \frac{(k + 1)(k + 2)}{2}$. +
    + This matches the expected right-hand side expression for $P(k+1)$. +
    + Since both the base case and inductive step hold, the theorem is proven for all $n \in \mathbb{Z}^+$. ∴ Q.E.D. +
  • +
+
+
+
+ +
+ + {/* Summary */} +
+

Summary

+

+ In this chapter, we explored the foundations of mathematical logic and proof design. We covered truth tables for propositional connectives, logical equivalences, predicate quantifiers, rules of inference, and formal proof strategies like direct proofs, contraposition, contradiction, and induction. These concepts are essential for formal reasoning in computer science and mathematics. +

+
+
+ ); +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter2.tsx b/app/sem4/discrete/content/chapter2.tsx new file mode 100644 index 0000000..b6308c8 --- /dev/null +++ b/app/sem4/discrete/content/chapter2.tsx @@ -0,0 +1,415 @@ +export function Ch2Content() { + return ( +
+

+ Sets, Relations, and Functions form the fundamental foundational language for all of discrete mathematics and computer science. This chapter establishes the core structural groupings used to collect elements, map objects, organize hierarchies, and model deterministic operations within computational environments. +

+ +
+ + {/* Section 1: Set Theory */} +
+

1. Set Theory, Operations, and Identities

+

+ A Set is an unordered collection of distinct, well-defined objects. The objects belonging to a set are called its elements. +

+ +

Subsets and Power Sets

+
    +
  • Subset ($A \subseteq B$): Set $A$ is a subset of set $B$ if and only if every element that belongs to $A$ also belongs to $B$. Formally: $\forall x (x \in A \rightarrow x \in B)$.
  • +
  • Proper Subset ($A \subset B$): Set $A$ is a proper subset of $B$ if $A \subseteq B$ and $A \neq B$. This implies $B$ contains at least one element not present in $A$.
  • +
  • Power Set ($\mathcal{P}(A)$): The power set of a set $A$ is the collection of all possible subsets of $A$, including the empty set ($\emptyset$) and the set $A$ itself.
  • +
+ +
+

💡 Power Set Cardinality Theorem:

+

If a finite set $A$ has $|A| = n$ elements, then its power set contains $|\mathcal{P}(A)| = 2^n$ elements.

+

Example:

+

Let $A = \{1, 2\}$. Then $\mathcal{P}(A) = \{\emptyset, \{1\}, \{2\}, \{1, 2\}\}$. Here, $|A| = 2$ and $|\mathcal{P}(A)| = 2^2 = 4$.

+
+ +

Set Operators and Mathematical Definitions

+

+ Let $U$ represent the universal set containing all possible elements under discussion. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperationNotationFormal Set-Builder Definition
UnionA ∪ B{"{ x | x ∈ A ∨ x ∈ B }"}
IntersectionA ∩ B{"{ x | x ∈ A ∧ x ∈ B }"}
DifferenceA − B{"{ x | x ∈ A ∧ x ∉ B }"}
ComplementA' (or Ā){"{ x | x ∈ U ∧ x ∉ A }"}
Symmetric DifferenceA Δ B{"{ x | x ∈ (A − B) ∨ x ∈ (B − A) }"}
+
+ +

Algebraic Properties and Identities of Sets

+

+ Set operations satisfy algebraic laws that parallel propositional logic equivalences. +

+
    +
  • Commutative Laws: $A \cup B = B \cup A$ and $A \cap B = B \cap A$.
  • +
  • Associative Laws: $(A \cup B) \cup C = A \cup (B \cup C)$ and $(A \cap B) \cap C = A \cap (B \cap C)$.
  • +
  • Distributive Laws: $A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$ and $A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$.
  • +
  • De Morgan's Laws for Sets: $(A \cup B)' = A' \cap B'$ and $(A \cap B)' = A' \cup B'$.
  • +
  • Absorption Laws: $A \cup (A \cap B) = A$ and $A \cap (A \cup B) = A$.
  • +
+ +

Inclusion-Exclusion Principle Formulas

+

+ The Principle of Inclusion-Exclusion (PIE) computes the total cardinality of a union of multiple intersecting sets by alternately adding individual sizes and subtracting shared elements to prevent double-counting. +

+
+
+

1. Two-Set Formula:

+

|A ∪ B| = |A| + |B| − |A ∩ B|

+
+
+

2. Three-Set Formula:

+

|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|

+
+
+ +
+

⚠️ Critical Edge Case (Disjoint Sets):

+

+ If sets $A$ and $B$ are **mutually exclusive / disjoint**, their intersection is empty: $A \cap B = \emptyset \implies |A \cap B| = 0$. In this scenario, the Inclusion-Exclusion formula simplifies directly into the Sum Rule: $|A \cup B| = |A| + |B|$. +

+
+
+ +
+ + {/* Section 2: Relations */} +
+

2. Binary Relations & Properties

+

+ Given two sets $A$ and $B$, the Cartesian Product $A \times B$ is the set of all ordered pairs $(a, b)$ such that $a \in A$ and $b \in B$. A **Binary Relation** $R$ from $A$ to $B$ is structurally a subset of this product: $R \subseteq A \times B$. If $(a, b) \in R$, we write $aRb$. +

+ +

Classifications and Structural Types of Relations on a Set A

+

+ A relation $R$ defined on a single set ($R \subseteq A \times A$) can possess specific properties across its coordinate matrix. +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PropertyFormal Logical Constraint RuleConcrete Example or Counter-Example
Reflexive∀a ∈ A, (a, a) ∈ RThe relation "$\le$" on integers, since every number $a \le a$.
Irreflexive∀a ∈ A, (a, a) ∉ RThe relation "$<$" on integers, since a number can never be strictly less than itself.
Symmetric∀a, b ∈ A, (a, b) ∈ R → (b, a) ∈ R"Is a sibling of" relation across a human demographic set.
Asymmetric∀a, b ∈ A, (a, b) ∈ R → (b, a) ∉ RThe relation "$<$". If $x < y$, it is impossible for $y < x$. Implies irreflexivity.
Anti-Symmetric∀a, b ∈ A, ((a, b) ∈ R ∧ (b, a) ∈ R) → a = bThe subset relation "$\subseteq$". If $A \subseteq B$ and $B \subseteq A$, then $A = B$.
Transitive∀a, b, c ∈ A, ((a, b) ∈ R ∧ (b, c) ∈ R) → (a, c) ∈ R"Divides" relation on integers. If $x|y$ and $y|z$, then $x|z$.
+
+ +
+

💡 Critical Matrix Edge Case (Asymmetric vs Anti-Symmetric):

+

+ Students often confuse Asymmetric and Anti-Symmetric properties. +
+ - **Asymmetry** strictly prohibits any bidirectional pairings, meaning diagonal entries like $(a, a)$ can never belong to the relation. +
+ - **Anti-symmetry** permits diagonal elements $(a, a)$ to exist seamlessly, but guarantees that if an off-diagonal forward link $(a, b)$ exists, its reverse link $(b, a)$ is completely blocked. +

+
+ +

Equivalence Relations, Classes, and Partitions

+

+ An Equivalence Relation is a relation on a set $A$ that satisfies three properties simultaneously: **Reflexive, Symmetric, and Transitive**. +

+
    +
  • Equivalence Class ($[a]$): Given an equivalence relation $R$ on a set $A$, the equivalence class of an element $a \in A$ is the set of all elements linked to $a$ via $R$. Formally: $[a] = \{ x \in A \mid aRx \}$.
  • +
  • Partition: A partition of a set $A$ is a grouping of $A$ into non-empty, mutually disjoint subsets (called blocks) such that their collective union reconstructs the entire set $A$.
  • +
+ +
+

The Fundamental Partition Theorem:

+

+ Every equivalence relation on a set $A$ partitions $A$ into distinct, mutually disjoint equivalence classes. Conversely, any partition of a set $A$ naturally induces an equivalence relation on that set. +

+
+

Example: Modular Arithmetic (Congruence modulo 3 on integers)

+

Relation: a ≡ b (mod 3) ↔ 3 divides (a − b)

+

This partitions the infinite set of integers ($\mathbb{Z}$) into exactly three disjoint equivalence classes:

+

+ [0] = {'{ ..., -6, -3, 0, 3, 6, ... }'} (Remainder 0)
+ [1] = {'{ ..., -5, -2, 1, 4, 7, ... }'} (Remainder 1)
+ [2] = {'{ ..., -4, -1, 2, 5, 8, ... }'} (Remainder 2) +

+
+
+
+ +
+ + {/* Section 3: Posets and Hasse Diagrams */} +
+

3. Orderings, Posets, and Hasse Diagrams

+

+ Relations can establish hierarchical ordering guidelines across a set, allowing elements to be compared based on prioritization or containment. +

+ +

Partial Orders vs Total Orders

+
    +
  • Partial Order (Poset): A relation $R$ on a set $A$ is a partial ordering if it is **Reflexive, Anti-symmetric, and Transitive**. The set $A$ paired with this relation is called a Partially Ordered Set, denoted as $(A, \le)$. Elements $x, y$ are comparable if $x \le y$ or $y \le x$, otherwise they are incomparable.
  • +
  • Total Order (Linear Order): A partial order $(A, \le)$ is a total order if **every single pair** of elements in the set is comparable. Formally: $\forall a, b \in A (a \le b \vee b \le a)$. There are no incomparable components.
  • +
+ +

Hasse Diagram Construction Rules

+

+ A Hasse diagram is a simplified visual representation of a finite partial order. It is drawn using the following optimization constraints: +

+
    +
  1. If $a \le b$, vertex $b$ is placed physically higher on the plane page view than vertex $a$.
  2. +
  3. A directional line is drawn between $a$ and $b$ if and only if $a$ is immediately covered by $b$ (meaning $a \le b$ and there is no intermediate element $c$ such that $a \le c \le b$).
  4. +
  5. All reflexive self-loops $(a, a)$ are omitted since reflexivity is implied for every element.
  6. +
  7. All transitive directional lines are omitted since transitivity can be inferred by tracing connected paths upward.
  8. +
+ + {/* Integrated Hasse Diagram Visual Figure */} +
+
+

+ Visual Figures: Poset Structural Diagrams +

+
+
+
1. Partial Order Hasse Diagram
(Divisibility on set {"{1, 2, 3, 6}"})
+
+
[6]
+
+ / + \ +
+
+ [2] + [3] +
+
+ \ + / +
+
[1]
+
+

Note: 2 and 3 are incomparable entries.

+
+ +
+
+
2. Total Order Chain Diagram
(Standard "less than or equal to" on {"{1, 2, 3}"})
+
+
[3]
+
|
+
[2]
+
|
+
[1]
+
+
+

Note: Complete connectivity; linear chain structural layout.

+
+
+
+
+
+ +
+ + {/* Section 4: Functions */} +
+

4. Functions, Structural Types, and Inverses

+

+ A Function $f$ from set $A$ to set $B$ (denoted $f: A \rightarrow B$) is a special type of relation that maps each element $a$ in the domain set $A$ to **exactly one** element $b$ in the codomain set $B$. We write $f(a) = b$. +

+ +

Classifications and Structural Types of Functions

+

+ Functions are classified based on how elements of the domain map to the codomain. +

+ + {/* Integrated Functional Mapping Diagrams */} +
+
+

+ Visual Mapping Diagrams: Classification Profiles +

+
+ + {/* Injection */} +
+
I. Injection (One-to-One)
+
+
+

a1

+

a2

+
+
+

+

+
+
+

b1

+

b2

+

b3

+
+
+

Constraint Rule: Distinct domain elements must map to completely distinct codomain targets.

+
+ + {/* Surjection */} +
+
II. Surjection (Onto)
+
+
+

a1

+

a2

+

a3

+
+
+

+

+

+
+
+

b1

+

b2

+
+
+

Constraint Rule: Every element in the codomain must be mapped to. There are no leftover codomain items.

+
+ + {/* Bijection */} +
+
III. Bijection (1-to-1 & Onto)
+
+
+

a1

+

a2

+
+
+

+

+
+
+

b1

+

b2

+
+
+

Constraint Rule: Perfect matching. Every element matches precisely one-to-one with no leftovers anywhere.

+
+ +
+
+
+ +
    +
  • Injection (One-to-One): $f$ is injective if distinct inputs always map to distinct outputs. Formally: $\forall x, y \in A (f(x) = f(y) \rightarrow x = y)$.
  • +
  • Surjection (Onto): $f$ is surjective if the range equals the codomain. Every element in $B$ has at least one preimage in $A$. Formally: $\forall b \in B, \exists a \in A \text{ such that } f(a) = b$.
  • +
  • Bijection: A function that is simultaneously injective and surjective. It represents a perfect matching layout between sets.
  • +
+ +

Composition of Functions & Algebraic Properties

+

+ Given functions $f: A \rightarrow B$ and $g: B \rightarrow C$, the **Composition Function** $(g \circ f): A \rightarrow C$ is defined as: +
+ (g \circ f)(a) = g(f(a)) +

+

Properties of Function Composition:

+
    +
  • Associativity: If $f: A \rightarrow B$, $g: B \rightarrow C$, and $h: C \rightarrow D$, composition is associative: $h \circ (g \circ f) = (h \circ g) \circ f$.
  • +
  • Non-Commutativity: Function composition is generally **not** commutative: $g \circ f \neq f \circ g$. Order of evaluation matters.
  • +
  • Preservation: If both $f$ and $g$ are injections, then $(g \circ f)$ is an injection. If both $f$ and $g$ are surjections, then $(g \circ f)$ is a surjection.
  • +
+ +

Inverse of a Function

+

+ If $f: A \rightarrow B$ is a bijection, its **Inverse Function** $f^{-1}: B \rightarrow A$ maps each element in $B$ back to its unique preimage in $A$. Formally: +
+ f^{-1}(b) = a \iff f(a) = b +

+ +
+

⚠️ Critical Existence Constraint Rule:

+

+ The inverse function $f^{-1}$ **only exists** if the original function $f$ is a strict **Bijection**. +
+ - If $f$ is not injective, multiple elements in $A$ map to the same $b$, making $f^{-1}(b)$ ambiguous (violating function definition rules). +
+ - If $f$ is not surjective, some elements in $B$ are unmapped, meaning $f^{-1}(b)$ would be undefined for those elements. +

+
+
+ +
+ + {/* Summary */} +
+

Summary

+

+ In this chapter, we explored set operators, subsets, power sets, and the Inclusion-Exclusion principle. We categorized relationships into reflexive, symmetric, transitive, equivalence, and partial order types, and analyzed how to visualize posets using Hasse diagrams. Finally, we studied functional properties, analyzing injective, surjective, and bijective mappings, along with function composition rules and inverse constraints. +

+
+
+ ); +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter3.tsx b/app/sem4/discrete/content/chapter3.tsx new file mode 100644 index 0000000..4b06714 --- /dev/null +++ b/app/sem4/discrete/content/chapter3.tsx @@ -0,0 +1,297 @@ +export function Ch3Content() { + return ( +
+

+ This chapter covers three core fields of discrete mathematics: Combinatorics (the science of counting and configurations), Number Theory (the study of integers, divisibility, and modular equations), and Recurrence Relations (the mathematical framework used to evaluate recursive functions and algorithmic complexity bounds). +

+ +
+ + {/* SECTION 1: COMBINATORICS & PROBABILITY */} +
+

1. Advanced Combinatorics & Basic Probability

+

+ Combinatorics provides the structural tools needed to calculate configuration bounds without explicitly enumerating every possible outcome. +

+ +

Fundamental Counting Rules

+
    +
  • The Sum Rule: If a task can be performed in $m$ ways, and a second independent task can be performed in $n$ ways, then performing **either** the first task **or** the second task can be accomplished in $m + n$ ways.
  • +
  • The Product Rule: If a procedure can be broken down into two successive stages where stage one has $m$ outcomes and stage two has $n$ outcomes, the complete sequence of tasks can be done in $m \times n$ ways.
  • +
+ +

Basic Probability & Inclusion-Exclusion for Probability

+

+ The **Probability** of an event $E$ within a finite, equally likely sample space $S$ is defined as $P(E) = |E| / |S|$. + When dealing with compound events that are not mutually exclusive, the **Principle of Inclusion-Exclusion for Probability** ensures shared outcomes are not double-counted: +

+
+ P(A ∪ B) = P(A) + P(B) − P(A ∩ B) +
+ + For three events: P(A ∪ B ∪ C) = P(A) + P(B) + P(C) − P(A ∩ B) − P(A ∩ C) − P(B ∩ C) + P(A ∩ B ∩ C) + +
+ +

The Pigeonhole Principle & Applications

+
    +
  • Basic Principle: If $k + 1$ or more pigeons are placed into $k$ holes, then at least one hole must contain two or more pigeons.
  • +
  • Generalized Pigeonhole Principle: If $N$ objects are placed into $k$ boxes, then at least one box must contain at least $\lceil N / k \rceil$ objects (where $\lceil \dots \rceil$ denotes the ceiling function).
  • +
+
+

Concrete Application Examples & Edge Cases:

+

+ 1. **Card Deck Edge Case:** How many cards must be drawn from a standard 52-card deck to guarantee that at least three cards of the same suit are chosen? +
+ + Holes (k) = 4 suits. We want ⌈N / 4⌉ = 3. The worst-case scenario before achieving this is drawing 2 cards of each suit (2 × 4 = 8 cards). The next drawn card (the 9th card) guarantees a triplet. Thus, N = 9. + +

+

+ 2. **Birthday Match:** In any group of 367 people, at least two individuals must share a birthday, because there are at most 366 possible birthdays (including leap years). +

+
+
+ +
+ + {/* SECTION 2: NUMBER THEORY */} +
+

2. Number Theory & Linear Diophantine Equations

+

+ Number theory forms the mathematical core of modern cryptography and data hashing systems. +

+ +

GCD, LCM, and Their Fundamental Relationship

+

+ The Greatest Common Divisor ($\text{gcd}(a, b)$) is the largest positive integer that divides both $a$ and $b$. The Least Common Multiple ($\text{lcm}(a, b)$) is the smallest positive integer that is a multiple of both $a$ and $b$. Their core relationship is defined by the following theorem: +

+
+ gcd(a, b) × lcm(a, b) = |a × b| +
+ +

Bézout's Identity & The Extended Euclidean Algorithm

+

+ Bézout's Identity: For any non-zero integers $a$ and $b$, there exist integers $x$ and $y$ such that: +
+ ax + by = gcd(a, b) + The coefficients $x$ and $y$ are computed efficiently using the **Extended Euclidean Algorithm**, which tracks the quotient steps of divisibility in reverse. +

+ +
+

Step-by-Step Example: Compute gcd(252, 198) and express it as ax + by

+
+

Step 1: Forward Euclidean Algorithm (Find GCD)

+

252 = 1 × 198 + 54 (Remainder = 54)

+

198 = 3 × 54 + 36 (Remainder = 36)

+

54 = 1 × 36 + 18 (Remainder = 18) ← Last non-zero remainder is the GCD

+

36 = 2 × 18 + 0 (Remainder = 0)

+

Thus, gcd(252, 198) = 18.

+ +

Step 2: Back-Substitution (Find Bézout Coefficients x and y)

+

From the last non-zero equation: 18 = 54 − 1 × 36

+

Substitute 36 from the equation above it (36 = 198 − 3 × 54):

+

18 = 54 − 1 × (198 − 3 × 54) = 4 × 54 − 1 × 198

+

Substitute 54 from the first equation (54 = 252 − 1 × 198):

+

18 = 4 × (252 − 1 × 198) − 1 × 198

+

18 = 4 × (252) − 5 × (198)

+

Therefore, the Bézout coefficients are x = 4 and y = -5.

+
+
+ +

Linear Diophantine Equations

+

+ A **Linear Diophantine Equation** is an equation of the form $ax + by = c$, where $a, b, c$ are given integers, and we solve only for integer values of $x$ and $y$. +

+
+
⚠️ Solvability Existence Theorem & General Solution:
+

+ The Diophantine equation $ax + by = c$ has an integer solution if and only if **$\text{gcd}(a, b)$ divides $c$** ($gcd(a,b) \mid c$). If this condition is met and an initial particular solution $(x_0, y_0)$ is found, the infinite set of all solutions is given by: +

+

+ x = x_0 + t × (b / d),      y = y_0 − t × (a / d) +

+

Where $d = \text{gcd}(a, b)$ and $t$ is any arbitrary integer ($t \in \mathbb{Z}$).

+
+ +

The Chinese Remainder Theorem (CRT)

+

+ Let $m_1, m_2, \dots, m_n$ be pairwise coprime positive integers ($\text{gcd}(m_i, m_j) = 1$ for $i \neq j$). Then, the following system of simultaneous modular congruence relations has a unique solution modulo $M = m_1 \times m_2 \times \dots \times m_n$: +

+
+ x ≡ a_1 (mod m_1),    x ≡ a_2 (mod m_2),    \dots,    x ≡ a_n (mod m_n) +
+
+ +
+ + {/* SECTION 3: RECURRENCE RELATIONS */} +
+

3. Recurrence Relations & Resolution Methods

+

+ A Recurrence Relation defines a mathematical sequence where individual terms $a_n$ are expressed as a function of one or more of their preceding terms. +

+ +

Structural Classifications

+
    +
  • Linear Homogeneous: Terms depend linearly on past elements with no trailing isolated constants or functions of $n$. Example: $a_n = c_1a_{n-1} + c_2a_{n-2}$.
  • +
  • Linear Non-Homogeneous: Contains an added trailing function component $F(n)$ not tied to sequence terms. Example: $a_n = c_1a_{n-1} + F(n)$.
  • +
+ + {/* METHOD 1 */} +

Method I: Repeated Substitution (Iterative Method)

+

+ This strategy involves repeatedly expanding the recursive term until a clear algebraic pattern emerges as a function of $n$ and the base cases. +

+
+

Example: Solve $a_n = a_{n-1} + 3$ with base case $a_0 = 2$.

+
+

a_n = a_{n-1} + 3

+

Substitute $a_{n-1} = a_{n-2} + 3$ into the equation:

+

a_n = (a_{n-2} + 3) + 3 = a_{n-2} + 2(3)

+

Substitute $a_{n-2} = a_{n-3} + 3$ into the equation:

+

a_n = (a_{n-3} + 3) + 2(3) = a_{n-3} + 3(3)

+

Following this pattern down to the $n$-th iteration step:

+

a_n = a_{n-n} + n(3) = a_0 + 3n

+

Substitute the base case value $a_0 = 2$:

+

a_n = 2 + 3n

+
+
+ + {/* METHOD 2 */} +

Method II: The Characteristic Root Method

+

+ Used to solve linear homogeneous relations by converting them into equivalent polynomial equations. +

+ +
1. Second-Order Homogeneous Relations
+

+ For the relation $a_n + c_1a_{n-1} + c_2a_{n-2} = 0$, construct the **Characteristic Equation**: $r^2 + c_1r + c_2 = 0$. +

+
+ + + + + + + + + + + + + + + + + +
Root ConditionExplicit Solution Formula Structure ($a_n$)
Distinct Real Roots ($r_1 \neq r_2$)a_n = α_1(r_1)^n + α_2(r_2)^n
Repeated Real Roots ($r_1 = r_2 = r$)a_n = (α_1 + α_2 n)(r)^n
+
+ +
+

Concrete Example (Distinct Roots): Solve $a_n = 5a_{n-1} − 6a_{n-2}$ given $a_0 = 1, a_1 = 5$.

+
+

1. Rewrite equation: a_n − 5a_{n-1} + 6a_{n-2} = 0

+

2. Form characteristic polynomial: r² − 5r + 6 = 0

+

3. Factor equation: (r − 2)(r − 3) = 0 → Roots are r₁ = 2, r₂ = 3

+

4. State general structure: a_n = α_1(2)^n + α_2(3)^n

+

5. Substitute base cases to solve for coefficients:

+

   For n = 0: α_1 + α_2 = 1

+

   For n = 1: 2α_1 + 3α_2 = 5

+

6. Solving this system gives α_1 = -2 and α_2 = 3.

+

Final Solution: a_n = −2(2)^n + 3(3)^n = −2^{n+1} + 3^{n+1}

+
+
+ +
2. Higher-Order Homogeneous Relations
+

+ If the characteristic equation has a root $r$ repeated $m$ times, the terms corresponding to this root in the general solution have the form: +
+ (\alpha_0 + \alpha_1 n + \alpha_2 n^2 + \dots + \alpha_{m-1} n^{m-1})r^n +

+ +
3. Non-Homogeneous Relations with Constant Coefficients
+

+ The complete general solution to $a_n + c_1a_{n-1} + c_2a_{n-2} = F(n)$ is a combination of two parts: +
+ a_n = a_n^{(h)} + a_n^{(p)} + Where $a_n^{(h)}$ is the homogeneous solution matching $F(n)=0$, and $a_n^{(p)}$ is the **particular solution** chosen to match the functional format of $F(n)$. +

+
+ + + + + + + + + + + + + + + + + + + + + +
Trailing Function Form $F(n)$Assumed Particular Solution Form $a_n^{(p)}$
Linear Polynomial (c . n + d)A . n + B
Exponential (c . s^n)A . s^n    (if s is not a homogeneous root)
⚠️ Critical Clash CaseA . n^m . s^n    (if s is a homogeneous root of multiplicity m)
+
+ + {/* METHOD 3 */} +

Method III: Generating Functions

+

+ A **Generating Function** $G(x)$ translates an infinite discrete sequence $(a_0, a_1, a_2, \dots)$ into the formal coefficients of a continuous power series expansion: +
+ G(x) = \sum_{n=0}^{\infty} a_n x^n = a_0 + a_1 x + a_2 x^2 + a_3 x^3 + \dots +

+ +
The Extended Binomial Theorem
+

+ To extract sequence terms from algebraic fractional generating functions, use the **Extended Binomial Theorem** for negative integer powers: +

+
+ (1 − x)^{-n} = \sum_{r=0}^{\infty} \binom{n + r − 1}{r} x^r +
+ + Expanding explicitly: (1 − x)^{-1} = 1 + x + x^2 + x^3 + \dots    and    (1 − x)^{-2} = 1 + 2x + 3x^2 + 4x^3 + \dots + +
+ +
+

Step-by-Step Example: Solve $a_n = 2a_{n-1}$ with $a_0 = 3$ using Generating Functions.

+
+

1. Multiply the relation by x^n and sum over all n ≥ 1:

+

   \sum_{n=1}^{\infty} a_n x^n = \sum_{n=1}^{\infty} 2a_{n-1} x^n

+

2. Express the terms in relation to the generating function G(x) = \sum_{n=0}^{\infty} a_n x^n:

+

   Left side: G(x) − a_0

+

   Right side: 2x \sum_{n=1}^{\infty} a_{n-1} x^{n-1} = 2x G(x)

+

3. Substitute these components back into the equation:

+

   G(x) − a_0 = 2x G(x)

+

4. Substitute the base case a_0 = 3 and isolate G(x):

+

   G(x) − 3 = 2x G(x) → G(x)(1 − 2x) = 3 → G(x) = \frac{3}{1 − 2x}

+

5. Apply the geometric series expansion structure (\frac{1}{1-u} = \sum u^n):

+

   G(x) = 3 \sum_{n=0}^{\infty} (2x)^n = \sum_{n=0}^{\infty} [3 \cdot 2^n] x^n

+

6. Extract the coefficient of x^n to find the closed-form equation:

+

Final Solution: a_n = 3 \cdot 2^n

+
+
+
+ +
+ + {/* SUMMARY */} +
+

Summary

+

+ In this chapter, we studied combinatorics, number theory, and recurrence relations. We analyzed basic counting, probability rules, and the Pigeonhole Principle. Next, we explored integer divisibility using Bézout's identity, the Extended Euclidean Algorithm, and Diophantine systems. Finally, we solved linear homogeneous and non-homogeneous recurrence relations using repeated substitution, characteristic roots, and generating functions combined with the Extended Binomial Theorem. +

+
+
+ ); +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter4.tsx b/app/sem4/discrete/content/chapter4.tsx new file mode 100644 index 0000000..80d8ae5 --- /dev/null +++ b/app/sem4/discrete/content/chapter4.tsx @@ -0,0 +1,431 @@ +import React from "react"; + +export function Ch4Content() { + return ( +
+ {/* Introduction */} +

+ Graph Theory is the study of discrete mathematical structures consisting of objects and the pairwise relationships between them. Graphs serve as an abstract framework for modeling and analyzing complex networks, including data communication routes, social networks, neural connection structures, and computational dependencies. +

+ +
+ + {/* 1. Basics and Structural Parameters */} +
+

+ 1. Graph Fundamentals & Structural Parameters +

+

+ Formally, a simple graph is defined as an ordered pair $G = (V, E)$, where $V$ represents a non-empty set of **vertices** (or nodes) and $E$ represents a set of **edges** (or links) that connect unordered pairs of distinct vertices. +

+ +
    +
  • + Order of a Graph, $|V|$: The absolute number of vertices present in the graph. +
  • +
  • + Size of a Graph, $|E|$: The absolute number of edges present in the graph. +
  • +
  • + Degree of a Vertex, $\text{deg}(v)$: The number of edges incident to the vertex $v$. For loops, each loop contributes exactly 2 to the vertex's total degree. +
  • +
  • + Isolated Vertex: A vertex with a degree equal to 0 ($\text{deg}(v) = 0$). +
  • +
  • + Pendant Vertex: A vertex with a degree equal to 1 ($\text{deg}(v) = 1$). +
  • +
+ +
+
+ The Handshaking Lemma (Fundamental Theorem of Graph Theory) +
+

+ For any undirected graph, the sum of the degrees of all its vertices is exactly twice the total number of its edges: +

+
+ \sum_{v \in V} \text{deg}(v) = 2|E| +
+

+ ⚠️ Critical Corollary: Every undirected graph must contain an even number of vertices that have an odd degree. This constraint makes it impossible to design a graph where, for example, exactly 7 vertices each have a degree of 3. +

+
+
+ +
+ + {/* 2. Graph Connectivity Definitions */} +
+

+ 2. Graph Connectivity: Walks, Trails, Paths, and Cycles +

+

+ Tracing structural traversal routes through a graph requires distinct mathematical classifications based on element repetition restrictions: +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TermCore Definitional ConditionRepetition Constraints
WalkAn alternating sequence of vertices and edges.Both vertices and edges can be repeated infinitely.
TrailA walk with no repeated edges.Edges must be unique. Vertices can be repeated.
PathA walk with no repeated vertices.Vertices must be strictly unique (which guarantees edges are unique).
CircuitA closed trail that starts and ends at the same vertex.No edges can be repeated. Vertices can be repeated.
CycleA closed path where the start and end vertices are identical.No vertices or edges can be repeated, except the terminal matching pair.
+
+
+ +
+ + {/* 3. Types of Graphs */} +
+

+ 3. Classifications and Structural Varieties of Graphs +

+ +
+
+

Undirected vs. Directed Graphs (Digraphs)

+

+ In an undirected graph, edges are symmetric unordered pairs $\{u, v\}$. In a digraph, edges are ordered pairs $(u, v)$, establishing a one-way directional vector from a source vertex $u$ to a target vertex $v$. Digraph vertices track split degree configurations: In-degree ($\text{deg}^-(v)$, incoming paths) and Out-degree ($\text{deg}^+(v)$, outgoing paths). +

+
+ +
+

Complete Graphs ($K_n$)

+

+ A simple graph where an edge connects every pair of distinct vertices. A complete graph with $n$ vertices is denoted as $K_n$ and contains exactly $n(n-1)/2$ edges. Every vertex in $K_n$ has a uniform, regular degree equal to $n-1$. +

+
+ +
+

Weighted Graphs

+

+ A graph layout where each edge $e$ is assigned a real number value $w(e)$, representing a specific cost, distance, capacity, or latency metric. These configurations are used in shortest-path computations. +

+
+ +
+

Bipartite Graphs ($K_{m,n}$)

+

+ A graph whose vertex set $V$ can be partitioned into two disjoint subsets $V_1$ and $V_2$ such that every edge connects a vertex in $V_1$ to a vertex in $V_2$. No edges can connect vertices within the same subset. A complete bipartite graph is denoted as $K_{m,n}$. +

+
+
+
+ +
+ + {/* 4. Graph Representations */} +
+

+ 4. Algebraic and Computational Graph Representations +

+

+ To process graph layouts computationally, topologies are converted into equivalent algebraic matrices or structural lists. Let $G=(V,E)$ be a graph with vertices labeled $v_1, v_2, \dots, v_n$: +

+ +
    +
  • + Adjacency Matrix ($A$): A square $n \times n$ matrix where entry $a_{ij} = 1$ if an edge exists between vertex $v_i$ and vertex $v_j$, and $a_{ij} = 0$ otherwise. For undirected simple graphs, this matrix is symmetric along the main diagonal ($A = A^T$) with zeros tracking down the diagonal. +
  • +
  • + Incidence Matrix ($M$): An $n \times m$ matrix (where $m = |E|$) matching vertices against edges. Entry $m_{ij} = 1$ if vertex $v_i$ is an endpoint of edge $e_j$, and $m_{ij} = 0$ otherwise. Each column in an undirected incidence matrix contains exactly two 1s. +
  • +
  • + Adjacency List: An array of linked lists or dynamic arrays, where each index $i$ corresponds to vertex $v_i$ and contains a list of all its neighboring adjacent vertices. This representation is highly memory-efficient for sparse graphs. +
  • +
+
+ +
+ + {/* 5. Graph Isomorphism */} +
+

+ 5. Graph Isomorphism +

+

+ Two graphs $G_1 = (V_1, E_1)$ and $G_2 = (V_2, E_2)$ are **Isomorphic** ($G_1 \simeq G_2$) if they represent the exact same structural connectivity layout, differing only in the names or labeling configurations of their vertices. Formally, there must exist a bijective function $f: V_1 \rightarrow V_2$ such that vertices $u$ and $v$ are adjacent in $G_1$ if and only if $f(u)$ and $f(v)$ are adjacent in $G_2$. +

+ +
+
+ Isomorphic Invariant Conditions +
+

+ To be isomorphic, two graphs must share identical values across structural metrics. If any of these invariant conditions fail, the graphs are guaranteed to be non-isomorphic: +

+
    +
  • They must contain the exact same number of vertices ($|V_1| = |V_2|$).
  • +
  • They must contain the exact same number of edges ($|E_1| = |E_2|$).
  • +
  • Their sorted vertex degree sequences must be completely identical.
  • +
  • They must contain the same number of connected components, cycles of specific lengths, and cliques.
  • +
+

+ ⚠️ Note: Passing all invariant tests does not guarantee isomorphism; it merely establishes that isomorphism is possible. Definitive proof requires building or verifying the exact mapping bijection. +

+
+
+ +
+ + {/* 6. Eulerian and Hamiltonian Properties */} +
+

+ 6. Traversal Optimization: Eulerian and Hamiltonian Systems +

+ +
+
+

Eulerian Paths and Circuits

+

+ An Eulerian Path is a trail that visits every edge in the graph exactly once. An Eulerian Circuit is an Eulerian path that starts and ends at the same vertex. +

+

+ Euler's Fundamental Theorems: +

+
    +
  • An undirected connected graph has an Eulerian circuit if and only if every vertex has an even degree.
  • +
  • An undirected connected graph has an Eulerian path (but no circuit) if and only if it has exactly two vertices with an odd degree. The path must start at one odd vertex and end at the other.
  • +
+
+ +
+

Hamiltonian Paths and Circuits

+

+ A Hamiltonian Path is a simple path that visits every vertex in the graph exactly once. A Hamiltonian Circuit is a closed loop that visits every vertex exactly once and returns to the initial starting vertex. +

+

+ Sufficient Conditions (Dirac & Ore Theorems): +

+
    +
  • Dirac's Theorem: If a simple graph has $n \ge 3$ vertices and every vertex $v$ satisfies $\text{deg}(v) \ge n/2$, then the graph contains a Hamiltonian circuit.
  • +
  • Ore's Theorem: If a simple graph has $n \ge 3$ vertices and for every pair of non-adjacent vertices $u, v$, the condition $\text{deg}(u) + \text{deg}(v) \ge n$ holds, then the graph contains a Hamiltonian circuit.
  • +
+
+
+
+ +
+ + {/* 7. Planar Graphs */} +
+

+ 7. Topological Space Layouts: Planar Graphs and Parameters +

+

+ A graph is considered Planar if it can be drawn in a single geometric plane such that no two edges cross or intersect each other. When a planar graph is drawn without any edge crossings, it divides the plane into distinct bounded and unbounded geometric spaces called Regions (or Faces). +

+ +
+
+ Euler's Planar Formula +
+

+ For any connected planar graph with $V$ vertices, $E$ edges, and $R$ regions: +

+
+ V − E + R = 2 +
+
+

Boundary Edge Inequalities for Simple Planar Graphs ($V \ge 3$):

+

1. Every region is bounded by at least 3 edges, yielding the inequality: $E \le 3V − 6$.

+

2. If the graph contains no cycles of length 3 (triangle-free), every region is bounded by at least 4 edges, yielding: $E \le 2V − 4$.

+
+
+ +

+ Kuratowski's Theorem: A graph is planar if and only if it does not contain a subgraph that is homeomorphic to, or can be reduced to, $K_5$ (the complete graph on 5 vertices) or $K_{3,3}$ (the complete utility graph on 3 vertices each). These two graphs are the foundational non-planar archetypes. +

+
+ +
+ + {/* 8. Graph Coloring and Chromatic Number */} +
+

+ 8. Graph Coloring & Structural Partition Bounds +

+

+ A Vertex Coloring of a graph $G$ is an assignment of colors to the vertices of $G$ such that no two adjacent vertices share the exact same color. +

+

+ The Chromatic Number, $\chi(G)$: The absolute minimum number of colors required to properly color the vertices of a graph $G$. +

+ +
+
+ Chromatic Number Profiles for Core Graph Classes +
+
    +
  • + Complete Graph ($K_n$): $\chi(K_n) = n$ (every vertex is connected to all others, forcing distinct colors). +
  • +
  • + Bipartite Graph ($K_{m,n}$): $\chi(G) = 2$ (vertices partition cleanly into 2 independent color groupings). +
  • +
  • + Cycle Graph ($C_n$): $\chi(C_n) = 2$ if $n$ is even; $\chi(C_n) = 3$ if $n$ is odd. +
  • +
+
+ The Famous Four-Color Theorem: The chromatic number of any planar graph is at most 4 ($\chi(G) \le 4$). +
+
+
+ +
+ + {/* 9. Factorization of a Graph */} +
+

+ 9. Factorization of a Graph +

+

+ A **Factor** of a graph $G$ is a spanning subgraph of $G$ that contains all the vertices of $G$. **Graph Factorization** is the process of partitioning the complete edge set $E$ of a graph into disjoint, spanning subgraphs (factors). +

+ +
    +
  • + 1-Factorization: A 1-factor is a spanning subgraph that is regular of degree 1 (a perfect matching). A graph can be 1-factored if its entire edge set can be divided into disjoint perfect matchings. A complete graph $K_n$ has a 1-factorization if and only if $n$ is even. +
  • +
  • + 2-Factorization: A 2-factor is a spanning subgraph that is regular of degree 2, which physically manifests as a collection of disjoint cycles. A complete graph $K_n$ can be broken down into disjoint 2-factors if and only if $n$ is an odd integer. +
  • +
+
+ +
+ + {/* 10. Algorithmic Combinatorics */} +
+

+ 10. Algorithmic Optimization Problems +

+ +
+
+

Traveling Salesperson Problem (TSP)

+

Vertex Optimization / Hard Bounds

+

+ Given a weighted complete graph, find the Hamiltonian circuit that minimizes the total edge weight sum. This problem models visiting every target node in a network exactly once while minimizing traveling costs. TSP is an NP-hard optimization problem with no known polynomial-time solution. +

+
+ +
+

Chinese Postman Problem (CPP)

+

Edge Optimization / Polynomial Bounds

+

+ Given a connected weighted graph, find the shortest closed walk that travels across every edge at least once. If the graph contains an Eulerian circuit, the optimal route is simply that circuit, and its length matches the sum of all edge weights. If odd-degree vertices are present, certain edges must be duplicated, which can be solved efficiently using matching algorithms. +

+
+
+
+ +
+ + {/* 11. Historic Problems: The Königsberg Bridge Problem */} +
+

+ 11. Historic Roots: The Königsberg Bridge Problem +

+

+ The origin of modern graph theory traces back to the historic Königsberg Bridge Problem, solved by Leonhard Euler in 1736. The city of Königsberg, Prussia, was divided into four landmasses by the Pregel River, and these landmasses were linked together by seven bridges. The citizens wanted to determine if it was possible to take a walk through the city in such a way that they crossed every bridge exactly once, returning to their starting position. +

+ + {/* Visual Figure for Königsberg Bridge Problem */} +
+
+

+ Visual Figures: The Königsberg Bridge Multigraph Model +

+ +
+ {/* Landmass A */} +
+ Landmass A (North Bank) +
+ + {/* Top Bridges mapping lines */} +
+ / ‖ \ + / ‖ \ +
+ + {/* Middle Landmass C */} +
+
+ Landmass B
(Island) +
+
======
+
+ Landmass C
(East Bank) +
+
+ + {/* Bottom Bridges mapping lines */} +
+ \ ‖ / + \ ‖ / +
+ + {/* Landmass D */} +
+ Landmass D (South Bank) +
+
+ +
+

Euler's Abstract Mapping Resolution:

+

+ Euler mapped the landmasses to vertices and the bridges to multigraph edges. The resulting model yielded the following degrees: A=3, B=5, C=3, D=3. Because all four vertices have an odd degree, the graph contains no Eulerian path or circuit. Thus, the citizens' target walk is mathematically impossible. +

+
+
+
+
+ +
+ + {/* Summary */} +
+

+ Summary +

+

+ In this chapter, we explored graph theory from its structural foundations to its core algorithmic applications. We analyzed fundamental graph parameters like degrees, order, and edge sizes, along with algebraic representation techniques using adjacency matrices and lists. We established structural conditions for graph isomorphism, topological constraints for planarity, and vertex coloring bounds. Finally, we studied optimization problems like TSP and CPP, tracing their origins back to Euler's historic resolution of the Königsberg Bridge Problem. +

+
+
+ ); +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter5.tsx b/app/sem4/discrete/content/chapter5.tsx new file mode 100644 index 0000000..4e00f7a --- /dev/null +++ b/app/sem4/discrete/content/chapter5.tsx @@ -0,0 +1,287 @@ +import React from "react"; + +export function Ch5Content() { + return ( +
+ {/* Introduction */} +

+ Algebraic Structures form an abstract mathematical framework concerned with sets of elements paired with one or more operational rules satisfying explicit axioms. This branch of mathematics provides the foundational underpinnings for public-key cryptography (such as RSA and Elliptic Curve Cryptography), error-correcting codes, hashing protocols, and formal state machine definitions. +

+ +
+ + {/* 1. Binary Operations & Properties */} +
+

+ 1. Binary Operations & Mathematical Properties +

+

+ Let $S$ be a non-empty set. A **Binary Operation** $*$ on $S$ is a mapping or function that assigns to each ordered pair of elements in $S$ a unique element also belonging to $S$. Formally, $*: S \times S \rightarrow S$. +

+ +

Core Operational Properties:

+
    +
  • + Closure Property: The operation is closed if for all elements $a, b \in S$, the output $(a * b) \in S$. +
  • +
  • + Associative Property: For all $a, b, c \in S$, the ordering of evaluation can be grouped arbitrarily: $(a * b) * c = a * (b * c)$. +
  • +
  • + Commutative Property: For all $a, b \in S$, the relative order of the parameters can be swapped: $a * b = b * a$. +
  • +
  • + Identity Element ($e$): An element $e \in S$ is an identity if for all $a \in S$, the operation yields the original element unchanged: $a * e = e * a = a$. +
  • +
  • + Inverse Element ($a^{-1}$): For every element $a \in S$, there exists an inverse element $a^{-1} \in S$ such that executing the operation yields the identity element: $a * a^{-1} = a^{-1} * a = e$. +
  • +
+
+ +
+ + {/* 2. Algebraic Hierarchy */} +
+

+ 2. The Algebraic Hierarchy: From Groupoids to Abelian Groups +

+

+ Algebraic structures are classified into explicit hierarchies depending on which subset of the foundational axioms their operations satisfy: +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StructureRequired Axioms & Constraints
Groupoid (Magma)Closure
SemigroupClosure + Associativity
MonoidClosure + Associativity + Identity Element
GroupClosure + Associativity + Identity + Inverse Element
Abelian GroupClosure + Associativity + Identity + Inverse + Commutativity
+
+
+ +
+ + {/* 3. Modular Sets & Prime Fields */} +
+

+ 3. Concrete Groups over Modular Systems & Prime Order Edge Cases +

+

+ Modular arithmetic systems provide classical, bounded algebraic structures that form the core of modern numeric cryptography. +

+ +
+
+

Additive Modular Group $(\mathbb{Z}_n, +_n)$

+

+ The set of remainders $\mathbb{Z}_n = \{0, 1, 2, \dots, n-1\}$ under addition modulo $n$ forms a valid **Abelian Group**. +
+ - **Identity:** $0$. +
+ - **Inverse of $a$:** $(n - a) \pmod n$. +
+ This group maintains closure and commutativity for any positive integer value of $n$. +

+
+ +
+

Multiplicative Modular Group $(U(n), \cdot_n)$

+

+ The full set $\mathbb{Z}_n$ under standard multiplication modulo $n$ does **not** form a group because $0$ has no multiplicative inverse. Instead, we define the reduced set: +
+ + U(n) = \{ a \in \mathbb{Z}_n \mid \text{gcd}(a, n) = 1 \} + + $U(n)$ contains only elements coprime to $n$. Under multiplication modulo $n$, it forms a strict Abelian Group. +

+
+
+ +
+

⚠️ Critical Prime Element Constraint Rule:

+

+ If the modular boundary parameter $p$ is a strict **Prime Number**, then all non-zero elements are guaranteed to be coprime to $p$. Consequently, the multiplicative set reduces to $\mathbb{Z}_p^* = \{1, 2, 3, \dots, p-1\}$. Under multiplication modulo $p$, this set contains precisely $p-1$ elements and satisfies all group parameters. +

+
+
+ +
+ + {/* 4. Subgroups & Cyclic Groups */} +
+

+ 4. Subgroups, Cyclic Frameworks, and Generative Elements +

+

+ A non-empty subset $H$ of a group $(G, *)$ is classified as a **Subgroup** ($H \le G$) if $H$ forms a valid group under the identical operation rule $*$. +

+ +
+
+ The Multi-Step Subgroup Criteria Theorem +
+

+ A subset $H \subseteq G$ is a subgroup if and only if it satisfies three structural tests cleanly: +

+
    +
  1. Identity check: The identity element $e$ of the main group belongs to $H$ ($e \in H$).
  2. +
  3. Closure under the operation: For all $a, b \in H \implies (a * b) \in H$.
  4. +
  5. Closure under inverses: For all $a \in H \implies a^{-1} \in H$.
  6. +
+
+ +

Cyclic Groups & Generators

+

+ A group $G$ is called a **Cyclic Group** if every single element within the group can be generated by repeatedly applying the operational rule to a single chosen base element $a \in G$. The element $a$ is designated as the **Generator** of the group, denoted as $G = \langle a \rangle$. +

+
    +
  • In multiplicative structures, this corresponds to power steps: $\langle a \rangle = \{a^n \mid n \in \mathbb{Z}\}$.
  • +
  • In additive structures, this corresponds to scalar steps: $\langle a \rangle = \{n \cdot a \mid n \in \mathbb{Z}\}$.
  • +
+

+ Theorem on Cyclic Commutativity: Every cyclic group is guaranteed to be an Abelian group, but an Abelian group is not necessarily cyclic (e.g., the Klein 4-Group). +

+
+ +
+ + {/* 5. Cosets & Lagrange's Theorem */} +
+

+ 5. Cosets & Lagrange's Structural Partition Theorem +

+

+ Let $H$ be a static subgroup of group $G$, and let $a$ be an arbitrary element belonging to $G$. +

+
    +
  • Left Coset of $H$: The set $aH = \{a * h \mid h \in H\}$.
  • +
  • Right Coset of $H$: The set $Ha = \{h * a \mid h \in H\}$.
  • +
+

+ Cosets partition a group into disjoint paths of uniform sizing layout. This spatial uniformity leads directly to one of the most critical structural bounds in abstract algebra: +

+ +
+
+ Lagrange's Subgroup Order Theorem +
+

+ If $G$ is a finite group and $H$ is a valid subgroup of $G$, then the order (cardinality) of $H$ must divide the order of $G$ perfectly: +

+
+ |H|  \Big|  |G| +
+
+

🚨 Crucial Deductions and Edge Case Realities:

+

1. The ratio $[G : H] = |G| / |H|$ counts the total number of unique, distinct cosets of $H$ in $G$. This value is called the Index of $H$.

+

2. **Prime Group Invariant:** Any group containing a strictly **prime order** $|G| = p$ has no non-trivial subgroups. Its only possible subgroups have orders 1 or $p$. Thus, every group of prime order is guaranteed to be a cyclic group generated by any non-identity element.

+
+
+
+ +
+ + {/* 6. Rings, Commutative Rings & Integral Domains */} +
+

+ 6. Dual Operation Systems: Rings, Commutative Rings, and Integral Domains +

+

+ When an abstract system incorporates **two** operational rules—traditionally designated as Addition ($+$) and Multiplication ($\cdot$)—it moves beyond group structures into standard dual ring systems. +

+ +

+ A **Ring** $(R, +, \cdot)$ is an ordered triple satisfying three integrated modular stages of axioms: +

+
    +
  1. $(R, +)$ forms an **Abelian Group** (satisfying Closure, Associativity, Identity=$0$, Inverses=$-a$, and Commutativity).
  2. +
  3. $(R, \cdot)$ forms a basic **Semigroup** (satisfying Closure and Associativity).
  4. +
  5. **Distributive Properties:** Multiplication distributes over addition across all element pathways: $a \cdot (b + r) = (a \cdot b) + (a \cdot r)$ and $(b + r) \cdot a = (b \cdot a) + (r \cdot a)$.
  6. +
+ +

Variations of Ring Structures:

+
    +
  • + Commutative Ring: A ring where multiplication is commutative: $a \cdot b = b \cdot a$. +
  • +
  • + Ring with Unity: A ring that contains a multiplicative identity element (denoted as $1$) such that $a \cdot 1 = 1 \cdot a = a$. +
  • +
  • + Zero Divisors: Non-zero elements $a, b \in R$ such that their multiplication evaluates to zero: $a \cdot b = 0$ while $a \neq 0$ and $b \neq 0$. For instance, in $\mathbb{Z}_6$, elements $2$ and $3$ are zero divisors because $2 \cdot 3 = 6 \equiv 0 \pmod 6$. +
  • +
  • + Integral Domain: A commutative ring with unity that contains **absolutely no zero divisors**. This allows for the standard algebraic cancellation law: if $a \cdot b = a \cdot c$ and $a \neq 0$, then $b = c$. +
  • +
+
+ +
+ + {/* 7. Fields */} +
+

+ 7. Fields & Global Algebraic Completeness +

+

+ A **Field** $(F, +, \cdot)$ represents the highest tier of structural completeness for continuous and discrete numerical systems. It is an integral domain where every single non-zero element must possess a unique multiplicative inverse. +

+ +
+

The Definitive Field Requirements:

+

An algebraic structure is a field if and only if it satisfies three integrated requirements:

+
    +
  • $(F, +)$ forms a completely cooperative Abelian Group with additive identity $0$.
  • +
  • $(F \setminus \{0\}, \cdot)$ forms an independent, clean Abelian Group with multiplicative identity $1$.
  • +
  • Multiplication distributes over addition.
  • +
+

+ Standard Examples: The sets of Rational Numbers ($\mathbb{Q}$), Real Numbers ($\mathbb{R}$), and Complex Numbers ($\mathbb{C}$) are fields. The set of Integers ($\mathbb{Z}$) is **not** a field, because integers like 2 lack an integer multiplicative inverse ($1/2 \notin \mathbb{Z}$); $\mathbb{Z}$ is merely an integral domain. +

+
+ +

Finite Fields (Galois Fields, $GF(p)$)

+

+ In computational environments, algorithms rely on bounded finite fields. A finite field can be constructed out of modular integer sets if and only if the modulus is a strict **Prime Number $p$**. The structure $(\mathbb{Z}_p, +, \cdot)$ forms a strict finite field, denoted as $GF(p)$ or $\mathbb{F}_p$. +

+
+ +
+ + {/* Summary */} +
+

+ Summary +

+

+ In this chapter, we analyzed abstract algebraic structures across a progression of structural constraints. We tracked the expansion of operational rules from single-operation structures (including semi-groups, monoids, groups, and commutative Abelian groups) up to modular integer settings. We explored subgroups, generators of cyclic sets, and geometric scaling using Lagrange's theorem. Finally, we studied dual-operation systems, tracing the progression from rings to cancellation-safe integral domains and globally invertible fields. +

+
+
+ ); +} \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter6.tsx b/app/sem4/discrete/content/chapter6.tsx new file mode 100644 index 0000000..d948a1e --- /dev/null +++ b/app/sem4/discrete/content/chapter6.tsx @@ -0,0 +1,13 @@ +export function Ch6Content() { + return ( +
+

Boolean Algebra and Automata

+

Module 6 (Advanced / Optional) — high-level unit headings; fill details later.

+
    +
  • Boolean functions and simplification techniques
  • +
  • Karnaugh maps (K-maps) and minimization
  • +
  • Formal languages, grammars, and finite automata (intro)
  • +
+
+ ); +} diff --git a/app/sem4/discrete/layout.tsx b/app/sem4/discrete/layout.tsx new file mode 100644 index 0000000..7e1b42f --- /dev/null +++ b/app/sem4/discrete/layout.tsx @@ -0,0 +1,29 @@ +// app/sem4/discrete/layout.tsx + +import Navbar from "../../components/navbar"; +import Sidebar from "./components/sidebar"; + +export const metadata = { + title: "Discrete Mathematics | openCSE", + description: "Free and Open Documentations for Discrete Mathematics", +}; + +export default function DiscreteLayout({ + children, +}: { + children: React.ReactNode; +}) { + return ( +
+ + +
+ + +
+
{children}
+
+
+
+ ); +} diff --git a/app/sem4/discrete/page.tsx b/app/sem4/discrete/page.tsx new file mode 100644 index 0000000..0e544d8 --- /dev/null +++ b/app/sem4/discrete/page.tsx @@ -0,0 +1,5 @@ +import { redirect } from "next/navigation"; + +export default function Page() { + redirect("/sem4/discrete/ch0"); +} From b4481d38025c7b0889988b678a8f59703772a218 Mon Sep 17 00:00:00 2001 From: Reaper-ai Date: Thu, 11 Jun 2026 14:14:10 +0530 Subject: [PATCH 2/2] course implemented + bug fixes --- app/components/Math.tsx | 17 + app/components/subjects.tsx | 4 +- app/sem4/discrete/components/sidebar.tsx | 17 +- app/sem4/discrete/content/chapter0.tsx | 153 ++++-- app/sem4/discrete/content/chapter1.tsx | 596 ++++++++++++----------- app/sem4/discrete/content/chapter2.tsx | 150 +++--- app/sem4/discrete/content/chapter3.tsx | 319 ++++++------ app/sem4/discrete/content/chapter4.tsx | 474 +++++++++--------- app/sem4/discrete/content/chapter5.tsx | 154 +++--- app/sem4/discrete/content/chapter6.tsx | 4 + package-lock.json | 59 ++- package.json | 4 +- 12 files changed, 1104 insertions(+), 847 deletions(-) create mode 100644 app/components/Math.tsx diff --git a/app/components/Math.tsx b/app/components/Math.tsx new file mode 100644 index 0000000..f0c9f2b --- /dev/null +++ b/app/components/Math.tsx @@ -0,0 +1,17 @@ +"use client" + +import React from "react" +import { InlineMath, BlockMath } from 'react-katex' +import 'katex/dist/katex.min.css' + +type Props = { math: string; className?: string } + +export function Inline({ math, className = "" }: Props) { + return +} + +export function Block({ math, className = "" }: Props) { + return +} + +export default { Inline, Block } diff --git a/app/components/subjects.tsx b/app/components/subjects.tsx index 724b848..0fa1ebf 100644 --- a/app/components/subjects.tsx +++ b/app/components/subjects.tsx @@ -97,7 +97,7 @@ const subjectCodes: Record = { "Web Technologies": "wt", "DevOps & Linux Administration": "dops", "Organizational Behavior": "ob", - "Discrete Mathematics": "dm", + "Discrete Mathematics": "discrete", "Data Science using Python Libraries": "dsp", "Artificial Intelligence": "ai", @@ -125,7 +125,7 @@ const subjectCodes: Record = { }; // Available subjects -const available = ["ep", "c", "em1", "em2", "oops", "dsc", "coa", "os", "ml", "dops", "cd", "cle","ec"]; +const available = ["ep", "c", "em1", "em2", "oops", "dsc", "coa", "os", "discrete", "ml", "dops", "cd", "cle", "ec"]; export default function SubjectsSection() { return ( diff --git a/app/sem4/discrete/components/sidebar.tsx b/app/sem4/discrete/components/sidebar.tsx index fda4623..1062188 100644 --- a/app/sem4/discrete/components/sidebar.tsx +++ b/app/sem4/discrete/components/sidebar.tsx @@ -20,15 +20,14 @@ export default function Sidebar() { } }, []); - const chapters = [ - { id: "ch0", title: "Course Outline" }, - { id: "ch1", title: "Sets and Logic" }, - { id: "ch2", title: "Relations and Functions" }, - { id: "ch3", title: "Counting and Combinatorics" }, - { id: "ch4", title: "Graph Theory" }, - { id: "ch5", title: "Recurrence Relations" }, - { id: "ch6", title: "Boolean Algebra" }, - ]; +const chapters = [ + { id: "ch0", title: "Chapter 0: Course Outline" }, + { id: "ch1", title: "Chapter 1: Mathematical Logic and Proofs" }, + { id: "ch2", title: "Chapter 2: Set Theory, Relations, and Functions" }, + { id: "ch3", title: "Chapter 3: Combinatorics, Number Theory, and Recurrence Relations" }, + { id: "ch4", title: "Chapter 4: Graph Theory" }, + { id: "ch5", title: "Chapter 5: Algebraic Structures" }, +]; return ( <> diff --git a/app/sem4/discrete/content/chapter0.tsx b/app/sem4/discrete/content/chapter0.tsx index 4fba9f0..1c69787 100644 --- a/app/sem4/discrete/content/chapter0.tsx +++ b/app/sem4/discrete/content/chapter0.tsx @@ -1,35 +1,36 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + export function Ch0Content() { return (

- Welcome to Discrete Mathematics — - a foundational course designed to explore mathematical structures that are fundamentally discrete rather than continuous. This course serves as the backbone for algorithm design, computer architecture, cryptography, and formal systems. + Welcome to Discrete Mathematics — a core foundational syllabus designed to analyze mathematical elements that take on distinct, separated values rather than continuous intervals. This course acts as the absolute structural pillar for algorithm layout complexity bounds, microprocessor logic paths, cryptographic keyspaces, and formal grammar verification.


- Module I: Mathematical Logic and Proofs -

-
    -
  • Propositional Logic, connectives, truth tables, and logical equivalences
  • -
  • Predicate Logic, universal and existential quantifiers, and rules of inference
  • -
  • Proof Techniques: direct proofs, contradiction, contraposition, and mathematical induction
  • -
-
- -
- -
-

- Module II: Set Theory, Relations, and Functions + Chapter 1: Mathematical Logic and Proofs

-
    -
  • Set fundamentals, operations, identities, and Venn diagrams
  • -
  • Relations, properties (reflexive, symmetric, transitive), and equivalence classes
  • -
  • Partial orderings, posets, and Hasse diagrams
  • -
  • Functions: injective, surjective, bijective, composition, and inverse functions
  • +

    + Establishes the un-ambiguous truth checking models used to construct flawless mathematical arguments. +

    +
      +
    • + Propositional Logic Syntax: Declarative assertions, complete primitive connectives (, , , , , ), functional truth matrices, and invariant edge exceptions like vacuous truth states. +
    • +
    • + Algebraic Equivalence Laws: Minimizing complex logical chaining expressions using Idempotent, Absorption, Domination, Distributive, and De Morgan algebraic invariants. +
    • +
    • + Predicate Scoping: Bounding variable properties using Universal () and Existential () operators, and the non-commutative sequence limitations of nested quantifier scopes. +
    • +
    • + Formal Proof Methodologies: Structural proofs via Direct derivation (), Invariant Contraposition (), Elimination by Contradiction (), and complete Mathematical Induction step mappings. +
@@ -37,13 +38,27 @@ export function Ch0Content() {

- Module III: Combinatorics and Counting + Chapter 2: Set Theory, Relations, and Functions

-
    -
  • Basic counting principles: sum rule and product rule
  • -
  • Inclusion-Exclusion Principle and the Pigeonhole Principle
  • -
  • Permutations and combinations with or without repetitions
  • -
  • Introduction to generating formulas and configurations
  • +

    + Defines the core groupings, ordered pairings, and deterministic transformations of discrete variables. +

    +
      +
    • + Set Topology Invariants: Subsets (), Power sets () with cardinality metrics (), operations (), and algebraic identities. +
    • +
    • + Binary Coordinate Relations: Cartesian products (), relational profiles, and exact matrix classifications (Reflexive, Irreflexive, Symmetric, Asymmetric, Anti-Symmetric, Transitive). +
    • +
    • + Partitions & Equivalence Domains: Constructing equivalence relations, parsing element classes (), and structural block formatting using the Fundamental Partition Theorem. +
    • +
    • + Posets & Order Systems: Partial orderings (), Linear Total orders, immediate covering parameters, and structural visual formatting of Hasse Diagrams. +
    • +
    • + Functional Mappings: Functional boundary setups (), structural classification types (Injective, Surjective, Bijective matchings), function composition associativity, non-commutativity laws, and inverse step criteria (). +
@@ -51,13 +66,24 @@ export function Ch0Content() {

- Module IV: Graph Theory + Chapter 3: Combinatorics, Number Theory, and Recurrence Relations

-
    -
  • Graph fundamentals: vertices, edges, degree, directed vs undirected graphs
  • -
  • Paths, cycles, connectivity, and connected components
  • -
  • Trees, spanning trees, Eulerian graphs, and Hamiltonian circuits
  • -
  • Planar graphs, Euler's formula, and basic graph coloring principles
  • +

    + Measures layout configuration paths, numerical divisibility bounds, and sequential recursive equations. +

    +
      +
    • + Combinatorial Counting Invariants: Fundamental Sum and Product rules, the Principle of Inclusion-Exclusion for discrete probabilities, and worst-case bounds under the Generalized Pigeonhole Principle. +
    • +
    • + Number Theory Systems: Greatest Common Divisors (), Least Common Multiples (), Bézout Coefficients derived from the Extended Euclidean Algorithm, solvability limits of Linear Diophantine Equations (), and unique modular roots via the Chinese Remainder Theorem. +
    • +
    • + Recurrence System Classifications: Formulating relational models from applications, linear homogeneous sequences, and linear non-homogeneous systems containing forcing factors (). +
    • +
    • + Analytical Resolution Tracks: Resolving boundary steps via Repeated Substitution iterations, polynomial Characteristic Root extractions (Distinct vs. Multiplicity root chains), and infinite power series transformations using formal Generating Functions paired with the Extended Binomial Theorem. +
@@ -65,12 +91,33 @@ export function Ch0Content() {

- Module V: Recurrence Relations + Chapter 4: Graph Theory

-
    -
  • Formulating recurrence relations from real-world and structural problems
  • -
  • Solving linear homogeneous recurrence relations with constant coefficients
  • -
  • Non-homogeneous recurrence relations and an overview of generating functions
  • +

    + Models topological network connections, traversal routing optimization, and spatial space partitioning. +

    +
      +
    • + Graph Topologies: Vertices, edges, Order () and Size () parameters, localized degree behaviors, and the invariant constraints of the Handshaking Lemma. +
    • +
    • + Graph Operations & Sub-units: Subgraphs, Subtrees, structural Graph Joins (), and spatial Cartesian Products (). +
    • +
    • + Computational Layout Matrices: Square Adjacency Matrices (), non-square Incidence Matrices (), and memory-optimized dynamic Adjacency Lists. +
    • +
    • + Network Traversal Paths: Differentiating Walks, Trails, Paths, Circuits, and Cycles. Historic roots from Leonhard Euler's Königsberg Bridge problem. +
    • +
    • + Routing & Traversal Optimization: Parity guidelines for Eulerian paths/circuits, the Chinese Postman Problem, Dirac and Ore boundaries for Hamiltonian circuits, and NP-hard constraints of the Traveling Salesperson Problem. +
    • +
    • + Isomorphism & Surface Embedding: Mapping bijections () using structural invariant tests, topological Planar Graphs, Euler's Region Formula (), and Kuratowski's forbidden non-planar subgraphs (, ). +
    • +
    • + Coloring & Partitioning: Chromatic numbers (), planar graph mapping bounds under the Four-Color Theorem, and edge set partitioning into matching perfect subsets via 1-Factorization and 2-Factorization rules. +
@@ -78,19 +125,37 @@ export function Ch0Content() {

- Module VI: Boolean Algebra and Automata + Chapter 5: Algebraic Structures

-
    -
  • Boolean functions, algebraic properties, and simplification techniques
  • -
  • Karnaugh Maps (K-maps) and logical gate minimizations
  • -
  • Formal languages, grammars, and an introduction to Finite State Automata
  • +

    + Analyzes abstract axiomatic systems governing single and dual operational numeric domains. +

    +
      +
    • + Binary Rule Axioms: Core operational guidelines spanning Closure bounds, Associativity grouping, Identity retention (), and unique Inverse reflections (). +
    • +
    • + Single Operation Hierarchies: System classifications tracking from basic Magmas and Semigroups to Monoids, full algebraic Groups, and commutative Abelian systems. +
    • +
    • + Modular Groups: Finite additive groups (, ), coprime multiplicative groups (, ), and crypto-safe prime order fields (). +
    • +
    • + Sub-domains & Generators: Subgroup validation criteria, generative tracking elements of Cyclic Groups (), left/right coset configurations, and index scaling based on Lagrange's Subgroup Order Theorem. +
    • +
    • + Dual Operation Rings: System behaviors under two concurrent operators (, ) satisfying Ring axioms, Commutative rings, Rings with Unity, Zero Divisor hazards, and cancellation-safe fields of Integral Domains. +
    • +
    • + Invertible Fields: Global completeness criteria of algebraic Fields, finite Galois Field limits ( or ), and their performance configuration rules inside numeric engineering applications. +

- By the end of this course, you will possess a rigorous mathematical toolkit capable of analyzing discrete computations, modeling graph networks, minimizing hardware architectures, and formally proving engineering properties. + By mastering these 5 discrete structural chapters, you will possess the complete analytical toolkit required to formally evaluate algorithmic complexities, prove computing safety properties, layout database schemas, and optimize hardware gate configurations.

); diff --git a/app/sem4/discrete/content/chapter1.tsx b/app/sem4/discrete/content/chapter1.tsx index de0f29e..3c5a9b1 100644 --- a/app/sem4/discrete/content/chapter1.tsx +++ b/app/sem4/discrete/content/chapter1.tsx @@ -1,499 +1,541 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + export function Ch1Content() { return (
+ {/* Overview */}

- Mathematical Logic provides the formal, unambiguous framework required to construct valid mathematical arguments, design digital hardware, and verify software systems. It eliminates conversational ambiguities by mapping statements to absolute truth values. + Welcome to the comprehensive study of Mathematical Logic and Proofs. This field acts as the absolute bedrock for formal computer science engineering. It dictates how microprocessors execute boolean branching, forms the mechanical rules behind automated software verification, and guarantees that structural derivations in mathematics are free from human conversational ambiguity.

-
+
- {/* Section 1: Propositional Logic */} + {/* 1. Propositional Logic */}
-

1. Propositional Logic & Connectives

+

+ 1. Deep Dive into Propositional Logic & Structural Operators +

- A Proposition is a declarative statement that is either strictly True (T) or False (F), but never both simultaneously, ambiguous, or dependent on subjective interpretation. + A Proposition is defined strictly as a declarative sentence that possesses exactly one invariant truth value—either completely True or completely False—but never both, never ambiguous, and never dependent on context or subjective interpretation.

-
-
-

Valid Propositions

-
    -
  • "7 is a prime number." (True)
  • -
  • "The earth is perfectly flat." (False)
  • -
  • "2 + 2 = 5." (False)
  • +
    +
    +

    Valid Mathematical Propositions

    +
      +
    • "The integer is a prime number." (Evaluates to True)
    • +
    • (Evaluates cleanly to False)
    • +
    • "The binary string contains exactly four digits." (Evaluates to True)
    -
    -

    Invalid Statements

    -
      -
    • "Bring me a glass of water." (Command/Imperative)
    • -
    • "Is the exam tomorrow?" (Question/Interrogative)
    • -
    • "x + 5 = 9." (Open statement; truth depends on x)
    • +
      +

      Invalid Non-Propositional Assertions

      +
        +
      • "Please compile this module immediately." (An imperative command or request)
      • +
      • "Is the system path set correctly?" (An interrogative question)
      • +
      • (An open sentence; truth value remains variable until is assigned a domain item)
    -

    Core Logical Operators & Complete Truth Tables

    +

    Formal Logical Connectives & Complete Truth Matrix

    - Compound propositions are formed by modifying or joining primitive propositions using logical operators. + Complex algorithmic structures are constructed by modifying or joining primitive propositions using explicit operational connectives. Let us define the exact operational logic for every single connective:

    -
    - - - - - - +
    +
    OperationSymbolCore Evaluative Rule
    + + + + + - + - - - + + + - - + + - - + + - - + + - - + + - - + +
    Operator NameSymbolStrict Invariant Evaluation Condition
    Negation¬pFlips the truth value. ¬T = F, ¬F = T.Negation (NOT)Flips the truth value cleanly. Invents an opposite polarity state.
    Conjunction (AND)p ∧ qTrue **only** if both p and q are true.Evaluates to strictly True only if both constituent elements are simultaneously True.
    Disjunction (OR)p ∨ qFalse **only** if both p and q are false. Inclusive OR.Inclusive operational rule. Evaluates to False only if both constituent elements are simultaneously False.
    Exclusive OR (XOR)p ⊕ qTrue if p and q have **different** truth values.Evaluates to True if and only if the inputs possess differing or mismatched truth parameters.
    Conditional (Implication)p → qFalse **only** when a True premise leads to a False conclusion.Asserts directional consequence. Evaluates to False only if a True premise triggers a False conclusion.
    Biconditional (IFF)p ↔ qTrue **only** when p and q share identical truth values.Equivalence evaluation. Yields True if and only if both components share an identical state.
    -
    - - - - - - - - - - - +
    +
    pq¬pp ∧ qp ∨ qp ⊕ qp → qp ↔ q
    + + + + + + + + + + - + - - + + - + - + - - + + - - + + - - + + - - + + - - + + - - - + + +
    TTTT FTT T F TTT
    TFTF F F TTFTF F
    FTFT T F TTTTT F
    FFFF T FF FTTFTT
    -
    -

    ⚠️ Critical Edge Cases of Conditional Operators:

    -

    - 1. **Vacuous Truth:** The implication $p \rightarrow q$ is automatically **True** whenever the premise $p$ is False (Rows 3 and 4). For example: "If 2 + 2 = 5, then I am the King of France" evaluates as a completely valid, true mathematical implication. +

    +
    + ⚠️ Invariant Edge Cases & Logical Exceptions of Implications: +
    +

    + 1. Vacuous Truth: Look carefully at rows 3 and 4 of the truth table. When the premise is entirely False, the implication statement evaluates to True automatically, completely independent of the truth state of the conclusion . This is known as a vacuous truth mapping. For instance, the statement: "If an odd integer is divisible by , then the moon is manufactured out of green cheese" is completely mathematically valid and evaluates to True.
    - 2. **Directional Dependency:** $p \rightarrow q$ is **not** logically equivalent to $q \rightarrow p$. Order of operators matters significantly. + 2. Logical Mismatch: Implication does not signify causal correlation or chronological dependency. It is strictly an algebraic gating condition.

-
+
- {/* Section 2: Conversions of Implication */} + {/* 2. Conversions of an Implication */}
-

2. Conversions of an Implication

+

+ 2. Systematic Structural Variations of a Conditional Statement +

- Given a base conditional statement p → q, three related variations can be derived: + Given a base structural implication , engineers derive three explicitly distinct logical configurations that alter operator placement and variable inversion:

    -
  • Converse: $q \rightarrow p$. (Swapping the premise and conclusion).
  • -
  • Inverse: $\neg p \rightarrow \neg q$. (Negating both the premise and conclusion).
  • -
  • Contrapositive: $\neg q \rightarrow \neg p$. (Negating and swapping both components).
  • +
  • + The Converse: Swaps the structural position of the components entirely. Formally mapped as: . +
  • +
  • + The Inverse: Retains the position but negates the truth value of both components. Formally mapped as: . +
  • +
  • + The Contrapositive: Simultaneously swaps positions and negates both constituent terms. Formally mapped as: . +
-
-

Equivalence Pairings:

-

1. Implication ≡ Contrapositive: (p → q) ≡ (¬q → ¬p)

-

2. Converse ≡ Inverse: (q → p) ≡ (¬p → ¬q)

-

Proof: Look at the truth table under Row 2 ($p=T, q=F$). The implication is False. Its contrapositive is $\neg q \rightarrow \neg p \equiv T \rightarrow F$, which is also False.

+
+

Critical Logical Equivalence Pairings:

+

+ An implication statement is always completely equivalent to its contrapositive. They share identical truth tables: +
+ + + + Similarly, the converse statement is always completely equivalent to the inverse statement: +
+ + + + Warning: A common engineering flaw is to assume that the converse or inverse matches the truth profile of the original implication. They are completely independent mappings. +

-
+
- {/* Section 3: Laws of Propositional Logic */} + {/* 3. Laws of Propositional Logic */}
-

3. Laws and Algebraic Properties of Propositional Logic

+

+ 3. Algebraic Equivalences & Logical Laws +

- Propositions satisfy multiple logical equivalence laws, which allow complex logical expressions to be algebraically simplified without relying on massive truth tables. + Just as numerical algebra possesses rules for factoring constants, propositional expressions can be structurally manipulated or minimized using strict algebraic laws. These equivalences provide the absolute mechanical rules used to optimize digital logical gate routing in hardware verification compilers.

-
- - - - - +
+
Law NameEquivalence Relations
+ + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + +
Law DesignationFormal Equivalence Rule Expressions
Identity Lawsp ∧ T ≡ p
p ∨ F ≡ p
Identity Laws
Domination Lawsp ∨ T ≡ T
p ∧ F ≡ F
Domination Laws
Idempotent Lawsp ∨ p ≡ p
p ∧ p ≡ p
Idempotent Laws
Double Negation¬(¬p) ≡ pDouble Negation
Commutative Lawsp ∨ q ≡ q ∨ p
p ∧ q ≡ q ∧ p
Commutative Laws
Associative Laws(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
Associative Laws
Distributive Lawsp ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
Distributive Laws
De Morgan's Laws¬(p ∧ q) ≡ ¬p ∨ ¬q
¬(p ∨ q) ≡ ¬p ∧ ¬q
De Morgan's Laws
Absorption Lawsp ∨ (p ∧ q) ≡ p
p ∧ (p ∨ q) ≡ p
Absorption Laws
Negation Lawsp ∨ ¬p ≡ T (Law of Excluded Middle)
p ∧ ¬p ≡ F (Law of Contradiction)
Negation Axioms (Law of Excluded Middle)
(Law of Contradiction)
Conditional Equivalencep → q ≡ ¬p ∨ qConditional Equivalent
-
+
- {/* Section 4: Predicate Logic */} + {/* 4. Predicate Logic & Quantifier Invariants */}
-

4. Predicate Logic & Quantifier Properties

+

+ 4. Advanced Predicate Logic & Domain Quantifiers +

- Predicate Logic expands on propositional logic by dealing with variables over specified domains using assertions and quantifiers. A predicate $P(x)$ assigns a property to a variable $x$. It becomes a proposition only when $x$ is assigned a specific value or bounded by a quantifier. + Propositional logic lacks structural granularity because it cannot look inside elements or address variables over variable domains. Predicate Logic expands on this by introducing variables, descriptive properties, and quantifiers. A predicate expression maps an assertion to an object variable inside a defined domain space. It transforms into a standard concrete proposition only when is bounded by an explicit domain item or quantifier loop.

-

Quantifiers & Bounding Rules

+

Core Bounding Quantifiers

    -
  • Universal Quantifier (∀x): The statement $∀x P(x)$ asserts that $P(x)$ is strictly True for **every single** element within the specified domain. It behaves like an infinite chain of conjunctions: $P(x_1) \wedge P(x_2) \wedge P(x_3) \dots$
  • -
  • Existential Quantifier (∃x): The statement $∃x P(x)$ asserts that there exists **at least one** element within the domain for which $P(x)$ evaluates to True. It behaves like an infinite chain of disjunctions: $P(x_1) \vee P(x_2) \vee P(x_3) \dots$
  • +
  • + Universal Quantifier (): States that the target predicate condition is completely and uniformly valid for every single element within the active domain. It represents a bound conjunction across the domain pool: +
  • +
  • + Existential Quantifier (): States that there exists at least one distinct element within the domain for which evaluates to True. It represents a bound disjunction across the domain pool: +
-

Properties and Logical Equivalences of Quantifiers

-
- - - - - - +

Topological Quantifier Rules & De Morgan Invariants

+
+
Logical Rule / EquivalenceStructural ExpressionEdge Cases & Constraints
+ + + + + - + - - - + + + - - - + + + - - - + + + - - - + + +
Quantifier Rule ConceptStructural Algebraic RepresentationOperational Boundary Logic
Quantifier De Morgan (1)¬(∀x P(x)) ≡ ∃x ¬P(x)To disprove a universal rule, you only need to find a single counterexample.Quantifier De Morgan (1)To completely invalidate a universal law, you only need to locate one counterexample item.
Quantifier De Morgan (2)¬(∃x P(x)) ≡ ∀x ¬P(x)Asserting something does not exist means it is false for every element in the domain.Quantifier De Morgan (2)Asserting that an object instance does not exist means it evaluates to false for all items across the domain.
Universal Distributivity∀x (P(x) ∧ Q(x)) ≡ ∀x P(x) ∧ ∀x Q(x)**Warning:** ∀x (P(x) ∨ Q(x)) is **NOT** equivalent to ∀x P(x) ∨ ∀x Q(x).Universal DistributivityUniversal scoping applies directly over conjunction operations without leakage.
Existential Distributivity∃x (P(x) ∨ Q(x)) ≡ ∃x P(x) ∨ ∃x Q(x)**Warning:** ∃x (P(x) ∧ Q(x)) is **NOT** equivalent to ∃x P(x) ∧ ∃x Q(x).Existential DistributivityExistential allocation splits completely over active inclusive disjunction pathways.
-
-

💡 Critical Counter-Intuitive Edge Case (Nested Quantifiers):

-

- ∃y ∀x P(x, y) → ∀x ∃y P(x, y) is TRUE, but its converse is FALSE. -

-

- Let $P(x, y)$ be the statement "y loves x". +

+
+ ⚠️ Exception Invariant: Critical Scope Gating of Nested Quantifiers +
+

+ The relative parsing sequence of nested asymmetric quantifiers is strictly one-way and cannot be swapped. Consider this directional theorem condition: +
+ +   is True, but its converse is completely False. + + Let our domain pool be all human beings, and let represent the predicate property string: "Object has cleared system access keys for user ".
- - $\exists y \forall x P(x, y)$ means: "There is a specific person $y$ who loves absolutely everyone $x$." (A universal lover exists). + - The left-hand expression asserts: There exists a specific, master administrator who holds systemic clearance keys matching absolutely every person in the corporation.
- - $\forall x \exists y P(x, y)$ means: "For every person $x$, there is someone $y$ who loves them." (Everyone has at least one lover, but it can be a different person for each $x$). + - The right-hand expression asserts: For every single corporate user , there is at least one clearing technician assigned to them (but it can be a completely distinct, unique employee for every person).
- Clearly, the first statement implies the second, but the second does not imply the first. **Order of nested quantifiers cannot be swapped freely.** + Clearly, a master administrator implies everyone has a key-holder, but everyone having an individual technician does not imply the existence of a single master administrator. Quantifier sequence swapping causes systemic logical collapse.

-
+
- {/* Section 5: Rules of Inference */} + {/* 5. Rules of Inference */}
-

5. Rules of Inference

+

+ 5. Structural Rules of Formal Inference +

- Rules of inference are templates used to deduce a valid conclusion from a set of true assertions (premises). They form the foundation of logical reasoning and logical steps. + To build complex structural proofs without writing out massive multi-variable truth tables, logical engines leverage standardized deductive templates. These are called the Rules of Inference. Each rule represents a tautological implication framework where if the input conditions (premises) are accepted as True, the resulting logical consequence must be True.

-
- - - - - - +
+
Rule NameSymbolic Layout / StepNatural Description
+ + + + + - + - - - + + + - - - + + + - - - + + + - - - + + +
Rule DesignationFormal Symbolic Gating LayoutNatural Logical Execution Meaning
Modus Ponensp
p → q
∴ q
If an implication is true and its premise is true, the conclusion must be true.Modus Ponens

The mode of affirming. If a conditional implication is true, and its starting premise is met, the consequence is verified.
Modus Tollens¬q
p → q
∴ ¬p
If an implication is true and its conclusion is false, its premise must be false.Modus Tollens

The mode of denying. If an implication holds true, but its expected structural consequence is entirely false, the premise must be false.
Hypothetical Syllogismp → q
q → r
∴ p → r
Implications are transitive. Chains can be merged into a single link.Hypothetical Syllogism

Transitive chaining of logic. Connects distinct operations into a single merged processing path.
Disjunctive Syllogismp ∨ q
¬p
∴ q
If an 'OR' statement is true and one component is false, the other component must be true.Disjunctive Syllogism

Exclusive elimination. If an inclusive OR clause is true, but one choice is explicitly negated, the other choice must be true.
-
+
- {/* Section 6: Proof Techniques */} + {/* 6. Proof Techniques with Structural Examples */}
-

6. Comprehensive Proof Techniques with Structural Examples

+

+ 6. Exhaustive Mathematical Proof Methodologies +

- A formal mathematical proof demonstrates that a mathematical statement is true. Below are the core proof strategies used across computer science and discrete mathematics. + A rigorous mathematical proof is a chain of deductive steps using rules of inference that establishes the absolute truth of a theorem statement beyond question.

{/* 6.1 Direct Proof */} -
-

I. Direct Proof ($p \rightarrow q$)

-

- **Strategy:** Assume the premise $p$ is strictly true, and use definition expansions and logical steps to deduce that conclusion $q$ must also be true. +

+

Methodology I: Direct Proof Construction ()

+

+ Strategy Rule: Assume the initial prerequisite premise condition is strictly true. Leverage active definitions, algebraic identities, and verified axioms to perform calculations until the target consequence is directly deduced.

-
-

Theorem: If $n$ is an odd integer, then $n^2$ is an odd integer.

-

Proof Construction:

-
    -
  1. Assume $n$ is an odd integer by default premise.
  2. -
  3. By algebraic definition, $n = 2k + 1$ for some integer $k$.
  4. -
  5. Compute $n^2$: $n^2 = (2k + 1)^2 = 4k^2 + 4k + 1$.
  6. -
  7. Factor the expression: $n^2 = 2(2k^2 + 2k) + 1$.
  8. -
  9. Let $m = 2k^2 + 2k$. Since integers are closed under addition and multiplication, $m$ is also an integer.
  10. -
  11. Therefore, $n^2 = 2m + 1$, which satisfies the definition of an odd integer. ∴ Q.E.D.
  12. +
    +

    Theorem Formulation: If an integer is strictly odd, then its squared product is an odd integer.

    +

    Deductive Step Profile:

    +
      +
    1. Assume the premise holds true: belongs to the set of odd integers.
    2. +
    3. By algebraic definition, any odd integer can be written as for some structural integer element .
    4. +
    5. Perform immediate expansion of the squared variable: .
    6. +
    7. Evaluate polynomial expansion: .
    8. +
    9. Isolate a common factor of to assess divisibility parameters: .
    10. +
    11. Assign a temporary placeholder variable: Let . Since integers are closed under multiplication and addition, is guaranteed to be a solid integer ().
    12. +
    13. Substitute back: This yields . This matches the exact definition layout of an odd integer. Therefore, the statement is directly verified.
- {/* 6.2 Proof by Contraposition */} -
-

II. Proof by Contraposition

-

- **Strategy:** Since $(p \rightarrow q) \equiv (\neg q \rightarrow \neg p)$, we can prove the implication by assuming that the conclusion $q$ is **False** ($\neg q$) and dervining that the premise $p$ must also be **False** ($\neg p$). + {/* 6.2 Contraposition */} +

+

Methodology II: Proof by Structural Contraposition

+

+ Strategy Rule: Since , we bypass a complex forward calculation by assuming that the conclusion is completely False (). We use this setup to perform calculations and derive that the prerequisite premise must be completely False ().

-
-

Theorem: If $3n + 2$ is an odd integer, then $n$ is an odd integer.

-

Proof Construction:

-
    -
  1. Assume the contrapositive hypothesis: The conclusion is false, meaning $n$ is an **even** integer.
  2. -
  3. By definition of an even integer, $n = 2k$ for some integer $k$.
  4. -
  5. Substitute $n$ into the expression: $3n + 2 = 3(2k) + 2 = 6k + 2$.
  6. -
  7. Factor out a 2: $3n + 2 = 2(3k + 1)$.
  8. -
  9. Let $m = 3k + 1$, which is an integer. Thus, $3n + 2 = 2m$.
  10. -
  11. This shows that $3n + 2$ is an even integer, which means the premise is false.
  12. -
  13. Since we showed $\neg q \rightarrow \neg p$, the original theorem $p \rightarrow q$ is proven. ∴ Q.E.D.
  14. +
    +

    Theorem Formulation: For any integer , if the complex product expression is an odd integer, then is an odd integer.

    +

    Deductive Step Profile:

    +
      +
    1. Formulate the contrapositive setup: Assume the conclusion is NOT odd, meaning is an even integer.
    2. +
    3. By basic numerical definition, an even integer can be written as for some reference element .
    4. +
    5. Substitute this expression back into the initial calculation target: .
    6. +
    7. Simplify expression: .
    8. +
    9. Factor out a common divisor of to check for parity parameters: .
    10. +
    11. Let . Because integers are closed under arithmetic transformations, .
    12. +
    13. This yields , proving that the expression is a clean multiple of two, meaning it is an even integer.
    14. +
    15. Since we demonstrated that holds true, the original implication is formally locked.
- {/* 6.3 Proof by Contradiction */} -
-

III. Proof by Contradiction

-

- **Strategy:** Assume that the target theorem statement is completely **False**. Use this assumption to reason through steps until you arrive at a logical impossibility or an absolute contradiction ($r \wedge \neg r$). This proves that your initial assumption was incorrect, meaning the theorem must be true. + {/* 6.3 Contradiction */} +

+

Methodology III: Proof by Logical Contradiction ( )

+

+ Strategy Rule: Assume that the statement you wish to prove is completely and entirely False. Proceed to analyze deductions based on this assumption until your steps run into an absolute structural impossibility, violating a known axiom or creating a logical clash (). This demonstrates that your starting assumption was a logical impossibility, proving the original theorem true.

-
-

Theorem: $\sqrt{2}$ is an irrational number.

-

Proof Construction:

-
    -
  1. Assume the contradiction setup: $\sqrt{2}$ is **not** irrational, meaning it is a **rational** number.
  2. -
  3. By definition of rational numbers, $\sqrt{2} = a / b$ where $a, b$ are integers, $b \neq 0$, and the fraction is written in **irreducible terms** (meaning $\text{gcd}(a, b) = 1$; they share no common factors).
  4. -
  5. Square both sides: $2 = a^2 / b^2 \implies a^2 = 2b^2$.
  6. -
  7. Since $a^2$ is a multiple of 2, $a^2$ must be an even integer. This implies that $a$ itself must be an even integer (as the square of an odd integer is always odd).
  8. -
  9. Since $a$ is even, we can write $a = 2k$ for some integer $k$.
  10. -
  11. Substitute $a$ back into the equation: $(2k)^2 = 2b^2 \implies 4k^2 = 2b^2 \implies b^2 = 2k^2$.
  12. -
  13. This implies that $b^2$ is an even integer, which means $b$ itself must also be an even integer.
  14. -
  15. If both $a$ and $b$ are even, they both share a common factor of 2. This directly contradicts our initial definition rule that $\text{gcd}(a,b) = 1$.
  16. -
  17. Because this assumption leads to a clear contradiction, our initial assumption ($\sqrt{2}$ is rational) must be false. Therefore, $\sqrt{2}$ is irrational. ∴ Q.E.D.
  18. +
    +

    Theorem Formulation: The root value is an irrational number.

    +

    Deductive Step Profile:

    +
      +
    1. Assume the contradiction configuration: The theorem is false, meaning is completely rational.
    2. +
    3. By structural definition of rational values, we must be able to express , where , , and the fraction is written strictly in **irreducible terms**. This means ; they share no common factor elements.
    4. +
    5. Perform algebraic squaring of both sides of the equation: .
    6. +
    7. Isolate terms: . This implies that is an even multiple of two.
    8. +
    9. By parity rules, if an integer square is even, the root base must be an even integer. Therefore, we can express for some .
    10. +
    11. Substitute this expression back into our step equation: .
    12. +
    13. Simplify by dividing both sides by two: . This implies that is also a clean multiple of two, meaning must be an even integer.
    14. +
    15. If both and are even integers, they both share a common factor of . This directly contradicts our initial prerequisite constraint that .
    16. +
    17. Because our starting assumption triggered a logical contradiction, the assumption is false. Thus, is irrational.
- {/* 6.4 Mathematical Induction */} -
-

IV. Mathematical Induction

-

- **Strategy:** To prove a predicate proposition $P(n)$ is true for all positive integers $n \ge 1$: -
- 1. **Base Case:** Prove the statement holds true for the smallest valid boundary element, typically $P(1)$. -
- 2. **Inductive Hypothesis:** Assume that the property holds true for an arbitrary step state $n = k$, meaning $P(k)$ is true. -
- 3. **Inductive Step:** Use this assumption to prove that the property must then hold true for the next step state $n = k + 1$, showing $P(k) \rightarrow P(k+1)$. + {/* 6.4 Induction */} +

+

Methodology IV: Complete Mathematical Induction

+

+ Strategy Rule: Used to prove a predicate statement holds completely across an infinite ordered set of positive integers . It operates via three sequential processing loops:

-
-

Theorem: Prove that the sum of the first $n$ positive integers is given by: $1 + 2 + 3 + \dots + n = \frac{n(n + 1)}{2}$.

-

Proof Construction:

-
    +
      +
    • Base Case Evaluation: Prove the formula works perfectly for the initial boundary item, usually .
    • +
    • Inductive Hypothesis Setup: Assume that the property holds true for an arbitrary step state , establishing as a valid true baseline.
    • +
    • Inductive Step Execution: Use the inductive hypothesis to prove that the statement must then hold true for the immediate next integer step , completing the implication chain .
    • +
    + +
    +

    Theorem Formulation: Prove that the cumulative summation of the first positive integers is always bounded by: .

    +

    Deductive Step Profile:

    +
    • - 1. Base Case (n = 1): + Step A: Base Case Check (n = 1)
      - Left-Hand Side (LHS) = $1$. + Left-Hand Side (LHS) = .
      - Right-Hand Side (RHS) = $\frac{1(1 + 1)}{2} = \frac{2}{2} = 1$. + Right-Hand Side (RHS) = .
      - Since LHS = RHS, $P(1)$ is true. + Since LHS = RHS, evaluates cleanly to True.
    • - 2. Inductive Hypothesis: + Step B: Inductive Hypothesis Setup
      - Assume that $P(k)$ is true for some arbitrary positive integer $k$. That is: + Assume that the statement holds completely true for an arbitrary integer . That is, we accept the following expression as a verified true premise:
      - $1 + 2 + 3 + \dots + k = \frac{k(k + 1)}{2}$. +
    • - 3. Inductive Step (Prove n = k + 1): -
      - We need to show that: $1 + 2 + 3 + \dots + k + (k + 1) = \frac{(k + 1)((k + 1) + 1)}{2} = \frac{(k + 1)(k + 2)}{2}$. -
      - Group the first $k$ terms on the left side: -
      - $\underline{(1 + 2 + 3 + \dots + k)} + (k + 1)$. -
      - Substitute the inductive hypothesis into the underlined part: -
      - $= \frac{k(k + 1)}{2} + (k + 1)$. + Step C: Inductive Step Evaluation (Prove n = k + 1)
      - Find a common denominator to add the terms: + We must show that the formula holds for the next step, which requires deriving:
      - $= \frac{k(k + 1) + 2(k + 1)}{2}$. + + Let us isolate the left-hand summation and group the first elements:
      - Factor out the common term $(k + 1)$ from the numerator: + + Substitute our assumed inductive hypothesis into the underlined component:
      - $= \frac{(k + 1)(k + 2)}{2}$. + + Find a common algebraic denominator to compute the fraction addition:
      - This matches the expected right-hand side expression for $P(k+1)$. + + Factor out the common polynomial term from the numerator:
      - Since both the base case and inductive step hold, the theorem is proven for all $n \in \mathbb{Z}^+$. ∴ Q.E.D. + + This matches our expected Right-Hand Side expression for . The implication chain is complete. Therefore, the theorem is verified for all positive integers .
-
+
{/* Summary */}
-

Summary

+

+ Chapter Summary +

- In this chapter, we explored the foundations of mathematical logic and proof design. We covered truth tables for propositional connectives, logical equivalences, predicate quantifiers, rules of inference, and formal proof strategies like direct proofs, contraposition, contradiction, and induction. These concepts are essential for formal reasoning in computer science and mathematics. + In this chapter, we explored mathematical logic and formal proofs. We constructed truth tables for foundational connectives, applied algebraic logical equivalences, analyzed domain variables under universal and existential quantifiers, and traced structural rules of inference. Finally, we executed formal proof systems across multiple templates—including direct proofs, structural contraposition, reduction by contradiction, and infinite steps of complete mathematical induction.

diff --git a/app/sem4/discrete/content/chapter2.tsx b/app/sem4/discrete/content/chapter2.tsx index b6308c8..d806932 100644 --- a/app/sem4/discrete/content/chapter2.tsx +++ b/app/sem4/discrete/content/chapter2.tsx @@ -1,3 +1,7 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + export function Ch2Content() { return (
@@ -16,21 +20,21 @@ export function Ch2Content() {

Subsets and Power Sets

    -
  • Subset ($A \subseteq B$): Set $A$ is a subset of set $B$ if and only if every element that belongs to $A$ also belongs to $B$. Formally: $\forall x (x \in A \rightarrow x \in B)$.
  • -
  • Proper Subset ($A \subset B$): Set $A$ is a proper subset of $B$ if $A \subseteq B$ and $A \neq B$. This implies $B$ contains at least one element not present in $A$.
  • -
  • Power Set ($\mathcal{P}(A)$): The power set of a set $A$ is the collection of all possible subsets of $A$, including the empty set ($\emptyset$) and the set $A$ itself.
  • +
  • Subset (): Set is a subset of set if and only if every element that belongs to also belongs to . Formally: .
  • +
  • Proper Subset (): Set is a proper subset of if and . This implies contains at least one element not present in .
  • +
  • Power Set (): The power set of a set is the collection of all possible subsets of , including the empty set () and the set itself.

💡 Power Set Cardinality Theorem:

-

If a finite set $A$ has $|A| = n$ elements, then its power set contains $|\mathcal{P}(A)| = 2^n$ elements.

+

If a finite set has elements, then its power set contains elements.

Example:

-

Let $A = \{1, 2\}$. Then $\mathcal{P}(A) = \{\emptyset, \{1\}, \{2\}, \{1, 2\}\}$. Here, $|A| = 2$ and $|\mathcal{P}(A)| = 2^2 = 4$.

+

Let . Then . Here, and .

Set Operators and Mathematical Definitions

- Let $U$ represent the universal set containing all possible elements under discussion. + Let represent the universal set containing all possible elements under discussion.

@@ -44,27 +48,27 @@ export function Ch2Content() { - + - + - + - + - + @@ -76,11 +80,11 @@ export function Ch2Content() { Set operations satisfy algebraic laws that parallel propositional logic equivalences.

    -
  • Commutative Laws: $A \cup B = B \cup A$ and $A \cap B = B \cap A$.
  • -
  • Associative Laws: $(A \cup B) \cup C = A \cup (B \cup C)$ and $(A \cap B) \cap C = A \cap (B \cap C)$.
  • -
  • Distributive Laws: $A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$ and $A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$.
  • -
  • De Morgan's Laws for Sets: $(A \cup B)' = A' \cap B'$ and $(A \cap B)' = A' \cup B'$.
  • -
  • Absorption Laws: $A \cup (A \cap B) = A$ and $A \cap (A \cup B) = A$.
  • +
  • Commutative Laws: and .
  • +
  • Associative Laws: and .
  • +
  • Distributive Laws: and .
  • +
  • De Morgan's Laws for Sets: and .
  • +
  • Absorption Laws: and .

Inclusion-Exclusion Principle Formulas

@@ -90,18 +94,18 @@ export function Ch2Content() {

1. Two-Set Formula:

-

|A ∪ B| = |A| + |B| − |A ∩ B|

+

2. Three-Set Formula:

-

|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|

+

⚠️ Critical Edge Case (Disjoint Sets):

- If sets $A$ and $B$ are **mutually exclusive / disjoint**, their intersection is empty: $A \cap B = \emptyset \implies |A \cap B| = 0$. In this scenario, the Inclusion-Exclusion formula simplifies directly into the Sum Rule: $|A \cup B| = |A| + |B|$. + If sets and are mutually exclusive / disjoint, their intersection is empty: . In this scenario, the Inclusion-Exclusion formula simplifies directly into the Sum Rule: .

@@ -112,12 +116,12 @@ export function Ch2Content() {

2. Binary Relations & Properties

- Given two sets $A$ and $B$, the Cartesian Product $A \times B$ is the set of all ordered pairs $(a, b)$ such that $a \in A$ and $b \in B$. A **Binary Relation** $R$ from $A$ to $B$ is structurally a subset of this product: $R \subseteq A \times B$. If $(a, b) \in R$, we write $aRb$. + Given two sets and , the Cartesian Product is the set of all ordered pairs such that and . A **Binary Relation** from to is structurally a subset of this product: . If , we write .

Classifications and Structural Types of Relations on a Set A

- A relation $R$ defined on a single set ($R \subseteq A \times A$) can possess specific properties across its coordinate matrix. + A relation defined on a single set () can possess specific properties across its coordinate matrix.

@@ -132,33 +136,49 @@ export function Ch2Content() {
- - + + - - + + - - + + - - - + + + - - + + - - + +
UnionA ∪ B {"{ x | x ∈ A ∨ x ∈ B }"}
IntersectionA ∩ B {"{ x | x ∈ A ∧ x ∈ B }"}
DifferenceA − B {"{ x | x ∈ A ∧ x ∉ B }"}
ComplementA' (or Ā) (or ) {"{ x | x ∈ U ∧ x ∉ A }"}
Symmetric DifferenceA Δ B {"{ x | x ∈ (A − B) ∨ x ∈ (B − A) }"}
Reflexive∀a ∈ A, (a, a) ∈ RThe relation "$\le$" on integers, since every number $a \le a$. + + + The relation "" on integers, since every number . +
Irreflexive∀a ∈ A, (a, a) ∉ RThe relation "$<$" on integers, since a number can never be strictly less than itself. + + + The relation "" on integers, since a number can never be strictly less than itself. +
Symmetric∀a, b ∈ A, (a, b) ∈ R → (b, a) ∈ R"Is a sibling of" relation across a human demographic set. + + + "Is a sibling of" relation across a human demographic set. +
Asymmetric∀a, b ∈ A, (a, b) ∈ R → (b, a) ∉ RThe relation "$<$". If $x < y$, it is impossible for $y < x$. Implies irreflexivity.
+ + + The relation "". If , it is impossible for . Implies irreflexivity. +
Anti-Symmetric∀a, b ∈ A, ((a, b) ∈ R ∧ (b, a) ∈ R) → a = bThe subset relation "$\subseteq$". If $A \subseteq B$ and $B \subseteq A$, then $A = B$.The subset relation "". If and , then .
Transitive∀a, b, c ∈ A, ((a, b) ∈ R ∧ (b, c) ∈ R) → (a, c) ∈ R"Divides" relation on integers. If $x|y$ and $y|z$, then $x|z$."Divides" relation on integers. If and , then .
@@ -169,34 +189,34 @@ export function Ch2Content() {

Students often confuse Asymmetric and Anti-Symmetric properties.
- - **Asymmetry** strictly prohibits any bidirectional pairings, meaning diagonal entries like $(a, a)$ can never belong to the relation. + - Asymmetry strictly prohibits any bidirectional pairings, meaning diagonal entries like can never belong to the relation.
- - **Anti-symmetry** permits diagonal elements $(a, a)$ to exist seamlessly, but guarantees that if an off-diagonal forward link $(a, b)$ exists, its reverse link $(b, a)$ is completely blocked. + - Anti-symmetry permits diagonal elements to exist seamlessly, but guarantees that if an off-diagonal forward link exists, its reverse link is completely blocked.

Equivalence Relations, Classes, and Partitions

- An Equivalence Relation is a relation on a set $A$ that satisfies three properties simultaneously: **Reflexive, Symmetric, and Transitive**. + An Equivalence Relation is a relation on a set that satisfies three properties simultaneously: Reflexive, Symmetric, and Transitive.

    -
  • Equivalence Class ($[a]$): Given an equivalence relation $R$ on a set $A$, the equivalence class of an element $a \in A$ is the set of all elements linked to $a$ via $R$. Formally: $[a] = \{ x \in A \mid aRx \}$.
  • -
  • Partition: A partition of a set $A$ is a grouping of $A$ into non-empty, mutually disjoint subsets (called blocks) such that their collective union reconstructs the entire set $A$.
  • +
  • Equivalence Class (): Given an equivalence relation on a set , the equivalence class of an element is the set of all elements linked to via . Formally: .
  • +
  • Partition: A partition of a set is a grouping of into non-empty, mutually disjoint subsets (called blocks) such that their collective union reconstructs the entire set .

The Fundamental Partition Theorem:

- Every equivalence relation on a set $A$ partitions $A$ into distinct, mutually disjoint equivalence classes. Conversely, any partition of a set $A$ naturally induces an equivalence relation on that set. + Every equivalence relation on a set partitions into distinct, mutually disjoint equivalence classes. Conversely, any partition of a set naturally induces an equivalence relation on that set.

Example: Modular Arithmetic (Congruence modulo 3 on integers)

-

Relation: a ≡ b (mod 3) ↔ 3 divides (a − b)

-

This partitions the infinite set of integers ($\mathbb{Z}$) into exactly three disjoint equivalence classes:

+

Relation: divides

+

This partitions the infinite set of integers () into exactly three disjoint equivalence classes:

- [0] = {'{ ..., -6, -3, 0, 3, 6, ... }'} (Remainder 0)
- [1] = {'{ ..., -5, -2, 1, 4, 7, ... }'} (Remainder 1)
- [2] = {'{ ..., -4, -1, 2, 5, 8, ... }'} (Remainder 2) + [0] = (Remainder 0)
+ [1] = (Remainder 1)
+ [2] = (Remainder 2)

@@ -213,8 +233,8 @@ export function Ch2Content() {

Partial Orders vs Total Orders

    -
  • Partial Order (Poset): A relation $R$ on a set $A$ is a partial ordering if it is **Reflexive, Anti-symmetric, and Transitive**. The set $A$ paired with this relation is called a Partially Ordered Set, denoted as $(A, \le)$. Elements $x, y$ are comparable if $x \le y$ or $y \le x$, otherwise they are incomparable.
  • -
  • Total Order (Linear Order): A partial order $(A, \le)$ is a total order if **every single pair** of elements in the set is comparable. Formally: $\forall a, b \in A (a \le b \vee b \le a)$. There are no incomparable components.
  • +
  • Partial Order (Poset): A relation on a set is a partial ordering if it is Reflexive, Anti-symmetric, and Transitive. The set paired with this relation is called a Partially Ordered Set, denoted as . Elements are comparable if or , otherwise they are incomparable.
  • +
  • Total Order (Linear Order): A partial order is a total order if every single pair of elements in the set is comparable. Formally: . There are no incomparable components.

Hasse Diagram Construction Rules

@@ -222,9 +242,9 @@ export function Ch2Content() { A Hasse diagram is a simplified visual representation of a finite partial order. It is drawn using the following optimization constraints:

    -
  1. If $a \le b$, vertex $b$ is placed physically higher on the plane page view than vertex $a$.
  2. -
  3. A directional line is drawn between $a$ and $b$ if and only if $a$ is immediately covered by $b$ (meaning $a \le b$ and there is no intermediate element $c$ such that $a \le c \le b$).
  4. -
  5. All reflexive self-loops $(a, a)$ are omitted since reflexivity is implied for every element.
  6. +
  7. If , vertex is placed physically higher on the plane page view than vertex .
  8. +
  9. A directional line is drawn between and if and only if is immediately covered by (meaning and there is no intermediate element such that ).
  10. +
  11. All reflexive self-loops are omitted since reflexivity is implied for every element.
  12. All transitive directional lines are omitted since transitivity can be inferred by tracing connected paths upward.
@@ -236,7 +256,7 @@ export function Ch2Content() {
-
1. Partial Order Hasse Diagram
(Divisibility on set {"{1, 2, 3, 6}"})
+
1. Partial Order Hasse Diagram
(Divisibility on set )
[6]
@@ -258,7 +278,7 @@ export function Ch2Content() {
-
2. Total Order Chain Diagram
(Standard "less than or equal to" on {"{1, 2, 3}"})
+
2. Total Order Chain Diagram
(Standard "less than or equal to" on )
[3]
|
@@ -280,7 +300,7 @@ export function Ch2Content() {

4. Functions, Structural Types, and Inverses

- A Function $f$ from set $A$ to set $B$ (denoted $f: A \rightarrow B$) is a special type of relation that maps each element $a$ in the domain set $A$ to **exactly one** element $b$ in the codomain set $B$. We write $f(a) = b$. + A Function from set to set (denoted ) is a special type of relation that maps each element in the domain set to **exactly one** element in the codomain set . We write .

Classifications and Structural Types of Functions

@@ -364,39 +384,39 @@ export function Ch2Content() {
    -
  • Injection (One-to-One): $f$ is injective if distinct inputs always map to distinct outputs. Formally: $\forall x, y \in A (f(x) = f(y) \rightarrow x = y)$.
  • -
  • Surjection (Onto): $f$ is surjective if the range equals the codomain. Every element in $B$ has at least one preimage in $A$. Formally: $\forall b \in B, \exists a \in A \text{ such that } f(a) = b$.
  • +
  • Injection (One-to-One): is injective if distinct inputs always map to distinct outputs. Formally: .
  • +
  • Surjection (Onto): is surjective if the range equals the codomain. Every element in has at least one preimage in . Formally: .
  • Bijection: A function that is simultaneously injective and surjective. It represents a perfect matching layout between sets.

Composition of Functions & Algebraic Properties

- Given functions $f: A \rightarrow B$ and $g: B \rightarrow C$, the **Composition Function** $(g \circ f): A \rightarrow C$ is defined as: + Given functions and , the **Composition Function** is defined as:
- (g \circ f)(a) = g(f(a)) +

Properties of Function Composition:

    -
  • Associativity: If $f: A \rightarrow B$, $g: B \rightarrow C$, and $h: C \rightarrow D$, composition is associative: $h \circ (g \circ f) = (h \circ g) \circ f$.
  • -
  • Non-Commutativity: Function composition is generally **not** commutative: $g \circ f \neq f \circ g$. Order of evaluation matters.
  • -
  • Preservation: If both $f$ and $g$ are injections, then $(g \circ f)$ is an injection. If both $f$ and $g$ are surjections, then $(g \circ f)$ is a surjection.
  • +
  • Associativity: If , , and , composition is associative: .
  • +
  • Non-Commutativity: Function composition is generally **not** commutative: . Order of evaluation matters.
  • +
  • Preservation: If both and are injections, then is an injection. If both and are surjections, then is a surjection.

Inverse of a Function

- If $f: A \rightarrow B$ is a bijection, its **Inverse Function** $f^{-1}: B \rightarrow A$ maps each element in $B$ back to its unique preimage in $A$. Formally: + If is a bijection, its **Inverse Function** maps each element in back to its unique preimage in . Formally:
- f^{-1}(b) = a \iff f(a) = b +

⚠️ Critical Existence Constraint Rule:

- The inverse function $f^{-1}$ **only exists** if the original function $f$ is a strict **Bijection**. + The inverse function only exists if the original function is a strict Bijection.
- - If $f$ is not injective, multiple elements in $A$ map to the same $b$, making $f^{-1}(b)$ ambiguous (violating function definition rules). + - If is not injective, multiple elements in map to the same , making ambiguous (violating function definition rules).
- - If $f$ is not surjective, some elements in $B$ are unmapped, meaning $f^{-1}(b)$ would be undefined for those elements. + - If is not surjective, some elements in are unmapped, meaning would be undefined for those elements.

diff --git a/app/sem4/discrete/content/chapter3.tsx b/app/sem4/discrete/content/chapter3.tsx index 4b06714..2b711db 100644 --- a/app/sem4/discrete/content/chapter3.tsx +++ b/app/sem4/discrete/content/chapter3.tsx @@ -1,8 +1,12 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + export function Ch3Content() { return (

- This chapter covers three core fields of discrete mathematics: Combinatorics (the science of counting and configurations), Number Theory (the study of integers, divisibility, and modular equations), and Recurrence Relations (the mathematical framework used to evaluate recursive functions and algorithmic complexity bounds). + Welcome to the comprehensive module on Combinatorics, Number Theory, and Recurrence Relations. These structural topics provide the computational machinery for calculating algorithmic complexity thresholds, analyzing cryptographic keyspaces, and implementing secure numeric communications.


@@ -11,44 +15,53 @@ export function Ch3Content() {

1. Advanced Combinatorics & Basic Probability

- Combinatorics provides the structural tools needed to calculate configuration bounds without explicitly enumerating every possible outcome. + Combinatorics provides the foundational counting mechanics required to measure sample space boundaries without the exhaustive physical enumeration of states.

-

Fundamental Counting Rules

+

Fundamental Counting Rules

    -
  • The Sum Rule: If a task can be performed in $m$ ways, and a second independent task can be performed in $n$ ways, then performing **either** the first task **or** the second task can be accomplished in $m + n$ ways.
  • -
  • The Product Rule: If a procedure can be broken down into two successive stages where stage one has $m$ outcomes and stage two has $n$ outcomes, the complete sequence of tasks can be done in $m \times n$ ways.
  • +
  • + The Sum Rule: Asserts that if a choice can be performed in independent ways, and a choice can be performed in independent ways, then executing either task or task can be completed in exactly structural ways. +
  • +
  • + The Product Rule: Asserts that if a strategic procedure is broken down into two sequential, dependent processing stages where stage one yields distinct outcomes, and stage two yields unique outcomes, the total combined procedure can be executed in exactly ways. +
-

Basic Probability & Inclusion-Exclusion for Probability

+

Basic Probability & Inclusion-Exclusion for Probability

- The **Probability** of an event $E$ within a finite, equally likely sample space $S$ is defined as $P(E) = |E| / |S|$. - When dealing with compound events that are not mutually exclusive, the **Principle of Inclusion-Exclusion for Probability** ensures shared outcomes are not double-counted: + The classical Probability of a discrete event within a finite, uniform sample space is mathematically defined as the ratio: . + When managing compound event tracks that maintain intersection points, the Principle of Inclusion-Exclusion for Probability (PIE) eliminates double-counting errors across non-disjoint domains:

-
- P(A ∪ B) = P(A) + P(B) − P(A ∩ B) -
- - For three events: P(A ∪ B ∪ C) = P(A) + P(B) + P(C) − P(A ∩ B) − P(A ∩ C) − P(B ∩ C) + P(A ∩ B ∩ C) - +
+ +

+ Expansion layout for three overlapping spaces: +

+
-

The Pigeonhole Principle & Applications

+

The Pigeonhole Principle & Bounded Applications

    -
  • Basic Principle: If $k + 1$ or more pigeons are placed into $k$ holes, then at least one hole must contain two or more pigeons.
  • -
  • Generalized Pigeonhole Principle: If $N$ objects are placed into $k$ boxes, then at least one box must contain at least $\lceil N / k \rceil$ objects (where $\lceil \dots \rceil$ denotes the ceiling function).
  • +
  • + Basic Structural Assertion: If or more item elements are mapped into exactly distinct space boxes, then at least one target box is guaranteed to contain two or more elements. +
  • +
  • + Generalized Pigeonhole Theorem: If discrete objects are distributed into exactly boxes, then at least one box must contain a minimum of items, where the ceiling function rounds up to the closest integer boundary. +
+
-

Concrete Application Examples & Edge Cases:

-

- 1. **Card Deck Edge Case:** How many cards must be drawn from a standard 52-card deck to guarantee that at least three cards of the same suit are chosen? +

Concrete Deep-Dive Application Profiles:

+

+ 1. Card Set Extremum Check: What is the absolute minimum number of cards that must be extracted from a shuffled 52-card standard deck to guarantee that at least three cards share an identical suit?
- - Holes (k) = 4 suits. We want ⌈N / 4⌉ = 3. The worst-case scenario before achieving this is drawing 2 cards of each suit (2 × 4 = 8 cards). The next drawn card (the 9th card) guarantees a triplet. Thus, N = 9. + + Domain Boxes suits. We require: . To isolate the critical boundary threshold, find the absolute worst-case scenario before matching (drawing exactly 2 cards for each of the 4 suits: cards). The next single card drawn () breaks the layout symmetry, guaranteeing a triplet. Thus, .

-

- 2. **Birthday Match:** In any group of 367 people, at least two individuals must share a birthday, because there are at most 366 possible birthdays (including leap years). +

+ 2. Birthday Invariant: Within any arbitrary group containing a minimum of people, at least two individuals are mathematically guaranteed to share a matching calendar birthday, because the absolute maximal bounds of unique birthdays in a leap year is .

@@ -59,67 +72,72 @@ export function Ch3Content() {

2. Number Theory & Linear Diophantine Equations

- Number theory forms the mathematical core of modern cryptography and data hashing systems. + Number Theory analyzes the properties of integers, providing the algebraic structures used to construct modern public-key encryption schemes.

-

GCD, LCM, and Their Fundamental Relationship

+

GCD, LCM, and Fundamental Parity Relations

- The Greatest Common Divisor ($\text{gcd}(a, b)$) is the largest positive integer that divides both $a$ and $b$. The Least Common Multiple ($\text{lcm}(a, b)$) is the smallest positive integer that is a multiple of both $a$ and $b$. Their core relationship is defined by the following theorem: + The Greatest Common Divisor () is the maximal positive integer that divides both and cleanly. The Least Common Multiple () is the minimal positive integer that is a multiple of both inputs. For any two non-zero integers, their products map directly to their shared divisor fields:

- gcd(a, b) × lcm(a, b) = |a × b| +
-

Bézout's Identity & The Extended Euclidean Algorithm

+

Bézout's Identity & The Extended Euclidean Algorithm

- Bézout's Identity: For any non-zero integers $a$ and $b$, there exist integers $x$ and $y$ such that: + Bézout's Identity Statement: For any non-zero integer parameters and , there exist unique integer linear coefficients and that satisfy the equation:
- ax + by = gcd(a, b) - The coefficients $x$ and $y$ are computed efficiently using the **Extended Euclidean Algorithm**, which tracks the quotient steps of divisibility in reverse. + + These structural coefficients are derived computationally by operating the Extended Euclidean Algorithm, tracking the forward quotient remainders down to the zero state and substituting the evaluations back in reverse order.

-

Step-by-Step Example: Compute gcd(252, 198) and express it as ax + by

-
-

Step 1: Forward Euclidean Algorithm (Find GCD)

-

252 = 1 × 198 + 54 (Remainder = 54)

-

198 = 3 × 54 + 36 (Remainder = 36)

-

54 = 1 × 36 + 18 (Remainder = 18) ← Last non-zero remainder is the GCD

-

36 = 2 × 18 + 0 (Remainder = 0)

-

Thus, gcd(252, 198) = 18.

+

Step-by-Step Computational Tracing: Extract and calculate coefficients and

+
+

Stage 1: Forward Euclidean Divisions (Isolating the GCD Matrix)

+

     (Remainder )

+

      (Remainder )

+

       (Remainder ← Last non-zero remainder matches the GCD)

+

        (Remainder )

+

Resulting Divisor: .

-

Step 2: Back-Substitution (Find Bézout Coefficients x and y)

-

From the last non-zero equation: 18 = 54 − 1 × 36

-

Substitute 36 from the equation above it (36 = 198 − 3 × 54):

-

18 = 54 − 1 × (198 − 3 × 54) = 4 × 54 − 1 × 198

-

Substitute 54 from the first equation (54 = 252 − 1 × 198):

-

18 = 4 × (252 − 1 × 198) − 1 × 198

-

18 = 4 × (252) − 5 × (198)

-

Therefore, the Bézout coefficients are x = 4 and y = -5.

+

Stage 2: Structural Backward Substitutions (Resolving Bézout Targets)

+

Isolate the remainder from the step above the zero state:

+

Substitute from the second-stage equation ():

+

+

Substitute from the first-stage equation ():

+

+

+

Resulting Identity Coefficients: and .

-

Linear Diophantine Equations

+

Linear Diophantine Equations

- A **Linear Diophantine Equation** is an equation of the form $ax + by = c$, where $a, b, c$ are given integers, and we solve only for integer values of $x$ and $y$. + A Linear Diophantine Equation is an algebraic expression of the form: , where the coefficients are fixed integers, and solutions are strictly restricted to integer elements for and .

-
⚠️ Solvability Existence Theorem & General Solution:
+
⚠️ Solvability Constraints & Infinite Solution Sets:

- The Diophantine equation $ax + by = c$ has an integer solution if and only if **$\text{gcd}(a, b)$ divides $c$** ($gcd(a,b) \mid c$). If this condition is met and an initial particular solution $(x_0, y_0)$ is found, the infinite set of all solutions is given by: + An integer mapping for exists if and only if the greatest common divisor divides perfectly (). If this condition is satisfied and an initial particular baseline solution is calculated, the complete infinite set of solutions is generated by tracking parametric adjustments:

-

- x = x_0 + t × (b / d),      y = y_0 − t × (a / d) +

+ +
+

+ Where the variable divisor parameter matches and iterates over all integers ().

-

Where $d = \text{gcd}(a, b)$ and $t$ is any arbitrary integer ($t \in \mathbb{Z}$).

-

The Chinese Remainder Theorem (CRT)

+

The Chinese Remainder Theorem (CRT)

- Let $m_1, m_2, \dots, m_n$ be pairwise coprime positive integers ($\text{gcd}(m_i, m_j) = 1$ for $i \neq j$). Then, the following system of simultaneous modular congruence relations has a unique solution modulo $M = m_1 \times m_2 \times \dots \times m_n$: + Let be a set of positive integers that are pairwise coprime ( for all index steps ). Then, the following simultaneous system of modular congruence relations is guaranteed to possess a unique solution modulo the global cumulative product :

-
- x ≡ a_1 (mod m_1),    x ≡ a_2 (mod m_2),    \dots,    x ≡ a_n (mod m_n) +
+ + +

+
@@ -129,156 +147,169 @@ export function Ch3Content() {

3. Recurrence Relations & Resolution Methods

- A Recurrence Relation defines a mathematical sequence where individual terms $a_n$ are expressed as a function of one or more of their preceding terms. + A Recurrence Relation defines an infinite sequence where a term is expressed as a mathematical function of its preceding history steps (e.g., the Fibonacci sequence ).

-

Structural Classifications

+

Structural Classifications

    -
  • Linear Homogeneous: Terms depend linearly on past elements with no trailing isolated constants or functions of $n$. Example: $a_n = c_1a_{n-1} + c_2a_{n-2}$.
  • -
  • Linear Non-Homogeneous: Contains an added trailing function component $F(n)$ not tied to sequence terms. Example: $a_n = c_1a_{n-1} + F(n)$.
  • +
  • + Linear Homogeneous: Every term is a first-degree linear function of past elements with no isolated scalar offsets or functions of . Example structure: . +
  • +
  • + Linear Non-Homogeneous: Contains an added isolated forcing function block . Example structure: . +
{/* METHOD 1 */} -

Method I: Repeated Substitution (Iterative Method)

+

Method I: Repeated Substitution (Iterative Gating Method)

- This strategy involves repeatedly expanding the recursive term until a clear algebraic pattern emerges as a function of $n$ and the base cases. + This strategy operates by sequentially expanding the recursive terms back to base conditions until an algebraic pattern emerges as a explicit closed function of the index parameter .

-

Example: Solve $a_n = a_{n-1} + 3$ with base case $a_0 = 2$.

-
-

a_n = a_{n-1} + 3

-

Substitute $a_{n-1} = a_{n-2} + 3$ into the equation:

-

a_n = (a_{n-2} + 3) + 3 = a_{n-2} + 2(3)

-

Substitute $a_{n-2} = a_{n-3} + 3$ into the equation:

-

a_n = (a_{n-3} + 3) + 2(3) = a_{n-3} + 3(3)

-

Following this pattern down to the $n$-th iteration step:

-

a_n = a_{n-n} + n(3) = a_0 + 3n

-

Substitute the base case value $a_0 = 2$:

-

a_n = 2 + 3n

+

Pattern Tracing Example: Solve subject to the base condition .

+
+

+

Substitute the definition for into the main chain expression:

+

+

Substitute the definition for into the main chain expression:

+

+

Projecting this substitution tracking down to the -th complete iteration level:

+

+

Inject the localized static boundary value :

+

+ Closed-Form Evaluation: +

{/* METHOD 2 */} -

Method II: The Characteristic Root Method

+

Method II: The Characteristic Root Framework

- Used to solve linear homogeneous relations by converting them into equivalent polynomial equations. + Transforms linear constant-coefficient recurrence relations into classic algebraic polynomials to isolate structural roots.

-
1. Second-Order Homogeneous Relations
+
1. Second-Order Homogeneous Systems

- For the relation $a_n + c_1a_{n-1} + c_2a_{n-2} = 0$, construct the **Characteristic Equation**: $r^2 + c_1r + c_2 = 0$. + Given the second-order expression , map the terms directly to a Characteristic Polynomial Equation: .

- +
- - + + - + - - + + - - + +
Root ConditionExplicit Solution Formula Structure ($a_n$)Polynomial Root ConditionExplicit General Solution Formula Layout ()
Distinct Real Roots ($r_1 \neq r_2$)a_n = α_1(r_1)^n + α_2(r_2)^nDistinct Roots ()
Repeated Real Roots ($r_1 = r_2 = r$)a_n = (α_1 + α_2 n)(r)^nRepeated Roots ()
-

Concrete Example (Distinct Roots): Solve $a_n = 5a_{n-1} − 6a_{n-2}$ given $a_0 = 1, a_1 = 5$.

-
-

1. Rewrite equation: a_n − 5a_{n-1} + 6a_{n-2} = 0

-

2. Form characteristic polynomial: r² − 5r + 6 = 0

-

3. Factor equation: (r − 2)(r − 3) = 0 → Roots are r₁ = 2, r₂ = 3

-

4. State general structure: a_n = α_1(2)^n + α_2(3)^n

-

5. Substitute base cases to solve for coefficients:

-

   For n = 0: α_1 + α_2 = 1

-

   For n = 1: 2α_1 + 3α_2 = 5

-

6. Solving this system gives α_1 = -2 and α_2 = 3.

-

Final Solution: a_n = −2(2)^n + 3(3)^n = −2^{n+1} + 3^{n+1}

+

Distinct Roots Execution: Solve given .

+
+

1. Transpose terms to homogeneous form:

+

2. Set up characteristic polynomial structure:

+

3. Factor to isolate characteristic roots:

+

4. Instantiate general algebraic formula:

+

5. Apply base constraints to build simultaneous coefficients systems:

+

   For index :

+

   For index :

+

6. Resolving this linear layout matrix yields values: and .

+

+ Final Explicit Solution: +

-
2. Higher-Order Homogeneous Relations
+
2. Higher-Order Homogeneous Systems

- If the characteristic equation has a root $r$ repeated $m$ times, the terms corresponding to this root in the general solution have the form: -
- (\alpha_0 + \alpha_1 n + \alpha_2 n^2 + \dots + \alpha_{m-1} n^{m-1})r^n + When scaling up to higher-order systems, if a polynomial characteristic root exhibits an algebraic multiplicity factor of (repeated times), its unique block mapping within the general solution framework expands as a polynomial scalar chain:

+
+ +
-
3. Non-Homogeneous Relations with Constant Coefficients
+
3. Non-Homogeneous Adjustments with Constant Coefficients

- The complete general solution to $a_n + c_1a_{n-1} + c_2a_{n-2} = F(n)$ is a combination of two parts: + The comprehensive structural evaluation for an active non-homogeneous line expression is achieved by combining two distinct sub-solutions:
- a_n = a_n^{(h)} + a_n^{(p)} - Where $a_n^{(h)}$ is the homogeneous solution matching $F(n)=0$, and $a_n^{(p)}$ is the **particular solution** chosen to match the functional format of $F(n)$. + + Where represents the baseline solution of the matching homogeneous setup (), and is a targeted particular solution shaped explicitly to reflect the structural format of the forcing function .

- - + + - - + + - - + + - - + +
Trailing Function Form $F(n)$Assumed Particular Solution Form $a_n^{(p)}$Forcing Function Profile Assumed Particular Solution Format
Linear Polynomial (c . n + d)A . n + BLinear Polynomial ()
Exponential (c . s^n)A . s^n    (if s is not a homogeneous root)Pure Exponential ()    (valid if does not clash with homogeneous roots)
⚠️ Critical Clash CaseA . n^m . s^n    (if s is a homogeneous root of multiplicity m)⚠️ Homogeneous Root Clash Case    (where indicates the root multiplicity value)
{/* METHOD 3 */} -

Method III: Generating Functions

+

Method III: Generating Functions

- A **Generating Function** $G(x)$ translates an infinite discrete sequence $(a_0, a_1, a_2, \dots)$ into the formal coefficients of a continuous power series expansion: -
- G(x) = \sum_{n=0}^{\infty} a_n x^n = a_0 + a_1 x + a_2 x^2 + a_3 x^3 + \dots + A Generating Function maps an infinite discrete structural sequence directly into the formal linear coefficients of a continuous power series parameter layout:

+
+ +
-
The Extended Binomial Theorem
+
The Extended Binomial Theorem

- To extract sequence terms from algebraic fractional generating functions, use the **Extended Binomial Theorem** for negative integer powers: + To convert complex fractional generating equations back into discrete sequences, expansions invoke the Extended Binomial Theorem configured for negative integer exponents:

-
- (1 − x)^{-n} = \sum_{r=0}^{\infty} \binom{n + r − 1}{r} x^r -
- - Expanding explicitly: (1 − x)^{-1} = 1 + x + x^2 + x^3 + \dots    and    (1 − x)^{-2} = 1 + 2x + 3x^2 + 4x^3 + \dots - +
+ +

+ Standard Explicit Reference Mappings: +

+
+

+

+
-

Step-by-Step Example: Solve $a_n = 2a_{n-1}$ with $a_0 = 3$ using Generating Functions.

-
-

1. Multiply the relation by x^n and sum over all n ≥ 1:

-

   \sum_{n=1}^{\infty} a_n x^n = \sum_{n=1}^{\infty} 2a_{n-1} x^n

-

2. Express the terms in relation to the generating function G(x) = \sum_{n=0}^{\infty} a_n x^n:

-

   Left side: G(x) − a_0

-

   Right side: 2x \sum_{n=1}^{\infty} a_{n-1} x^{n-1} = 2x G(x)

-

3. Substitute these components back into the equation:

-

   G(x) − a_0 = 2x G(x)

-

4. Substitute the base case a_0 = 3 and isolate G(x):

-

   G(x) − 3 = 2x G(x) → G(x)(1 − 2x) = 3 → G(x) = \frac{3}{1 − 2x}

-

5. Apply the geometric series expansion structure (\frac{1}{1-u} = \sum u^n):

-

   G(x) = 3 \sum_{n=0}^{\infty} (2x)^n = \sum_{n=0}^{\infty} [3 \cdot 2^n] x^n

-

6. Extract the coefficient of x^n to find the closed-form equation:

-

Final Solution: a_n = 3 \cdot 2^n

+

Generating Function Tracing: Solve given .

+
+

1. Scale the relation by and run a summation over all items :

+

   

+

2. Substitute definitions to map this summation line directly back to structures:

+

   Left side mapping:

+

   Right side mapping:

+

3. Merge the sub-equations back into unified structural terms:

+

   

+

4. Factor in the explicit boundary condition and solve to isolate :

+

   

+

5. Invoke geometric convergence properties ():

+

   

+

6. Extract the unique tracking coefficient of to resolve the closed sequence function:

+

Final Solution Sequence:

@@ -289,9 +320,9 @@ export function Ch3Content() {

Summary

- In this chapter, we studied combinatorics, number theory, and recurrence relations. We analyzed basic counting, probability rules, and the Pigeonhole Principle. Next, we explored integer divisibility using Bézout's identity, the Extended Euclidean Algorithm, and Diophantine systems. Finally, we solved linear homogeneous and non-homogeneous recurrence relations using repeated substitution, characteristic roots, and generating functions combined with the Extended Binomial Theorem. + In this module, we evaluated advanced combinatorics counting logic, probability distributions, and bounding metrics governed by the Pigeonhole Principle. We analyzed structural number theory foundations using Bézout's linear coefficient identity and systems of simultaneous congruence parameters solved via the Chinese Remainder Theorem. Finally, we isolated closed expressions for recursive configurations, utilizing repeated substitution tracking matrices, polynomial root structures, and infinite formal generating power series functions.

- ); + ) } \ No newline at end of file diff --git a/app/sem4/discrete/content/chapter4.tsx b/app/sem4/discrete/content/chapter4.tsx index 80d8ae5..0a54b49 100644 --- a/app/sem4/discrete/content/chapter4.tsx +++ b/app/sem4/discrete/content/chapter4.tsx @@ -1,11 +1,13 @@ -import React from "react"; +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" export function Ch4Content() { return (
{/* Introduction */}

- Graph Theory is the study of discrete mathematical structures consisting of objects and the pairwise relationships between them. Graphs serve as an abstract framework for modeling and analyzing complex networks, including data communication routes, social networks, neural connection structures, and computational dependencies. + Welcome to the extensive module on Graph Theory. In computational engineering, graphs are the definitive structural abstraction used to model non-linear relational datasets. Whether representing network topologies, mapping memory pointer dependencies during data flow analysis, or computing optimized routes for packet data, graph theory provides the formal discrete axioms required to scale networked software systems safely.


@@ -16,128 +18,82 @@ export function Ch4Content() { 1. Graph Fundamentals & Structural Parameters

- Formally, a simple graph is defined as an ordered pair $G = (V, E)$, where $V$ represents a non-empty set of **vertices** (or nodes) and $E$ represents a set of **edges** (or links) that connect unordered pairs of distinct vertices. + Formally, a Simple Graph is defined as an ordered pair , where represents a non-empty set of objects called vertices (or nodes) and represents a set of unordered pairs of distinct vertices called edges (or links).

  • - Order of a Graph, $|V|$: The absolute number of vertices present in the graph. + Order of a Graph (): The absolute total number of vertices present in the network topology.
  • - Size of a Graph, $|E|$: The absolute number of edges present in the graph. + Size of a Graph (): The absolute total number of edges present connecting the nodes.
  • - Degree of a Vertex, $\text{deg}(v)$: The number of edges incident to the vertex $v$. For loops, each loop contributes exactly 2 to the vertex's total degree. + Degree of a Vertex (): The number of edges incident upon node . +
    + Edge Case Exception: For multigraphs containing loops, each individual self-loop contributes exactly to that vertex's total degree counter.
  • - Isolated Vertex: A vertex with a degree equal to 0 ($\text{deg}(v) = 0$). + Isolated Vertex: A node containing a degree configuration equal to zero (). It has no incident links.
  • - Pendant Vertex: A vertex with a degree equal to 1 ($\text{deg}(v) = 1$). + Pendant Vertex: A node containing a degree configuration strictly equal to one ().
- The Handshaking Lemma (Fundamental Theorem of Graph Theory) + The Handshaking Lemma (Fundamental Invariant Theorem of Graph Theory)

- For any undirected graph, the sum of the degrees of all its vertices is exactly twice the total number of its edges: + For any undirected graph structure, the cumulative sum of the vertex degrees is always exactly equal to twice the total number of edges:

- \sum_{v \in V} \text{deg}(v) = 2|E| +

- ⚠️ Critical Corollary: Every undirected graph must contain an even number of vertices that have an odd degree. This constraint makes it impossible to design a graph where, for example, exactly 7 vertices each have a degree of 3. + ⚠️ Critical Systems Corollary: Every undirected graph must contain an even number of vertices that possess an odd degree profile. This structural constraint implies that it is mathematically impossible to construct a network layout consisting of, for example, exactly vertices where each node has a degree of (since , which is odd).


- {/* 2. Graph Connectivity Definitions */} + {/* 2. Classifications and Structural Varieties of Graphs */}

- 2. Graph Connectivity: Walks, Trails, Paths, and Cycles + 2. Structural Classifications & Varieties of Graphs

- Tracing structural traversal routes through a graph requires distinct mathematical classifications based on element repetition restrictions: + Graphs are categorized into distinct structural classes depending on directional properties, weight settings, and localized boundary connectivity traits:

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TermCore Definitional ConditionRepetition Constraints
WalkAn alternating sequence of vertices and edges.Both vertices and edges can be repeated infinitely.
TrailA walk with no repeated edges.Edges must be unique. Vertices can be repeated.
PathA walk with no repeated vertices.Vertices must be strictly unique (which guarantees edges are unique).
CircuitA closed trail that starts and ends at the same vertex.No edges can be repeated. Vertices can be repeated.
CycleA closed path where the start and end vertices are identical.No vertices or edges can be repeated, except the terminal matching pair.
-
-
- -
- - {/* 3. Types of Graphs */} -
-

- 3. Classifications and Structural Varieties of Graphs -

-

Undirected vs. Directed Graphs (Digraphs)

- In an undirected graph, edges are symmetric unordered pairs $\{u, v\}$. In a digraph, edges are ordered pairs $(u, v)$, establishing a one-way directional vector from a source vertex $u$ to a target vertex $v$. Digraph vertices track split degree configurations: In-degree ($\text{deg}^-(v)$, incoming paths) and Out-degree ($\text{deg}^+(v)$, outgoing paths). + In an undirected layout, edges are symmetric unordered pairs . In a Digraph, edges are ordered pairs , establishing an asymmetric directional vector from a source vertex to a target vertex . Digraph vertices track isolated split degree states: In-degree (, counting incoming vectors) and Out-degree (, counting outgoing vectors).

-

Complete Graphs ($K_n$)

+

Complete Graphs ()

- A simple graph where an edge connects every pair of distinct vertices. A complete graph with $n$ vertices is denoted as $K_n$ and contains exactly $n(n-1)/2$ edges. Every vertex in $K_n$ has a uniform, regular degree equal to $n-1$. + A simple undirected graph where every single distinct pair of vertices is connected by a unique edge. A complete graph configured with nodes is designated as and contains precisely total edges. Every single vertex within has a uniform, regular degree matching .

Weighted Graphs

- A graph layout where each edge $e$ is assigned a real number value $w(e)$, representing a specific cost, distance, capacity, or latency metric. These configurations are used in shortest-path computations. + A graph configuration where each edge is explicitly assigned a real numbers scalar value , representing physical cost, network traversal distance, maximum capacity limits, or line latency. These matrices form the foundation for shortest-path calculation algorithms.

-

Bipartite Graphs ($K_{m,n}$)

+

Bipartite Graphs ()

- A graph whose vertex set $V$ can be partitioned into two disjoint subsets $V_1$ and $V_2$ such that every edge connects a vertex in $V_1$ to a vertex in $V_2$. No edges can connect vertices within the same subset. A complete bipartite graph is denoted as $K_{m,n}$. + A graph whose primary vertex set can be divided cleanly into two separate, mutually disjoint subsets and such that every single edge in connects a node from directly to a node in . No internal links can connect nodes within the same subset. A complete bipartite graph is designated as .

@@ -145,142 +101,304 @@ export function Ch4Content() {
+ {/* 3. Graph Operations: Joins, Cartesian Products, Subgraphs, and Subtrees */} +
+

+ 3. Graph Operations: Subgraphs, Subtrees, Joins, and Cartesian Products +

+

+ Complex system models can be dissected into structural sub-components or synthesized using standard binary algebraic operations on graph inputs: +

+ +
    +
  • + Subgraph: A graph is classified as a subgraph of if and such that every edge in has its terminal endpoints contained entirely within the modified vertex set . +
  • +
  • + Subtree: A specialized subgraph of a main interconnected tree structure that itself complies with all baseline tree properties—meaning it must remain completely connected and contain absolutely no internal cycles. +
  • +
  • + Graph Join (): Given two disjoint graphs and , the join operation produces a combined graph containing the total vertex set . Its edge set contains all original paths augmented with unique new links connecting every single vertex belonging to to every single vertex belonging to . +
  • +
  • + Cartesian Product (): A product synthesis layout where the new vertex set corresponds to the standard Cartesian product of sets . Two coordinate nodes and are adjacent in the output graph if and only if: +
    + - and node is adjacent to within the internal structure of , OR +
    + - and node is adjacent to within the internal structure of . +
    + This specific operation generates hypercubes and mesh grid structures used in parallel computing arrays. +
  • +
+
+ +
+ {/* 4. Graph Representations */}

4. Algebraic and Computational Graph Representations

- To process graph layouts computationally, topologies are converted into equivalent algebraic matrices or structural lists. Let $G=(V,E)$ be a graph with vertices labeled $v_1, v_2, \dots, v_n$: + To process graph layouts computationally, topologies are converted into equivalent algebraic matrices or structural arrays. Let be an undirected simple graph where vertices are indexed as :

  • - Adjacency Matrix ($A$): A square $n \times n$ matrix where entry $a_{ij} = 1$ if an edge exists between vertex $v_i$ and vertex $v_j$, and $a_{ij} = 0$ otherwise. For undirected simple graphs, this matrix is symmetric along the main diagonal ($A = A^T$) with zeros tracking down the diagonal. + Adjacency Matrix (): A square matrix where matrix entry if a valid edge connects vertex and vertex , and otherwise. For simple undirected systems, this matrix is perfectly symmetric along the main diagonal () with zeros tracking down the primary diagonal axis.
  • - Incidence Matrix ($M$): An $n \times m$ matrix (where $m = |E|$) matching vertices against edges. Entry $m_{ij} = 1$ if vertex $v_i$ is an endpoint of edge $e_j$, and $m_{ij} = 0$ otherwise. Each column in an undirected incidence matrix contains exactly two 1s. + Incidence Matrix (): An asymmetric matrix (where matches total edge size) aligning vertices against edge identifiers. Entry if vertex acts as a terminal endpoint for edge link , and otherwise. Each single column within an undirected incidence matrix contains exactly two entries.
  • - Adjacency List: An array of linked lists or dynamic arrays, where each index $i$ corresponds to vertex $v_i$ and contains a list of all its neighboring adjacent vertices. This representation is highly memory-efficient for sparse graphs. + Adjacency List: An array of dynamic linked lists or memory arrays, where each index position represents vertex and maps directly to a clean list detailing all its immediate neighboring adjacent nodes. This structural layout provides optimal performance for sparse graphs.

- {/* 5. Graph Isomorphism */} + {/* 5. Graph Connectivity Definitions */}

- 5. Graph Isomorphism + 5. Graph Connectivity: Walks, Trails, Paths, Circuits, and Cycles

- Two graphs $G_1 = (V_1, E_1)$ and $G_2 = (V_2, E_2)$ are **Isomorphic** ($G_1 \simeq G_2$) if they represent the exact same structural connectivity layout, differing only in the names or labeling configurations of their vertices. Formally, there must exist a bijective function $f: V_1 \rightarrow V_2$ such that vertices $u$ and $v$ are adjacent in $G_1$ if and only if $f(u)$ and $f(v)$ are adjacent in $G_2$. + Navigating across graph networks requires explicit structural classifications based on whether nodes or edge links can be repeated along a traversal sequence:

-
-
- Isomorphic Invariant Conditions +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Traversal TypeCore Structural ConditionsRepetition Constraints
WalkAny arbitrary alternating sequence of vertices and edges.Both vertices and edges can be repeated infinitely.
TrailA walk containing strictly unique edges.Edges cannot be repeated. Vertices can be repeated.
PathAn open walk containing strictly unique vertices.Vertices must remain entirely unique (guaranteeing unique edges).
CircuitA closed trail that begins and ends at the identical node.Edges cannot be repeated. Vertices can be repeated.
CycleA closed path beginning and ending at the identical node.No vertices or edges can be repeated, except the terminal start-end pair.
+
+
+ +
+ + {/* 6. Historic Foundational Case: The Königsberg Bridge Problem */} +
+

+ 6. Foundational Case Study: The Königsberg Bridge Problem +

+

+ The field of graph theory originated with Leonhard Euler's resolution of the historic Königsberg Bridge Problem in 1736. The geography of Königsberg, Prussia, consisted of four major landmass territories split by the Pregel River, interconnected via seven active bridges. The citizens sought to determine whether it was possible to design a continuous walking route through the city that traveled across every individual bridge exactly once, returning back to the initial point of departure. +

+ + {/* Visual Figure for Königsberg Bridge Problem */} +
+
+

+ Visual Figures: The Königsberg Bridge Multigraph Model +

+ +
+
+ Landmass A (North Bank) +
+ +
+ / ‖ \ + / ‖ \ +
+ +
+
+ Landmass B
(Island) +
+
======
+
+ Landmass C
(East Bank) +
+
+ +
+ \ ‖ / + \ ‖ / +
+ +
+ Landmass D (South Bank) +
+
+ +
+

Euler's Abstract Resolution Mapping:

+

+ Euler mapped the landmass coordinates to abstract vertices and the bridges to multigraph edge links. The structural calculation revealed the following vertex degree parameters: , , , and . Because all four vertices contained an odd degree value, the multigraph structure lacked any valid Eulerian paths or circuits, rendering the citizens' walking target physically impossible. +

+
-

- To be isomorphic, two graphs must share identical values across structural metrics. If any of these invariant conditions fail, the graphs are guaranteed to be non-isomorphic: -

-
    -
  • They must contain the exact same number of vertices ($|V_1| = |V_2|$).
  • -
  • They must contain the exact same number of edges ($|E_1| = |E_2|$).
  • -
  • Their sorted vertex degree sequences must be completely identical.
  • -
  • They must contain the same number of connected components, cycles of specific lengths, and cliques.
  • -
-

- ⚠️ Note: Passing all invariant tests does not guarantee isomorphism; it merely establishes that isomorphism is possible. Definitive proof requires building or verifying the exact mapping bijection. -


- {/* 6. Eulerian and Hamiltonian Properties */} + {/* 7. Eulerian and Hamiltonian Systems & Edge Optimization Cases */}

- 6. Traversal Optimization: Eulerian and Hamiltonian Systems + 7. Traversal Systems: Eulerian, Hamiltonian, and Edge Routing Problems

+

+ Graph optimization focuses on navigating either every edge or every vertex efficiently. This maps directly to critical routing algorithms used in networking and logistics: +

Eulerian Paths and Circuits

- An Eulerian Path is a trail that visits every edge in the graph exactly once. An Eulerian Circuit is an Eulerian path that starts and ends at the same vertex. + An Eulerian Path is a trail that visits every edge in the graph layout exactly once. An Eulerian Circuit is an Eulerian path that begins and terminates at the identical vertex.

- Euler's Fundamental Theorems: + Euler's Parity Theorems:

    -
  • An undirected connected graph has an Eulerian circuit if and only if every vertex has an even degree.
  • -
  • An undirected connected graph has an Eulerian path (but no circuit) if and only if it has exactly two vertices with an odd degree. The path must start at one odd vertex and end at the other.
  • +
  • An undirected connected graph contains an Eulerian circuit if and only if every vertex has an even degree.
  • +
  • An undirected connected graph contains an Eulerian path if and only if it contains exactly two vertices with an odd degree. The path must begin at one odd node and end at the other.
+ +
+
Algorithmic Application: Chinese Postman Problem (CPP)
+

+ Given a connected weighted graph, find the shortest closed walk that travels across every edge at least once. If the graph is Eulerian, the solution matches the Eulerian circuit exactly. If odd vertices exist, certain edges must be repeated, which is solved via minimum-weight matching algorithms. +

+
-
-

Hamiltonian Paths and Circuits

-

- A Hamiltonian Path is a simple path that visits every vertex in the graph exactly once. A Hamiltonian Circuit is a closed loop that visits every vertex exactly once and returns to the initial starting vertex. -

-

- Sufficient Conditions (Dirac & Ore Theorems): -

-
    -
  • Dirac's Theorem: If a simple graph has $n \ge 3$ vertices and every vertex $v$ satisfies $\text{deg}(v) \ge n/2$, then the graph contains a Hamiltonian circuit.
  • -
  • Ore's Theorem: If a simple graph has $n \ge 3$ vertices and for every pair of non-adjacent vertices $u, v$, the condition $\text{deg}(u) + \text{deg}(v) \ge n$ holds, then the graph contains a Hamiltonian circuit.
  • -
+
+
+

Hamiltonian Paths and Circuits

+

+ A Hamiltonian Path is a simple path that visits every single vertex in the graph exactly once. A Hamiltonian Circuit is a closed loop that visits every node exactly once and returns back to the initial starting point. +

+

+ Sufficient Structural Bound Theorems: +

+
    +
  • Dirac's Theorem: If a simple graph contains vertices and every vertex satisfies , then the graph contains a Hamiltonian circuit.
  • +
  • Ore's Theorem: If a simple graph contains nodes and for every non-adjacent node pair , the condition is met, then the graph contains a Hamiltonian circuit.
  • +
+
+ +
+
Algorithmic Application: Traveling Salesperson Problem (TSP)
+

+ Given a weighted complete graph, find the Hamiltonian circuit that minimizes the total combined edge weight sum. Unlike the edge-focused Chinese Postman Problem, finding a Hamiltonian circuit is an NP-hard optimization challenge with no known polynomial-time solution. +

+

- {/* 7. Planar Graphs */} + {/* 8. Graph Isomorphism */}

- 7. Topological Space Layouts: Planar Graphs and Parameters + 8. Graph Isomorphism & Mapping Bijections

- A graph is considered Planar if it can be drawn in a single geometric plane such that no two edges cross or intersect each other. When a planar graph is drawn without any edge crossings, it divides the plane into distinct bounded and unbounded geometric spaces called Regions (or Faces). + Two separate graphs and are classified as Isomorphic () if they maintain the exact same internal structural connectivity alignment, differing solely in vertex naming conventions or spatial layout styles. Formally, there must exist a bijective mapping function such that vertex pairs and are adjacent within if and only if their mapped counterparts and are adjacent within . +

+ +
+
+ Isomorphic Invariant Metric Tests +
+

+ To satisfy isomorphism criteria, both graphs must match across multiple structural metrics. If any of these invariant conditions fail, the systems are guaranteed to be non-isomorphic: +

+
    +
  • They must share identical vertex counts ().
  • +
  • They must share identical edge counts ().
  • +
  • Their sorted vertex degree sequences must be completely identical.
  • +
  • They must match in internal cycle counts of specific lengths, connected components, and clique formations.
  • +
+

+ ⚠️ Systems Warning: Passing all invariant tests does not guarantee graph isomorphism; it merely establishes eligibility. Definitive confirmation requires constructing the precise bijective vertex-to-vertex function matrix. +

+
+
+ +
+ + {/* 9. Planar Graphs */} +
+

+ 9. Planar Graphs & Topological Surface Embeddings +

+

+ A graph is explicitly classified as Planar if it can be drawn or embedded within a two-dimensional geometric plane space in a manner where no two edges cross or intersect one another. A planar graph embedded without crossings divides the plane into bounded and unbounded geometric regions known as Regions (or Faces).

- Euler's Planar Formula + Euler's Planar Polyhedron Formula

- For any connected planar graph with $V$ vertices, $E$ edges, and $R$ regions: + For any connected planar graph configured with vertices, edges, and regions, the following equality remains invariant:

- V − E + R = 2 +
-

Boundary Edge Inequalities for Simple Planar Graphs ($V \ge 3$):

-

1. Every region is bounded by at least 3 edges, yielding the inequality: $E \le 3V − 6$.

-

2. If the graph contains no cycles of length 3 (triangle-free), every region is bounded by at least 4 edges, yielding: $E \le 2V − 4$.

+

Boundary Edge Inequalities for Simple Planar Layouts ():

+

1. In a standard planar simple graph, each face is bounded by at least 3 edges, creating the strict inequality: .

+

2. If the planar layout contains no cycles of length 3 (meaning it is completely triangle-free), each face is bounded by at least 4 edges, creating the inequality: .

- Kuratowski's Theorem: A graph is planar if and only if it does not contain a subgraph that is homeomorphic to, or can be reduced to, $K_5$ (the complete graph on 5 vertices) or $K_{3,3}$ (the complete utility graph on 3 vertices each). These two graphs are the foundational non-planar archetypes. + Kuratowski's Structural Theorem: A graph is planar if and only if it does not contain a subgraph that is homeomorphic to, or can be reduced to, (the complete graph on 5 vertices) or (the complete non-planar utility graph on two sets of 3 vertices). These two configurations are the fundamental non-planar topological structures.

+

- {/* 8. Graph Coloring and Chromatic Number */} + {/* 10. Graph Coloring and Chromatic Number */}

- 8. Graph Coloring & Structural Partition Bounds + 10. Graph Coloring & Partition Bounds

- A Vertex Coloring of a graph $G$ is an assignment of colors to the vertices of $G$ such that no two adjacent vertices share the exact same color. + A formal Vertex Coloring of an active graph is an assignment of specific color values to the vertices of such that no two adjacent nodes share the identical color tag. This configuration models channel allocation and scheduling tasks.

- The Chromatic Number, $\chi(G)$: The absolute minimum number of colors required to properly color the vertices of a graph $G$. + The Chromatic Number (): The absolute minimal number of colors required to achieve a valid vertex coloring across graph .

@@ -289,141 +407,51 @@ export function Ch4Content() {
  • - Complete Graph ($K_n$): $\chi(K_n) = n$ (every vertex is connected to all others, forcing distinct colors). + Complete Graph (): (since every vertex connects to all others, forcing unique colors).
  • - Bipartite Graph ($K_{m,n}$): $\chi(G) = 2$ (vertices partition cleanly into 2 independent color groupings). + Bipartite Graph (): (vertices partition into 2 independent color groupings).
  • - Cycle Graph ($C_n$): $\chi(C_n) = 2$ if $n$ is even; $\chi(C_n) = 3$ if $n$ is odd. + Cycle Graph (): if is an even integer; if is an odd integer.
- The Famous Four-Color Theorem: The chromatic number of any planar graph is at most 4 ($\chi(G) \le 4$). + The Famous Four-Color Theorem: The chromatic number of any valid planar graph embedded on a two-dimensional surface is at most 4 ().

- {/* 9. Factorization of a Graph */} + {/* 11. Factorization of a Graph */}

- 9. Factorization of a Graph + 11. Factorization of a Graph & Perfect Matchings

- A **Factor** of a graph $G$ is a spanning subgraph of $G$ that contains all the vertices of $G$. **Graph Factorization** is the process of partitioning the complete edge set $E$ of a graph into disjoint, spanning subgraphs (factors). + A Factor of a graph is a spanning subgraph of that includes all vertices of . Graph Factorization partitions the edge set into disjoint factors:

  • - 1-Factorization: A 1-factor is a spanning subgraph that is regular of degree 1 (a perfect matching). A graph can be 1-factored if its entire edge set can be divided into disjoint perfect matchings. A complete graph $K_n$ has a 1-factorization if and only if $n$ is even. + 1-Factorization: A 1-factor is a regular spanning subgraph of degree 1, which represents a perfect matching across the node pool. A graph can be 1-factored if its entire edge set can be divided into disjoint perfect matchings. A complete graph has a 1-factorization if and only if is an even integer.
  • - 2-Factorization: A 2-factor is a spanning subgraph that is regular of degree 2, which physically manifests as a collection of disjoint cycles. A complete graph $K_n$ can be broken down into disjoint 2-factors if and only if $n$ is an odd integer. + 2-Factorization: A 2-factor is a regular spanning subgraph of degree 2, which physically manifests as a collection of disjoint components that are simple cycles. A complete graph can be divided into disjoint 2-factors if and only if is an odd integer.

- {/* 10. Algorithmic Combinatorics */} -
-

- 10. Algorithmic Optimization Problems -

- -
-
-

Traveling Salesperson Problem (TSP)

-

Vertex Optimization / Hard Bounds

-

- Given a weighted complete graph, find the Hamiltonian circuit that minimizes the total edge weight sum. This problem models visiting every target node in a network exactly once while minimizing traveling costs. TSP is an NP-hard optimization problem with no known polynomial-time solution. -

-
- -
-

Chinese Postman Problem (CPP)

-

Edge Optimization / Polynomial Bounds

-

- Given a connected weighted graph, find the shortest closed walk that travels across every edge at least once. If the graph contains an Eulerian circuit, the optimal route is simply that circuit, and its length matches the sum of all edge weights. If odd-degree vertices are present, certain edges must be duplicated, which can be solved efficiently using matching algorithms. -

-
-
-
- -
- - {/* 11. Historic Problems: The Königsberg Bridge Problem */} -
-

- 11. Historic Roots: The Königsberg Bridge Problem -

-

- The origin of modern graph theory traces back to the historic Königsberg Bridge Problem, solved by Leonhard Euler in 1736. The city of Königsberg, Prussia, was divided into four landmasses by the Pregel River, and these landmasses were linked together by seven bridges. The citizens wanted to determine if it was possible to take a walk through the city in such a way that they crossed every bridge exactly once, returning to their starting position. -

- - {/* Visual Figure for Königsberg Bridge Problem */} -
-
-

- Visual Figures: The Königsberg Bridge Multigraph Model -

- -
- {/* Landmass A */} -
- Landmass A (North Bank) -
- - {/* Top Bridges mapping lines */} -
- / ‖ \ - / ‖ \ -
- - {/* Middle Landmass C */} -
-
- Landmass B
(Island) -
-
======
-
- Landmass C
(East Bank) -
-
- - {/* Bottom Bridges mapping lines */} -
- \ ‖ / - \ ‖ / -
- - {/* Landmass D */} -
- Landmass D (South Bank) -
-
- -
-

Euler's Abstract Mapping Resolution:

-

- Euler mapped the landmasses to vertices and the bridges to multigraph edges. The resulting model yielded the following degrees: A=3, B=5, C=3, D=3. Because all four vertices have an odd degree, the graph contains no Eulerian path or circuit. Thus, the citizens' target walk is mathematically impossible. -

-
-
-
-
- -
- {/* Summary */}

Summary

- In this chapter, we explored graph theory from its structural foundations to its core algorithmic applications. We analyzed fundamental graph parameters like degrees, order, and edge sizes, along with algebraic representation techniques using adjacency matrices and lists. We established structural conditions for graph isomorphism, topological constraints for planarity, and vertex coloring bounds. Finally, we studied optimization problems like TSP and CPP, tracing their origins back to Euler's historic resolution of the Königsberg Bridge Problem. + In this chapter, we explored graph theory from its structural foundations to its core algorithmic applications. We analyzed fundamental graph parameters like degrees, order, and edge sizes, along with algebraic representation techniques using adjacency matrices and lists. We integrated graph operations including subgraphs, subtrees, graph joins, and Cartesian products. We established structural conditions for graph isomorphism, topological constraints for planarity, and vertex coloring bounds. Finally, we studied optimization traversal systems like the Chinese Postman Problem (CPP) and Traveling Salesperson Problem (TSP), tracing their origins back to Euler's historic resolution of the Königsberg Bridge Problem.

diff --git a/app/sem4/discrete/content/chapter5.tsx b/app/sem4/discrete/content/chapter5.tsx index 4e00f7a..89ed567 100644 --- a/app/sem4/discrete/content/chapter5.tsx +++ b/app/sem4/discrete/content/chapter5.tsx @@ -1,11 +1,13 @@ -import React from "react"; +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" export function Ch5Content() { return (
{/* Introduction */}

- Algebraic Structures form an abstract mathematical framework concerned with sets of elements paired with one or more operational rules satisfying explicit axioms. This branch of mathematics provides the foundational underpinnings for public-key cryptography (such as RSA and Elliptic Curve Cryptography), error-correcting codes, hashing protocols, and formal state machine definitions. + Welcome to the exhaustive module on Algebraic Structures. This field provides the underlying formal mathematical framework used across modern system design to establish rules of symmetry, verify protocol properties, and build public-key cryptographic primitives such as Rivest-Shamir-Adleman () and Elliptic Curve Cryptography ().


@@ -16,38 +18,38 @@ export function Ch5Content() { 1. Binary Operations & Mathematical Properties

- Let $S$ be a non-empty set. A **Binary Operation** $*$ on $S$ is a mapping or function that assigns to each ordered pair of elements in $S$ a unique element also belonging to $S$. Formally, $*: S \times S \rightarrow S$. + Let be a non-empty set. A Binary Operation on is a function or mapping that combines two elements of to produce a unique third element also belonging to . Formally, this is written as: .

-

Core Operational Properties:

+

Core Axiomatic Properties:

  • - Closure Property: The operation is closed if for all elements $a, b \in S$, the output $(a * b) \in S$. + Closure Property: An operation exhibits closure if for every possible element pair , the resulting output value satisfies . If any pair escapes the set domain, closure is broken.
  • - Associative Property: For all $a, b, c \in S$, the ordering of evaluation can be grouped arbitrarily: $(a * b) * c = a * (b * c)$. + Associative Property: For all elements , the relative sequence of evaluations can be regrouped arbitrarily without changing the outcome: .
  • - Commutative Property: For all $a, b \in S$, the relative order of the parameters can be swapped: $a * b = b * a$. + Commutative Property: For all elements , the relative spatial positions of the operands can be rearranged freely: .
  • - Identity Element ($e$): An element $e \in S$ is an identity if for all $a \in S$, the operation yields the original element unchanged: $a * e = e * a = a$. + Identity Element (): There exists a unique identity element such that for absolutely any element , operating with preserves the element exactly: .
  • - Inverse Element ($a^{-1}$): For every element $a \in S$, there exists an inverse element $a^{-1} \in S$ such that executing the operation yields the identity element: $a * a^{-1} = a^{-1} * a = e$. + Inverse Element (): For every individual element , there must exist a unique corresponding inverse element such that executing the operation yields the group identity: .

- {/* 2. Algebraic Hierarchy */} + {/* 2. The Algebraic Hierarchy */}

- 2. The Algebraic Hierarchy: From Groupoids to Abelian Groups + 2. The Algebraic Hierarchy: From Magmas to Groups

- Algebraic structures are classified into explicit hierarchies depending on which subset of the foundational axioms their operations satisfy: + Abstract algebraic systems are categorized into a strict hierarchy based on the subset of structural axioms their underlying binary operation satisfies:

@@ -55,29 +57,29 @@ export function Ch5Content() { Structure - Required Axioms & Constraints + Required Invariant Axiom Sets Groupoid (Magma) - Closure + Closure Only. Semigroup - Closure + Associativity + Closure Associativity. Monoid - Closure + Associativity + Identity Element + Closure Associativity Identity Element. Group - Closure + Associativity + Identity + Inverse Element + Closure Associativity Identity Inverse Element. Abelian Group - Closure + Associativity + Identity + Inverse + Commutativity + Closure Associativity Identity Inverse Commutativity. @@ -86,46 +88,46 @@ export function Ch5Content() {
- {/* 3. Modular Sets & Prime Fields */} + {/* 3. Modular Groups & Prime Fields */}

- 3. Concrete Groups over Modular Systems & Prime Order Edge Cases + 3. Concrete Groups over Modular Systems & Prime Order Bounds

- Modular arithmetic systems provide classical, bounded algebraic structures that form the core of modern numeric cryptography. + Modular arithmetic architectures restrict infinite numerical systems into stable, finite sets ideal for encryption protocols.

-

Additive Modular Group $(\mathbb{Z}_n, +_n)$

+

Additive Modular Group (, )

- The set of remainders $\mathbb{Z}_n = \{0, 1, 2, \dots, n-1\}$ under addition modulo $n$ forms a valid **Abelian Group**. + The finite remainder set paired with addition modulo forms a valid, complete Abelian Group.
- - **Identity:** $0$. + - Additive Identity Element: .
- - **Inverse of $a$:** $(n - a) \pmod n$. + - Additive Inverse of element : .
- This group maintains closure and commutativity for any positive integer value of $n$. + This system satisfies closure, associativity, and commutativity bounds for absolutely any positive integer parameter .

-

Multiplicative Modular Group $(U(n), \cdot_n)$

+

Multiplicative Modular Group (, )

- The full set $\mathbb{Z}_n$ under standard multiplication modulo $n$ does **not** form a group because $0$ has no multiplicative inverse. Instead, we define the reduced set: + The standard set under multiplication modulo lacks group compliance because the zero element can never have a valid multiplicative inverse. To solve this, we extract the coprime reduced set:
- - U(n) = \{ a \in \mathbb{Z}_n \mid \text{gcd}(a, n) = 1 \} + + - $U(n)$ contains only elements coprime to $n$. Under multiplication modulo $n$, it forms a strict Abelian Group. + This system forms a strict Abelian Group under multiplication modulo , containing only elements relatively prime to the boundary parameter .

-

⚠️ Critical Prime Element Constraint Rule:

+

⚠️ Critical Crytographic Exception (Prime Modulus Order):

- If the modular boundary parameter $p$ is a strict **Prime Number**, then all non-zero elements are guaranteed to be coprime to $p$. Consequently, the multiplicative set reduces to $\mathbb{Z}_p^* = \{1, 2, 3, \dots, p-1\}$. Under multiplication modulo $p$, this set contains precisely $p-1$ elements and satisfies all group parameters. + If the modular structural parameter is chosen as a strict Prime Number, every single non-zero integer less than is guaranteed to be coprime to . Consequently, the multiplicative group framework expands to include all non-zero remainders: . This set has an exact cardinality of and satisfies all multiplicative inverse parameters natively.

@@ -135,36 +137,36 @@ export function Ch5Content() { {/* 4. Subgroups & Cyclic Groups */}

- 4. Subgroups, Cyclic Frameworks, and Generative Elements + 4. Subgroups, Cyclic Groups, and Generative Elements

- A non-empty subset $H$ of a group $(G, *)$ is classified as a **Subgroup** ($H \le G$) if $H$ forms a valid group under the identical operation rule $*$. + A non-empty subset of a parent group is formally classified as a Subgroup (denoted as ) if and only if itself forms a valid standalone group when using the exact same operational rule .

- The Multi-Step Subgroup Criteria Theorem + The Multi-Step Subgroup Evaluation Criteria

- A subset $H \subseteq G$ is a subgroup if and only if it satisfies three structural tests cleanly: + A subset is a verified subgroup if and only if it clears three specific structural checks cleanly:

    -
  1. Identity check: The identity element $e$ of the main group belongs to $H$ ($e \in H$).
  2. -
  3. Closure under the operation: For all $a, b \in H \implies (a * b) \in H$.
  4. -
  5. Closure under inverses: For all $a \in H \implies a^{-1} \in H$.
  6. +
  7. Identity element retention: The identity element of the main group belongs to the subset ().
  8. +
  9. Operational closure: For all element pairs .
  10. +
  11. Inverse closure: For any individual element .
-

Cyclic Groups & Generators

+

Cyclic Groups & Group Generators

- A group $G$ is called a **Cyclic Group** if every single element within the group can be generated by repeatedly applying the operational rule to a single chosen base element $a \in G$. The element $a$ is designated as the **Generator** of the group, denoted as $G = \langle a \rangle$. + A group is defined as a Cyclic Group if every single element contained within the structure can be constructed by applying the operation repeatedly to one single chosen base element . The element is designated as the Generator of the cyclic group, written as: .

    -
  • In multiplicative structures, this corresponds to power steps: $\langle a \rangle = \{a^n \mid n \in \mathbb{Z}\}$.
  • -
  • In additive structures, this corresponds to scalar steps: $\langle a \rangle = \{n \cdot a \mid n \in \mathbb{Z}\}$.
  • +
  • In a multiplicative group setting, this takes the form of power steps: .
  • +
  • In an additive group setting, this takes the form of scalar steps: .

- Theorem on Cyclic Commutativity: Every cyclic group is guaranteed to be an Abelian group, but an Abelian group is not necessarily cyclic (e.g., the Klein 4-Group). + Theorem on Cyclic Symmetry: Every cyclic group is guaranteed to be an Abelian group, meaning commutativity is an intrinsic property of cyclic systems. However, the converse does not hold—Abelian groups are not necessarily cyclic (e.g., the Klein -group).

@@ -176,14 +178,14 @@ export function Ch5Content() { 5. Cosets & Lagrange's Structural Partition Theorem

- Let $H$ be a static subgroup of group $G$, and let $a$ be an arbitrary element belonging to $G$. + Let be a fixed subgroup of a group , and let be any arbitrary element belonging to the parent group .

    -
  • Left Coset of $H$: The set $aH = \{a * h \mid h \in H\}$.
  • -
  • Right Coset of $H$: The set $Ha = \{h * a \mid h \in H\}$.
  • +
  • Left Coset Formulation: The set .
  • +
  • Right Coset Formulation: The set .

- Cosets partition a group into disjoint paths of uniform sizing layout. This spatial uniformity leads directly to one of the most critical structural bounds in abstract algebra: + Cosets partition the elements of the parent group into completely disjoint subsets of uniform sizes. This geometric uniformity provides the foundation for Lagrange's theorem:

@@ -191,15 +193,15 @@ export function Ch5Content() { Lagrange's Subgroup Order Theorem

- If $G$ is a finite group and $H$ is a valid subgroup of $G$, then the order (cardinality) of $H$ must divide the order of $G$ perfectly: + If is a finite group and is a valid subgroup of , then the order (cardinality) of must divide the order of perfectly:

- |H|  \Big|  |G| +
-
-

🚨 Crucial Deductions and Edge Case Realities:

-

1. The ratio $[G : H] = |G| / |H|$ counts the total number of unique, distinct cosets of $H$ in $G$. This value is called the Index of $H$.

-

2. **Prime Group Invariant:** Any group containing a strictly **prime order** $|G| = p$ has no non-trivial subgroups. Its only possible subgroups have orders 1 or $p$. Thus, every group of prime order is guaranteed to be a cyclic group generated by any non-identity element.

+
+

🚨 Crucial Structural Deductions & Cryptographic Realities:

+

1. The exact ratio determines the total count of distinct, unique cosets of inside group . This integer quotient value is designated as the Index of Subgroup .

+

2. **The Prime Order Invariant:** Any finite group containing a strictly prime order () possesses absolutely no non-trivial subgroups. Its only mathematically viable subgroups are the trivial group and the group itself. Thus, every group of prime order is guaranteed to be a cyclic group, and any non-identity element serves as its generator.

@@ -212,31 +214,31 @@ export function Ch5Content() { 6. Dual Operation Systems: Rings, Commutative Rings, and Integral Domains

- When an abstract system incorporates **two** operational rules—traditionally designated as Addition ($+$) and Multiplication ($\cdot$)—it moves beyond group structures into standard dual ring systems. + When an abstract system incorporates two unique binary operations—traditionally designated as Addition () and Multiplication ()—it progresses past group definitions into standard dual-operation Ring Systems.

- A **Ring** $(R, +, \cdot)$ is an ordered triple satisfying three integrated modular stages of axioms: + A formal Ring is an ordered triple satisfying three integrated modular stages of algebraic axioms:

    -
  1. $(R, +)$ forms an **Abelian Group** (satisfying Closure, Associativity, Identity=$0$, Inverses=$-a$, and Commutativity).
  2. -
  3. $(R, \cdot)$ forms a basic **Semigroup** (satisfying Closure and Associativity).
  4. -
  5. **Distributive Properties:** Multiplication distributes over addition across all element pathways: $a \cdot (b + r) = (a \cdot b) + (a \cdot r)$ and $(b + r) \cdot a = (b \cdot a) + (r \cdot a)$.
  6. +
  7. The algebraic structure forms a complete Abelian Group (satisfying additive closure, associativity, identity element , inverse mappings , and perfect commutativity).
  8. +
  9. The algebraic structure forms a baseline Semigroup (satisfying multiplicative closure and associativity axioms).
  10. +
  11. Distributive Axioms: Multiplication distributes over addition across all element pathways: and for all .
-

Variations of Ring Structures:

+

Specialized Varieties of Ring Structures:

  • - Commutative Ring: A ring where multiplication is commutative: $a \cdot b = b \cdot a$. + Commutative Ring: A ring where the multiplicative operation satisfies commutative order properties: .
  • - Ring with Unity: A ring that contains a multiplicative identity element (denoted as $1$) such that $a \cdot 1 = 1 \cdot a = a$. + Ring with Unity: A ring that contains an explicit multiplicative identity element (denoted as ) such that .
  • - Zero Divisors: Non-zero elements $a, b \in R$ such that their multiplication evaluates to zero: $a \cdot b = 0$ while $a \neq 0$ and $b \neq 0$. For instance, in $\mathbb{Z}_6$, elements $2$ and $3$ are zero divisors because $2 \cdot 3 = 6 \equiv 0 \pmod 6$. + Zero Divisors: This condition occurs when two non-zero elements multiply together to produce zero: while and . For instance, in the modular ring , elements and are zero divisors because .
  • - Integral Domain: A commutative ring with unity that contains **absolutely no zero divisors**. This allows for the standard algebraic cancellation law: if $a \cdot b = a \cdot c$ and $a \neq 0$, then $b = c$. + Integral Domain: A commutative ring with unity that contains absolutely no zero divisors. This constraint preserves the classic algebraic cancellation law: if holds and , then .
@@ -249,25 +251,25 @@ export function Ch5Content() { 7. Fields & Global Algebraic Completeness

- A **Field** $(F, +, \cdot)$ represents the highest tier of structural completeness for continuous and discrete numerical systems. It is an integral domain where every single non-zero element must possess a unique multiplicative inverse. + A Field represents the highest tier of algebraic completeness. It is an integral domain where every single non-zero element possesses a unique, verifiable multiplicative inverse, allowing for division operations to occur.

The Definitive Field Requirements:

-

An algebraic structure is a field if and only if it satisfies three integrated requirements:

+

An abstract structure qualifies as a field if and only if it fulfills three integrated structural tiers:

    -
  • $(F, +)$ forms a completely cooperative Abelian Group with additive identity $0$.
  • -
  • $(F \setminus \{0\}, \cdot)$ forms an independent, clean Abelian Group with multiplicative identity $1$.
  • -
  • Multiplication distributes over addition.
  • +
  • The structure forms a fully compliant Abelian Group with additive identity element .
  • +
  • The non-zero set forms an independent, complete Abelian Group with multiplicative identity element .
  • +
  • Multiplication distributes over addition perfectly.
-

- Standard Examples: The sets of Rational Numbers ($\mathbb{Q}$), Real Numbers ($\mathbb{R}$), and Complex Numbers ($\mathbb{C}$) are fields. The set of Integers ($\mathbb{Z}$) is **not** a field, because integers like 2 lack an integer multiplicative inverse ($1/2 \notin \mathbb{Z}$); $\mathbb{Z}$ is merely an integral domain. +

+ Structural Comparison: The sets of Rational Numbers (), Real Numbers (), and Complex Numbers () are complete fields. The set of integers () is **not** a field because integers like lack integer multiplicative inverses (). Thus, remains classified as an integral domain.

-

Finite Fields (Galois Fields, $GF(p)$)

+

Finite Fields (Galois Fields, )

- In computational environments, algorithms rely on bounded finite fields. A finite field can be constructed out of modular integer sets if and only if the modulus is a strict **Prime Number $p$**. The structure $(\mathbb{Z}_p, +, \cdot)$ forms a strict finite field, denoted as $GF(p)$ or $\mathbb{F}_p$. + In computer algorithms, applications utilize bounded finite field fields. A finite field can be synthesized out of a modular integer system if and only if the modulus boundary parameter is chosen as a strict Prime Number . The resulting algebraic triple forms a finite field, denoted in cryptography as or .

@@ -276,10 +278,10 @@ export function Ch5Content() { {/* Summary */}

- Summary + Chapter Summary

- In this chapter, we analyzed abstract algebraic structures across a progression of structural constraints. We tracked the expansion of operational rules from single-operation structures (including semi-groups, monoids, groups, and commutative Abelian groups) up to modular integer settings. We explored subgroups, generators of cyclic sets, and geometric scaling using Lagrange's theorem. Finally, we studied dual-operation systems, tracing the progression from rings to cancellation-safe integral domains and globally invertible fields. + In this chapter, we explored abstract algebraic structures across an increasing progression of axiomatic constraints. We mapped single-operation structures from magmas and semigroups to groups and cyclic Abelian configurations, analyzing sub-components using Lagrange's subgroup order theorem. Finally, we scaled our system architectures to dual-operation networks, detailing the algebraic requirements needed to build rings, cancellation-safe integral domains, and globally invertible finite fields.

diff --git a/app/sem4/discrete/content/chapter6.tsx b/app/sem4/discrete/content/chapter6.tsx index d948a1e..909f0f1 100644 --- a/app/sem4/discrete/content/chapter6.tsx +++ b/app/sem4/discrete/content/chapter6.tsx @@ -1,3 +1,7 @@ +"use client" +import React from "react" +import { Inline, Block } from "../../../components/Math" + export function Ch6Content() { return (
diff --git a/package-lock.json b/package-lock.json index 4b72912..f62b808 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,10 +8,12 @@ "name": "opencse", "version": "0.1.0", "dependencies": { + "katex": "^0.17.0", "lucide-react": "^0.544.0", "next": "15.5.9", "react": "19.1.0", - "react-dom": "19.1.0" + "react-dom": "19.1.0", + "react-katex": "^3.1.0" }, "devDependencies": { "@eslint/eslintrc": "^3", @@ -2343,6 +2345,14 @@ "simple-swizzle": "^0.2.2" } }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "engines": { + "node": ">= 12" + } + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -4091,7 +4101,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true, "license": "MIT" }, "node_modules/js-yaml": { @@ -4157,6 +4166,21 @@ "node": ">=4.0" } }, + "node_modules/katex": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.17.0.tgz", + "integrity": "sha512-Vdw0ATsQ9V+LuegM/BTwQqV/6cTl5lbGcIrU+BCgLxyf6bo38ybOr372tuSIxir3CN720flu1meYR6XzNMwQnw==", + "funding": [ + "https://opencollective.com/katex", + "https://github.com/sponsors/katex" + ], + "dependencies": { + "commander": "^8.3.0" + }, + "bin": { + "katex": "cli.js" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -4467,7 +4491,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, "license": "MIT", "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -4723,7 +4746,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -5022,7 +5044,6 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, "license": "MIT", "dependencies": { "loose-envify": "^1.4.0", @@ -5086,9 +5107,35 @@ "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true, "license": "MIT" }, + "node_modules/react-katex": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/react-katex/-/react-katex-3.1.0.tgz", + "integrity": "sha512-At9uLOkC75gwn2N+ZXc5HD8TlATsB+3Hkp9OGs6uA8tM3dwZ3Wljn74Bk3JyHFPgSnesY/EMrIAB1WJwqZqejA==", + "dependencies": { + "katex": "^0.16.0" + }, + "peerDependencies": { + "prop-types": "^15.8.1", + "react": ">=15.3.2 <20" + } + }, + "node_modules/react-katex/node_modules/katex": { + "version": "0.16.47", + "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.47.tgz", + "integrity": "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==", + "funding": [ + "https://opencollective.com/katex", + "https://github.com/sponsors/katex" + ], + "dependencies": { + "commander": "^8.3.0" + }, + "bin": { + "katex": "cli.js" + } + }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", diff --git a/package.json b/package.json index 0fb9526..eeacd6e 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,12 @@ "lint": "eslint" }, "dependencies": { + "katex": "^0.17.0", "lucide-react": "^0.544.0", "next": "15.5.9", "react": "19.1.0", - "react-dom": "19.1.0" + "react-dom": "19.1.0", + "react-katex": "^3.1.0" }, "devDependencies": { "@eslint/eslintrc": "^3",