MethodMath

Graph theory, set theory, combinatorics, logic, and proof techniques. Foundation for computer science and algorithm design.

Login to follow

Questions about Discrete Mathematics

IM
Updated May 16, 2026

Question details

What is the difference between Eulerian and Hamiltonian paths in graph theory?

I am studying graph theory and I keep confusing Eulerian paths with Hamiltonian paths. Can someone clarify the difference? Eulerian path: A path that uses every edge exactly once. Hamiltonian path: A path that visits every vertex exactly once. My questions: 1. What are the necessary and sufficient conditions for a graph to have an Eulerian circuit? 2. What are the conditions for a Hamiltonian cycle? (I hear this is much harder — why?) 3. Does the Knight's Tour problem involve Eulerian or Hamiltonian paths? 4. How do I find an Eulerian circuit in a graph using Fleury's algorithm? Examples would really help.

more
1318
DA
Updated May 16, 2026

Question details

How to prove a graph is bipartite using graph coloring?

I need to understand the relationship between bipartite graphs and 2-colorability. A graph G = (V, E) is bipartite if its vertices can be partitioned into two sets V₁ and V₂ such that every edge connects a vertex in V₁ to a vertex in V₂. The theorem states: A graph is bipartite if and only if it contains no odd cycles. How would I prove this? Also, given a graph, what algorithm can I use to determine if it's bipartite? For example, is this graph bipartite? - Vertices: 1, 2, 3, 4, 5 - Edges: (1,2), (2,3), (3,4), (4,5), (5,1), (1,3)

more
1405
DA
Updated May 16, 2026

Question details

How to solve recurrence relations using generating functions?

I'm trying to solve recurrences like: aₙ = 5a_(n-1) - 6a_(n-2), a₀ = 1, a₁ = 2 I can solve this using the characteristic equation method, but I want to learn the generating functions approach. Define G(x) = ∑_(n=0)^(∞) aₙ xⁿ. Then: ∑_(n=2)^(∞) aₙ xⁿ = 5∑_(n=2)^(∞) a_(n-1)xⁿ - 6∑_(n=2)^(∞) a_(n-2)xⁿ How do I manipulate these sums to get a closed form for G(x), and then extract an explicit formula for aₙ?

more
0338
DS
Updated May 16, 2026

Question details

How many ways to arrange n distinct objects in a circle? (Circular permutations)

I understand that for arranging n distinct objects in a line, there are n! ways. But for a circle, the answer is (n-1)!. Why? For example, with 4 people at a round table: - Rotational symmetry means arrangements that differ only by rotation are considered the same - So 4! / 4 = 6 = 3! But what if the circle has a fixed reference point (like numbered seats)? Does it become n! again? Also, what about arrangements of beads on a necklace where flipping over is also considered the same (dihedral symmetry)? Does the count become (n-1)!/2?

more
2395
DS
Updated May 16, 2026

Question details

How to use the Pigeonhole Principle to solve combinatorial problems?

The Pigeonhole Principle: If n items are placed into m containers and n > m, then at least one container contains at least two items. The generalized form: If n items are placed into m containers, then at least one container contains at least ⌈ n/m ⌉ items. Can someone show how to apply this to non-trivial problems? For example: 1. Prove that among any 5 points in a unit square, there exist two points at distance ≤ 1/√2. 2. In any set of 13 integers, there exist two whose difference is divisible by 12. 3. Any subset of size 6 from 1, 2, \ldots, 10 contains two numbers that sum to 11. What is the general strategy for identifying "pigeonholes" in a problem?

more
1514
WT
Updated May 14, 2026

Question details

How to prove that a relation is an equivalence relation and find its equivalence classes?

I am studying discrete mathematics and I need to understand equivalence relations. A relation ∼ on a set S is an equivalence relation if it is: 1. Reflexive: a ∼ a for all a ∈ S 2. Symmetric: a ∼ b ⇒ b ∼ a 3. Transitive: a ∼ b and b ∼ c ⇒ a ∼ c My questions: 1. How do I prove that the relation a ∼ b iff a - b is even on ℤ is an equivalence relation? 2. What are equivalence classes and how do I find them? 3. How does an equivalence relation partition the set? 4. What is the connection between equivalence relations and functions? 5. How do equivalence relations relate to the concept of quotients (like ℤₙ)? I want to see the complete proof and the resulting partition.

