• Tidak ada hasil yang ditemukan

CSL202: Discrete Mathematical Structures

N/A
N/A
Protected

Academic year: 2025

Membagikan "CSL202: Discrete Mathematical Structures"

Copied!
20
0
0

Teks penuh

(1)

Ragesh Jaiswal, CSE, IIT Delhi

(2)

Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

(3)

Mathematical Induction

Mathematical induction is used to prove statements that assert thatP(n) is true for all positive integers n, whereP(n) is a propositional function.

A proof by mathematical induction has two parts:

Basis step: Here we show thatP(1) is true.

Inductive step: Here we show that ifP(k) is true, then P(k+ 1) is true.

Definition (Principle of mathematical induction)

To prove thatP(n) is true for all positive integers n, whereP(n) is a propositional function, we complete two steps:

Basis step: We verify thatP(1) is true.

Inductive step: We show that the conditional statement P(k)→P(k+ 1) is true for all positive integersk.

(4)

To prove thatP(n) is true for all positive integers n, whereP(n) is a propositional function, we complete two steps:

Basis step: We verify thatP(1) is true.

Inductive step: We show that the conditional statement P(k)→P(k+ 1) is true for all positive integersk.

In the inductive step, we assume that for arbitrary positive integerP(k) is true and then show thatP(k+ 1) must also be true. The assumption that P(k) is true is called the inductive hypothesis.

Induction may be expressed as the following rule of inference:

(P(1)∧ ∀k(P(k)→P(k+ 1)))→ ∀n P(n)

Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

(5)

Mathematical Induction

Definition (Principle of mathematical induction)

To prove thatP(n) is true for all positive integers n, whereP(n) is a propositional function, we complete two steps:

Basis step: We verify thatP(1) is true.

Inductive step: We show that the conditional statement P(k)→P(k+ 1) is true for all positive integersk.

Why is mathematical induction valid?

Well-ordering principle: Every nonempty subset of the set of positive integers has a least element.

Argue the validity of mathematical induction using the axiom above.

(6)

Show that the sum of the first n odd integers is n2.

Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

(7)

Mathematical Induction: Examples

Show that the sum of the first n odd integers is n2. Show that for all n,n <2n.

(8)

Show that the sum of the first n odd integers is n2. Show that for all n,n <2n.

Show that 2n<n! for every integern with n ≥4.

Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

(9)

Mathematical Induction: Examples

Show that the sum of the first n odd integers is n2. Show that for all n,n <2n.

Show that 2n<n! for every integern with n ≥4.

Prove the following generalization of De Morgan’s laws:

nj=1Aj =∪nj=1Aj

whenever A1,A2, ...,An are subsets of a universal set U and n ≥2.

(10)

You have a lecture room and you getn requests for scheduling lectures. Each request has a start and an end time. Design an algorithm that maximizes the number of lectures held in the room.

Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

(11)

Mathematical Induction: Examples

You have a lecture room and you getn requests for scheduling lectures. Each request has a start and an end time. Design an algorithm that maximizes the number of lectures held in the room.

Consider the algorithm that schedules based on end time of lectures. We will show that this algorithm gives the optimal solution.

(12)

Interval scheduling: Given a set ofnintervals of the form (S(i),F(i)), find the largest subset of non-overlapping intervals.

Algorithm GreedySchedule

- InitializeR to contain all intervals - While R is not empty

- Choose an interval (S(i),F(i)) from R that has the smallest value ofF(i)

- Delete all intervals inR that overlaps with (S(i),F(i)) Running time?

Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

(13)

Mathematical Induction: Examples (Interval scheduling)

Problem

Interval scheduling: Given a set ofn intervals of the form (S(i),F(i)), find the largest subset of non-overlapping intervals.

Algorithm

GreedySchedule

- WhileR is not empty

- Choose an interval (S(i),F(i)) fromR that has the smallest value ofF(i)

- Delete all intervals in R that overlaps with (S(i),F(i)) Running time? O(nlogn)

(14)

Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

(15)

Mathematical Induction: Examples (Interval scheduling)

Claim: LetO denote some optimal subset andAbe the subset given byGreedySchedule. Then|O|=|A|.