more
164
TD
Updated May 14, 2026

Question details

How to determine if a graph is planar using Kuratowski's theorem?

I am studying graph theory and I want to understand planar graphs — graphs that can be drawn on a plane without edge crossings. I know Kuratowski's theorem: A graph is planar iff it contains no subdivision of K₅ (complete graph on 5 vertices) or K_(3,3) (complete bipartite graph on 3+3 vertices). But: 1. What does a "subdivision" mean exactly? 2. Why are K₅ and K_(3,3) non-planar? 3. How do I check if a given graph contains a K₅ or K_(3,3) subdivision? 4. What is Euler's formula V - E + F = 2 for planar graphs and how is it used? Also, do all planar graphs have a straight-line drawing?

more
1183
DK
Updated May 10, 2026

Question details

How to count Catalan numbers and identify their combinatorial interpretations?

I am studying combinatorics and I am fascinated by Catalan numbers. The n-th Catalan number is: Cₙ = 1/n+1 C(2n,n) The first few are: 1, 1, 2, 5, 14, 42, 132, 429, ... My questions: 1. How is the formula derived from the recurrence relation Cₙ = ∑_(i=0)^(n-1) Cᵢ C_(n-1-i)? 2. What are the most common combinatorial interpretations of Catalan numbers? 3. How many valid sequences of n pairs of parentheses are there? (e.g., for n = 3: ((())), (()()), (())(), ()(()), ()()() — 5 ways) 4. How many binary trees with n nodes exist? 5. How many ways can a convex (n+2)-gon be triangulated? 6. How does the generating function C(x) = ∑ Cₙ xⁿ lead to the closed form? I want to understand the deep connections.

more
1259
ET
Updated May 8, 2026

Question details

How to compute combinations with repetitions (stars and bars)?

I am studying combinatorics and I understand the basic combinations formula C(n, k) = C(n,k) for choosing k items from n distinct items without repetition. But I am confused about combinations with repetition (also called multisets). The formula is: C(n + k - 1,k) where n is the number of types and k is the number of items chosen. Can someone explain: 1. Why the formula is C(n+k-1,k) using the stars and bars analogy? 2. How to apply it to: "How many ways to buy 10 donuts if there are 5 flavors available?" 3. What about the equation x₁ + x₂ + x₃ + x₄ = 15 with xᵢ ≥ 0? How many non-negative integer solutions? 4. What changes if xᵢ ≥ 1 (positive solutions)?

more
1286
LH
Updated Apr 29, 2026

Question details

How to find the shortest path in a weighted graph using Dijkstra's algorithm?

I am studying graph theory and I need to understand Dijkstra's algorithm for finding the shortest path from a source vertex to all other vertices in a weighted graph. I know the basic idea: 1. Set distance to source = 0, all others = ∞ 2. Mark all vertices as unvisited 3. For the current vertex, consider all unvisited neighbors and update their distances 4. Mark current as visited, select the unvisited vertex with smallest distance 5. Repeat until all visited But I have specific questions: 1. Why does Dijkstra's algorithm fail with negative edge weights? 2. What is the time complexity with different data structures? 3. Can someone walk through the algorithm step-by-step on a concrete graph? For example, find shortest paths from A on: - A→B: 4, A→C: 2 - B→C: 1, B→D: 5 - C→D: 8, C→E: 10 - D→E: 2, D→Z: 6 - E→Z: 3

more
1169
Chloe Villeneuve
Updated Apr 26, 2026

Question details

How to find a minimum spanning tree using Kruskal's and Prim's algorithms?

I am studying graph theory and I need to understand minimum spanning trees (MST). A spanning tree of a connected, undirected graph is a subgraph that is a tree and includes all vertices. I know two algorithms: 1. Kruskal's algorithm: Sort edges by weight, add edges one by one if they don't form a cycle 2. Prim's algorithm: Start from a vertex, repeatedly add the smallest edge connecting the tree to a vertex outside My questions: 1. Why do these algorithms work (correctness proof)? 2. What are the time complexities of each? 3. When should I use Kruskal vs Prim? 4. How do I detect cycles efficiently in Kruskal's algorithm? 5. Can I apply MST to a real-world problem like designing a fiber optic network connecting cities? For example, find the MST of the graph with vertices A-F and edges: AB:4, AC:2, BC:1, BD:5, CD:8, CE:10, DE:2, DZ:6, EZ:3.