Proof sketch

Leta1,a2, ...,ak be the sequence of requests thatGreedySchedule picks ando1,o2, ...,ol be the requests inO sorted in non-decreasing order by finishing time.

Claim 1: F(a1)≤F(o1).

(16)

Proof sketch

Leta1,a2, ...,ak be the sequence of requests thatGreedySchedule picks ando1,o2, ...,ol be the requests inO sorted in non-decreasing order by finishing time.

Claim 1: F(a1)≤F(o1).

Claim 2: IfF(a1)≤F(o1),F(a2)≤F(o2), ..., F(ai−1)≤F(oi−1), thenF(ai)≤F(oi).

Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

(17)

Mathematical Induction: Examples (Interval scheduling)

Claim: LetO denote some optimal subset andAbe the subset given byGreedySchedule. Then|O|=|A|.

Proof sketch

Leta1,a2, ...,ak be the sequence of requests that

GreedySchedulepicks ando1,o2, ...,ol be the requests in O sorted in non-decreasing order by finishing time.

We will show by induction that∀i,F(ai)≤F(oi) Claim 1 (base case): F(a1)F(o1).

Claim 2 (inductive step): IfF(a1)F(o1),F(a2)F(o2), ..., F(ai−1)F(oi−1), thenF(ai)F(oi).

GreedySchedulecould not have stopped afterak.

(18)

find the largest subset of non-overlapping intervals.

Algorithm GreedySchedule

- InitializeR to contain all intervals - WhileRis not empty

- Choose an interval (S(i),F(i)) fromR that has the smallest value ofF(i)

- Delete all intervals inRthat overlaps with (S(i),F(i)) Another way to prove that the above greedy algorithm returns an optimal solution is by a slightly different induction argument.

We consider the propositional function:

P(n): For any input instance, if the greedy algorithm returns a solution withnlectures, then all optimal solutions also haven lectures.

The detailed discussion with respect to this Induction argument may be found in the textbook.

Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

(19)

Mathematical Induction: Examples

We will only consider simple graphs for this discussion which are graphs that do not have self loops or multi-edges (i.e., multiple edges between a pair of vertices).

Definition (Strongly connected graph)

An undirected graph is called strongly connected iff for every pair of vertices in the graph there is a path between these vertices.

Definition (Tree)

An undirected graph is called a tree iff the graph is strongly connected and does not have any cycles.

Definition (Cycle)

A sequence of verticesv1,v2, ...,vk in an undirected graph is called a cycle iffk>3,v1=vk,v1,v2, ...,vk−1 are distinct, and for every 1ik1, there is an edge betweenvi andvi+1.

(20)

Ragesh Jaiswal, CSE, IIT Delhi CSL202: Discrete Mathematical Structures

Referensi

Dokumen terkait

that this conjecture is not true in general for matrices with minimal rank equal to three and for matrices of size n n , n 6.. In this paper we prove that this conjecture is true

We prove the moderate deviation principle for subgraph count statistics of Erd˝ os-Rényi random graphs.. This is equivalent in showing the moderate deviation principle for the trace

If we recall the classification of Möbius transformations given in Definition 4.3.2 and take account of Theorem 5.2.1, we see that every conformal isom- etry of the hyperbolic plane

the only theorem we need to bridge the gap from completeness to the NIP, which you’ll prove in Exercise 6... Prove Theorem 4.8.4: A Cauchy sequence of real numbers is convergent..

Furthermore, the focus on the second goal is bibliometric analysis in a coherent area between mathematical thinking style and science learning, then the steps taken

This message is to acknowledge that we have received your manuscript entitled ' Gender Perspective concerning the Basic Mathematical Abilities ' for consideration for publication

We also prove that a ring R is a QF-ring if and only ifRis left Kasch andRRω is ef-extending if and only ifR is right AGP-injective satisfying DCC on right or left annihilators and R⊕RR

If we assume ¬pand ♦pis true in the fiction, then by theorem C we can prove that the equivalence ♦p ↔ ♦♦p is also true in the fiction; i.e., it holds in every world that is relevant to