more
1338
IM
Updated Apr 22, 2026

Question details

How to solve recurrence relations using the characteristic equation method?

I am studying discrete mathematics and I need to solve linear recurrence relations. For example: aₙ = 5a_(n-1) - 6a_(n-2), a₀ = 1, a₁ = 2 I know the characteristic equation is r² - 5r + 6 = 0, giving r = 2, 3, and the general solution is aₙ = α(2ⁿ) + β(3ⁿ). But what happens when: 1. The characteristic equation has repeated roots (e.g., aₙ = 4a_(n-1) - 4a_(n-2))? 2. The recurrence is non-homogeneous (e.g., aₙ = 3a_(n-1) + 2ⁿ)? 3. The recurrence has complex roots? Can someone explain the complete solution method for each case?

more
1110
DT
Updated Apr 22, 2026

Question details

How to find the chromatic number of a graph and prove it with graph coloring?

I am studying graph theory and I need to understand graph coloring. A proper coloring assigns colors to vertices so that adjacent vertices have different colors. The chromatic number χ(G) is the minimum number of colors needed. My questions: 1. How do I find the chromatic number of simple graphs like Cₙ (cycle), Kₙ (complete), and K_(m,n) (complete bipartite)? 2. How do I prove that the chromatic number of a planar graph is at most 4 (Four Color Theorem)? 3. What is Brooks' theorem for upper bounds on χ(G)? 4. How do I use the greedy coloring algorithm? 5. What are the applications of graph coloring (scheduling, register allocation)? For example, find χ(G) for the Petersen graph.

more
1340
IM
Updated Apr 15, 2026

Question details

How to use the inclusion-exclusion principle for counting problems?

I am studying combinatorics and I understand the basic inclusion-exclusion principle for two sets: |A ∪ B| = |A| + |B| - |A ∩ B| But I need help with: 1. The general formula for n sets 2. A concrete example: How many integers from 1 to 100 are divisible by 2, 3, or 5? 3. How to handle problems where we want elements that belong to exactly one set (not just at least one)? I know the general formula involves alternating sums of intersections, but I get confused with the signs.

more
1210
TE
Updated Apr 12, 2026

Question details

How to use the Chinese Remainder Theorem for solving systems of congruences?

I am studying number theory and I need to understand the Chinese Remainder Theorem (CRT). Theorem: If m₁, m₂, \ldots, m_k are pairwise coprime, then the system: \begin{align*} x &\equiv a_1 \pmod{m_1} \\ x &\equiv a_2 \pmod{m_2} \\ &\vdots \\ x &\equiv a_k \pmod{m_k} \end{align*} has a unique solution modulo M = m₁ m₂ ⋯ m_k. My questions: 1. Why does CRT work intuitively? 2. How do I compute the solution for: x ≡ 2 (mod 3), x ≡ 3 (mod 5), x ≡ 2 (mod 7) 3. How is CRT used in RSA decryption to speed up computations? 4. What happens if the moduli are NOT coprime? How do I handle it? 5. How does CRT generalise to rings (the CRT for rings)? I want the constructive proof with step-by-step computation.

more
1307
LH
Updated Apr 9, 2026

Question details

How to construct truth tables and prove logical equivalence in propositional logic?

I am learning discrete mathematics and I need help with propositional logic. I understand the basic connectives: \land (and), \lor (or), ¬ (not), → (implies), \leftrightarrow (iff). My questions: 1. How do I construct a truth table for a compound proposition like ¬(p \lor q) \leftrightarrow (¬ p \land ¬ q)? 2. What does it mean for two propositions to be logically equivalent? 3. How do I prove De Morgan's laws without truth tables? 4. What is the difference between a tautology, contradiction, and contingency? Also, how can I simplify (p → q) \land (p → r) into a single implication?

more
1207
IM
Updated Apr 8, 2026

Question details

How to find the number of solutions to a linear Diophantine equation?

I am studying number theory and I need to understand Diophantine equations — equations where only integer solutions are allowed. Consider: 3x + 5y = 17 1. How do I determine if integer solutions exist? 2. If they exist, how do I find all solutions? 3. How do I restrict to non-negative solutions? 4. What is the general method for solving ax + by = c where a, b, c ∈ ℤ? I know the condition involves gcd(a,b) c, but I need the full solution method with an example.

more
187