├── Certificate ├── Certificate.jpg └── Certificate.pdf ├── Combinatorics and Probability ├── Certificate │ ├── Certificate.jpg │ └── Certificate.pdf ├── Week1 │ ├── 01_starting_to_count.pdf │ ├── 02_recursive_counting.pdf │ ├── 03_tuples_and_permutations.pdf │ ├── Practice Quiz: Numbers Divisible by 2 or 3.png │ ├── Puzzle: Number of Paths │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ ├── Level 3.png │ │ └── Level 4.png │ ├── Quiz: Applications of the Rule of Product.png │ ├── Quiz: Counting with Restrictions.png │ ├── Quiz: Generalized Rule of Sum.png │ ├── Quiz: Operations with Sets.png │ ├── Quiz: Rule of Product in Programming.png │ ├── Quiz: Rule of Sum in Programming.png │ ├── Quiz: Tuples.png │ └── README.md ├── Week2 │ ├── Practice Quiz: Number of Iterations of Nested For Loops.png │ ├── Quiz: Expanding (3a-2b)^k.png │ ├── Quiz: Forming Sport Teams.png │ ├── Quiz: Number of Segments and Diagonals.png │ ├── Quiz: Practice Counting.png │ ├── Quiz: Sum of the First Six Rows of Pascal's Triangle.png │ ├── README.md │ ├── combinations.pdf │ ├── pascal_triangle.pdf │ └── practice_counting.pdf ├── Week3 │ ├── 231_combinations_with_repetitions.pdf │ ├── 232_problems_in_combinatorics.pdf │ ├── Practice Quiz: Distributing Assignments Among People.png │ ├── Practice Quiz: Distributing Candies Among Kids.png │ ├── Practice Quiz: Numbers with Fixed Sum of Digits.png │ ├── Practice Quiz: Numbers with Non-increasing Digits.png │ ├── Practice Quiz: Splitting into Working Groups.png │ ├── Quiz: Combinations with Repetitions.png │ ├── Quiz: Problems in Combinatorics.png │ ├── Quiz: Salads.png │ └── README.md ├── Week4 │ ├── 241_what_is_probability.pdf │ ├── 242_probability_dos_and_donts.pdf │ ├── 243_conditional_probability.pdf │ ├── 244_monty_hall_paradox.pdf │ ├── Puzzle: Prisoner and King │ │ └── A Prisoner and a King.png │ ├── Quiz: Computing Conditional Probabilities.png │ ├── Quiz: Computing Probabilities for Two Dice.png │ ├── Quiz: Computing Probabilities: More Examples.png │ ├── Quiz: Concentration for Galton Board.png │ ├── Quiz: Fair Decisions and Imperfect Coins.png │ ├── Quiz: Inclusion-Exclusion Formula.png │ ├── Quiz: Monty Hall Gone Crazy.png │ ├── Quiz: More About Independence.png │ ├── Quiz: More Conditional Probabilities.png │ ├── Quiz: Prisoner, King and Conditional Probabilities.png │ └── README.md ├── Week5 │ ├── 251_random_variables.pdf │ ├── 252_linearity.pdf │ ├── 253_expectation_is_not.pdf │ ├── 254_markov_inequality.pdf │ ├── Quiz: Alice’s tests.png │ ├── Quiz: Average Income.png │ ├── Quiz: Average.png │ ├── Quiz: Bob’s Party Revisited.png │ ├── Quiz: Bob’s Party.png │ ├── Quiz: Expectations.png │ ├── Quiz: Linearity of Expectation.png │ ├── Quiz: More Linearity.png │ ├── Quiz: Random Variables.png │ └── README.md └── Week6 │ ├── 261_dice_game_problem.pdf │ ├── 262_project_discription.pdf │ ├── Quiz: Final Project: Dice Game.png │ └── README.md ├── Delivery Problem ├── Certificate │ ├── Certificate.jpg │ └── Certificate.pdf ├── Week1 │ ├── Notebook: Average Weight: Examples │ │ └── Expected.ipynb │ ├── Notebook: Draw Hamiltonian cycles │ │ └── Plot.ipynb │ ├── Quiz: Average Weight.png │ ├── Quiz: Brute Force Algorithm.png │ ├── Quiz: Cycle Weight.png │ ├── Quiz: Nearest Neighbors.png │ ├── README.md │ └── tsp.pdf ├── Week2 │ ├── Dynamic Programming.png │ ├── Quiz: Branch and Bound.png │ └── README.md └── Week3 │ ├── Notebook: 2-Approximation. Examples │ └── Approximation.ipynb │ ├── Quiz: 2-Approximation.png │ └── README.md ├── Introduction to Graph Theory ├── Certificate │ ├── Certificate.jpg │ └── Certificate.pdf ├── Week1 │ ├── Notebook: Graph Drawing Example │ │ └── Drawing Graphs.ipynb │ ├── Puzzle: Bridges of Königsberg │ │ ├── Level 1.png │ │ └── Level 2.png │ ├── Puzzle: Guarini's Puzzle │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Puzzle: Make a Tree │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Quiz: Definitions.png │ ├── Quiz: Graph Types.png │ ├── README.md │ ├── m1_l1_warmup.pdf │ ├── m1_l2_why_graphs.pdf │ ├── m1_l3_basic_definitions.pdf │ ├── m1_l4_basic_graphs.pdf │ └── week1.pdf ├── Week2 │ ├── Notebook: Connected Components │ │ └── Connected Components.ipynb │ ├── Notebook: Eulerian Cycles │ │ └── Eulerian Cycles.ipynb │ ├── Notebook: Guarini Puzzle Solver │ │ └── Guarini Solver.ipynb │ ├── Notebook: Strongly Connected Components │ │ └── Strongly Connected Components.ipynb │ ├── Notebook: Topological Sorting │ │ └── Topological Sort.ipynb │ ├── Puzzle: Connect Points by Segments │ │ ├── Level 1.png │ │ └── Level 2.png │ ├── Puzzle: Hamiltonian Cycle │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Quiz: Computing the Number of Edges.png │ ├── Quiz: Eulerian Cycles.png │ ├── Quiz: Number of Connected Components.png │ ├── Quiz: Number of Strongly Connected Components.png │ ├── README.md │ ├── connectedcomponents.pdf │ ├── eulerian_hamiltonian.pdf │ ├── handshaking.pdf │ └── week2.pdf ├── Week3 │ ├── Notebook: Maximum Matching │ │ └── Maximum Matching.ipynb │ ├── Notebook: Minimum Spanning Tree │ │ └── Minimum Spanning Tree.ipynb │ ├── Puzzle: Job Assignment │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Puzzle: Road Repair │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Puzzle: Subway Lines │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Quiz: Bipartite Graphs.png │ ├── Quiz: Planar Graphs.png │ ├── Quiz: Trees.png │ ├── README.md │ ├── m3_l1_trees.pdf │ ├── m3_l2_bipartite_graphs.pdf │ ├── m3_l3_planar_graphs.pdf │ └── week3.pdf ├── Week4 │ ├── Notebook: Maximum Clique │ │ └── Maximum Clique.ipynb │ ├── Puzzle: Antivirus System │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Puzzle: Balanced Graphs │ │ ├── Level 1.png │ │ └── Level 2.png │ ├── Puzzle: Graph Cliques │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Puzzle: Map Coloring │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Quiz: Cliques and Independent Sets.png │ ├── Quiz: Graph Coloring.png │ ├── Quiz: Ramsey Numbers.png │ ├── Quiz: Vertex Covers.png │ ├── README.md │ ├── m4_l1_graph_coloring.pdf │ ├── m4_l2_cliques_and_independent_sets.pdf │ ├── m4_l3_ramsey_numbers.pdf │ ├── m4_l4_vertex_cover.pdf │ └── week4.pdf └── Week5 │ ├── Practice Quiz: Constant Degree Bipartite Graphs.png │ ├── Quiz: Algorithm.png │ ├── Quiz: Base Cases.png │ ├── Quiz: Choose an Augmenting Path Carefully.png │ ├── README.md │ ├── ff.pdf │ ├── notes.pdf │ ├── stable.pdf │ └── week5.pdf ├── LICENSE ├── Mathematical Thinking in Computer Science ├── Certificate │ ├── Certificate.jpg │ └── Certificate.pdf ├── Week1 │ ├── 02_existence_proof.pdf │ ├── Puzzle: Pluses, Minuses and Splitting │ │ ├── Level 1.png │ │ └── Level 2.png │ ├── Puzzle: Two Congruent Parts │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Quiz: Tiles, dominos, black and white, even and odd.png │ ├── README.md │ └── WhyProofs.pdf ├── Week2 │ ├── 03_how_to_find_an_example.pdf │ ├── Puzzle: 16 Diagonals (Optional) │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Puzzle: Different People Have Different Coins │ │ └── Puzzle: Different People Have Different Coins.png │ ├── Puzzle: Free accomodation │ │ ├── Level 1.png │ │ └── Level 2.png │ ├── Puzzle: Magic Square 3 times 3 │ │ └── Puzzle: Magic Square 3 times 3.png │ ├── Puzzle: Maximum Number of Bishops on a Chessboard │ │ └── Puzzle: Maximum Number of Bishops on a Chessboard.png │ ├── Puzzle: Maximum Number of Knights on a Chessboard │ │ └── Puzzle: Maximum Number of Knights on a Chessboard.png │ ├── Puzzle: Maximum Number of Rooks on a Chessboard │ │ └── Puzzle: Maximum Number of Rooks on a Chessboard.png │ ├── Puzzle: N Queens (Optional) │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ ├── Level 3.png │ │ ├── Level 4.png │ │ └── Level 5.png │ ├── Puzzle: Subset without x and 2x │ │ └── Puzzle: Subset without x and 2x.png │ ├── Quiz: Is there....png │ ├── Quiz: Maximum Number of Two-digit Integers.png │ ├── Quiz: Number of Solutions for the 8 Queens Puzzle (Optional).png │ ├── README.md │ ├── computersearch.pdf │ └── optimality.pdf ├── Week3 │ ├── 07_induction.pdf │ ├── Bernoulli's Inequality.ipynb │ ├── Puzzle: Connect Points │ │ ├── Level 1.png │ │ └── Level 2.png │ ├── Puzzle: Hanoi Towers │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Puzzle: Two Cells of Opposite Colors │ │ └── Puzzle: Two Cells of Opposite Colors.png │ ├── Quiz: Induction.png │ ├── Quiz: Largest Amount that Cannot Be Paid with 5- and 7-Coins.png │ ├── Quiz: Number of Moves to Solve the Hanoi Towers Puzzle.png │ ├── Quiz: Pay Any Large Amount with 5- and 7-Coins.png │ ├── README.md │ └── recursion.pdf ├── Week4 │ ├── 08_logic.pdf │ ├── 09_php.pdf │ ├── Puzzle: Always Prime? │ │ └── Puzzle: Always Prime?.png │ ├── Puzzle: An (-1,0,1) Antimagic Square │ │ └── Puzzle: An (-1,0,1) Antimagic Square.png │ ├── Puzzle: Balls in Boxes │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ └── Level 3.png │ ├── Puzzle: Numbers in Boxes │ │ └── Puzzle: Numbers in Boxes.png │ ├── Puzzle: Numbers on the Chessboard │ │ └── Puzzle: Numbers on the Chessboard.png │ ├── Quiz: Examples, Counterexamples and Logic.png │ ├── Quiz: How to Pick Socks.png │ ├── Quiz: Numbers in Boxes.png │ ├── Quiz: Pigeonhole Principle.png │ └── README.md ├── Week5 │ ├── 10_double_counting.pdf │ ├── 11_invariants.pdf │ ├── 12_termination.pdf │ ├── 13_even_and_odd.pdf │ ├── Practice Quiz: Coffee with Milk.png │ ├── Practice Quiz: Football Fans.png │ ├── Practice Quiz: More Coffee.png │ ├── Puzzle: Arthur's Books │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ ├── Level 3.png │ │ ├── Level 4.png │ │ ├── Level 5.png │ │ └── Level 6.png │ ├── Puzzle: Piece on a Chessboard │ │ ├── Level 1.png │ │ └── Level 2.png │ ├── Puzzle: Summing Up Digits │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ ├── Level 3.png │ │ └── Level 4.png │ ├── Puzzle: Sums of Rows and Columns │ │ └── Puzzle: Sums of Rows and Columns.png │ ├── Puzzle: Switching Signs │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ ├── Level 3.png │ │ ├── Level 4.png │ │ ├── Level 5.png │ │ ├── Level 6.png │ │ └── Level 7.png │ ├── Quiz: 'Homework Assignment' Problem 2.png │ ├── Quiz: 'Homework Assignment' Problem.png │ ├── Quiz: Chess Tournaments.png │ ├── Quiz: Debugging Problem.png │ ├── Quiz: Merging Bank Accounts.png │ ├── Quiz: Operations on Even and Odd Numbers.png │ ├── Quiz: Recolouring Chessboard.png │ └── README.md └── Week6 │ ├── 15_game.pdf │ ├── Puzzle: 15 │ ├── Game 1.png │ ├── Game 2.png │ ├── Game 3.png │ ├── Game 4.png │ ├── Game 5.png │ └── Game 6.png │ ├── Quiz: Is a permutation even?.png │ ├── Quiz: Neighbor transpositions.png │ ├── Quiz: Transpositions and Permutations.png │ └── README.md ├── Number Theory and Cryptography ├── Certificate │ ├── Certificate.jpg │ └── Certificate.pdf ├── Week1 │ ├── 411_divisibility.pdf │ ├── 412_division_by_2.pdf │ ├── 413_modular_arithmetic.pdf │ ├── Practice Quiz: Division by 101.png │ ├── Practice Quiz: Division by 4.png │ ├── Practice Quiz: Four Numbers.png │ ├── Quiz: Binary System.png │ ├── Quiz: Divisibility Tests.png │ ├── Quiz: Divisibility.png │ ├── Quiz: Division by 2.png │ ├── Quiz: Modular Arithmetic.png │ ├── Quiz: Modular Division.png │ ├── Quiz: Properties of Divisibility.png │ ├── Quiz: Remainders of Large Numbers.png │ ├── Quiz: Remainders.png │ ├── README.md │ └── Take the Last Rock │ │ ├── Level 1.png │ │ ├── Level 2.png │ │ ├── Level 3.png │ │ ├── Level 4.png │ │ ├── Level 5.png │ │ ├── Level 6.png │ │ └── Level 7.png ├── Week2 │ ├── Practice Quiz: Diophantine Equations.png │ ├── Practice Quiz: Greatest Common Divisor.png │ ├── Practice Quiz: Least Common Multiple.png │ ├── Quiz: Diophantine Equations: Code.png │ ├── Quiz: Least Common Multiple: Code.png │ ├── Quiz: Modular Division: Code.png │ ├── Quiz: Tile a Rectangle with Squares.png │ ├── README.md │ ├── c4_m2_l1_Euclids_Algorithm.pdf │ └── c4_m2_l2_Applications.pdf ├── Week3 │ ├── Arrange Apples │ │ ├── Level 1.png │ │ └── Level 2.png │ ├── Quiz: Chinese Remainder Theorem.png │ ├── Quiz: Modular Exponentiation.png │ ├── Quiz: Remainders.png │ ├── README.md │ ├── chinese_remainder_theorem.pdf │ ├── integer_factorization.pdf │ ├── introduction.pdf │ └── modular_exponentiation.pdf └── Week4 │ ├── Notebook: Many Time Pad Attack │ └── One-time Pad.ipynb │ ├── Notebook: RSA Quest Notebook │ └── RSA Quest.ipynb │ ├── Quiz: RSA Quiz.png │ ├── README.md │ ├── cryptography.pdf │ ├── rsa-attacks.pdf │ └── rsa.pdf └── README.md /Certificate/Certificate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Certificate/Certificate.jpg -------------------------------------------------------------------------------- /Certificate/Certificate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Certificate/Certificate.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Certificate/Certificate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Certificate/Certificate.jpg -------------------------------------------------------------------------------- /Combinatorics and Probability/Certificate/Certificate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Certificate/Certificate.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/01_starting_to_count.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/01_starting_to_count.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/02_recursive_counting.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/02_recursive_counting.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/03_tuples_and_permutations.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/03_tuples_and_permutations.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Practice Quiz: Numbers Divisible by 2 or 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Practice Quiz: Numbers Divisible by 2 or 3.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Puzzle: Number of Paths/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Puzzle: Number of Paths/Level 1.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Puzzle: Number of Paths/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Puzzle: Number of Paths/Level 2.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Puzzle: Number of Paths/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Puzzle: Number of Paths/Level 3.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Puzzle: Number of Paths/Level 4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Puzzle: Number of Paths/Level 4.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Quiz: Applications of the Rule of Product.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Quiz: Applications of the Rule of Product.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Quiz: Counting with Restrictions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Quiz: Counting with Restrictions.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Quiz: Generalized Rule of Sum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Quiz: Generalized Rule of Sum.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Quiz: Operations with Sets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Quiz: Operations with Sets.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Quiz: Rule of Product in Programming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Quiz: Rule of Product in Programming.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Quiz: Rule of Sum in Programming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Quiz: Rule of Sum in Programming.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/Quiz: Tuples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week1/Quiz: Tuples.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week1/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: Number of Paths](http://dm.compsciclub.ru/app/quiz-number-of-paths) 2 | -------------------------------------------------------------------------------- /Combinatorics and Probability/Week2/Practice Quiz: Number of Iterations of Nested For Loops.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week2/Practice Quiz: Number of Iterations of Nested For Loops.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week2/Quiz: Expanding (3a-2b)^k.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week2/Quiz: Expanding (3a-2b)^k.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week2/Quiz: Forming Sport Teams.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week2/Quiz: Forming Sport Teams.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week2/Quiz: Number of Segments and Diagonals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week2/Quiz: Number of Segments and Diagonals.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week2/Quiz: Practice Counting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week2/Quiz: Practice Counting.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week2/Quiz: Sum of the First Six Rows of Pascal's Triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week2/Quiz: Sum of the First Six Rows of Pascal's Triangle.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week2/README.md: -------------------------------------------------------------------------------- 1 | Thanks !!! 2 | -------------------------------------------------------------------------------- /Combinatorics and Probability/Week2/combinations.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week2/combinations.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week2/pascal_triangle.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week2/pascal_triangle.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week2/practice_counting.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week2/practice_counting.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week3/231_combinations_with_repetitions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week3/231_combinations_with_repetitions.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week3/232_problems_in_combinatorics.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week3/232_problems_in_combinatorics.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week3/Practice Quiz: Distributing Assignments Among People.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week3/Practice Quiz: Distributing Assignments Among People.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week3/Practice Quiz: Distributing Candies Among Kids.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week3/Practice Quiz: Distributing Candies Among Kids.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week3/Practice Quiz: Numbers with Fixed Sum of Digits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week3/Practice Quiz: Numbers with Fixed Sum of Digits.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week3/Practice Quiz: Numbers with Non-increasing Digits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week3/Practice Quiz: Numbers with Non-increasing Digits.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week3/Practice Quiz: Splitting into Working Groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week3/Practice Quiz: Splitting into Working Groups.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week3/Quiz: Combinations with Repetitions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week3/Quiz: Combinations with Repetitions.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week3/Quiz: Problems in Combinatorics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week3/Quiz: Problems in Combinatorics.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week3/Quiz: Salads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week3/Quiz: Salads.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week3/README.md: -------------------------------------------------------------------------------- 1 | Thanks !!! 2 | -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/241_what_is_probability.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/241_what_is_probability.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/242_probability_dos_and_donts.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/242_probability_dos_and_donts.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/243_conditional_probability.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/243_conditional_probability.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/244_monty_hall_paradox.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/244_monty_hall_paradox.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/Puzzle: Prisoner and King/A Prisoner and a King.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/Puzzle: Prisoner and King/A Prisoner and a King.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/Quiz: Computing Conditional Probabilities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/Quiz: Computing Conditional Probabilities.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/Quiz: Computing Probabilities for Two Dice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/Quiz: Computing Probabilities for Two Dice.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/Quiz: Computing Probabilities: More Examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/Quiz: Computing Probabilities: More Examples.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/Quiz: Concentration for Galton Board.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/Quiz: Concentration for Galton Board.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/Quiz: Fair Decisions and Imperfect Coins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/Quiz: Fair Decisions and Imperfect Coins.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/Quiz: Inclusion-Exclusion Formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/Quiz: Inclusion-Exclusion Formula.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/Quiz: Monty Hall Gone Crazy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/Quiz: Monty Hall Gone Crazy.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/Quiz: More About Independence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/Quiz: More About Independence.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/Quiz: More Conditional Probabilities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/Quiz: More Conditional Probabilities.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/Quiz: Prisoner, King and Conditional Probabilities.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week4/Quiz: Prisoner, King and Conditional Probabilities.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week4/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: Prisoner and King](http://dm.compsciclub.ru/app/quiz-prisoner-and-king) 2 | -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/251_random_variables.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/251_random_variables.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/252_linearity.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/252_linearity.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/253_expectation_is_not.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/253_expectation_is_not.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/254_markov_inequality.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/254_markov_inequality.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/Quiz: Alice’s tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/Quiz: Alice’s tests.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/Quiz: Average Income.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/Quiz: Average Income.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/Quiz: Average.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/Quiz: Average.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/Quiz: Bob’s Party Revisited.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/Quiz: Bob’s Party Revisited.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/Quiz: Bob’s Party.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/Quiz: Bob’s Party.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/Quiz: Expectations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/Quiz: Expectations.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/Quiz: Linearity of Expectation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/Quiz: Linearity of Expectation.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/Quiz: More Linearity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/Quiz: More Linearity.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/Quiz: Random Variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week5/Quiz: Random Variables.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week5/README.md: -------------------------------------------------------------------------------- 1 | Thanks !!! 2 | -------------------------------------------------------------------------------- /Combinatorics and Probability/Week6/261_dice_game_problem.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week6/261_dice_game_problem.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week6/262_project_discription.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week6/262_project_discription.pdf -------------------------------------------------------------------------------- /Combinatorics and Probability/Week6/Quiz: Final Project: Dice Game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Combinatorics and Probability/Week6/Quiz: Final Project: Dice Game.png -------------------------------------------------------------------------------- /Combinatorics and Probability/Week6/README.md: -------------------------------------------------------------------------------- 1 | Thanks !!! 2 | -------------------------------------------------------------------------------- /Delivery Problem/Certificate/Certificate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Delivery Problem/Certificate/Certificate.jpg -------------------------------------------------------------------------------- /Delivery Problem/Certificate/Certificate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Delivery Problem/Certificate/Certificate.pdf -------------------------------------------------------------------------------- /Delivery Problem/Week1/Notebook: Average Weight: Examples/Expected.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": { 7 | "collapsed": true 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "import networkx as nx\n", 12 | "from itertools import permutations\n", 13 | "import math\n", 14 | "\n", 15 | "# This function computes the distance between two points.\n", 16 | "def dist(x1, y1, x2, y2):\n", 17 | " return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)" 18 | ] 19 | }, 20 | { 21 | "cell_type": "code", 22 | "execution_count": 2, 23 | "metadata": { 24 | "collapsed": true 25 | }, 26 | "outputs": [], 27 | "source": [ 28 | "# This function receives a list of 2-tuples representing the points' coordinates,\n", 29 | "# and returns the corresponding graph.\n", 30 | "def get_graph(coordinates):\n", 31 | " g = nx.Graph()\n", 32 | " n = len(coordinates)\n", 33 | " for i in range(n):\n", 34 | " for j in range(i + 1):\n", 35 | " g.add_edge(i, j, weight=dist(coordinates[i][0], coordinates[i][1], coordinates[j][0], coordinates[j][1]))\n", 36 | " return g" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": 3, 42 | "metadata": { 43 | "collapsed": true 44 | }, 45 | "outputs": [], 46 | "source": [ 47 | "# This function computes the weight of the given cycle.\n", 48 | "def cycle_length(g, cycle):\n", 49 | " # Checking that the number of vertices in the graph equals the number of vertices in the cycle.\n", 50 | " assert len(cycle) == g.number_of_nodes()\n", 51 | " # Write your code here.\n", 52 | " return sum(g[cycle[i]][cycle[i + 1]]['weight'] for i in range(len(cycle) - 1)) + g[cycle[0]][cycle[-1]]['weight']\n", 53 | "\n", 54 | "# This function iterates through all permutations and returns the length of an optimal cycle.\n", 55 | "# You can implement any other algorithm here and visualize it.\n", 56 | "#\n", 57 | "def all_permutations(g):\n", 58 | " # n is the number of vertices.\n", 59 | " n = g.number_of_nodes()\n", 60 | "\n", 61 | " # Iterate through all permutations of n vertices\n", 62 | " opt = float('inf')\n", 63 | " for p in permutations(range(n)):\n", 64 | " # Write your code here.\n", 65 | " opt = min(opt, cycle_length(g, p))\n", 66 | "\n", 67 | " return opt" 68 | ] 69 | }, 70 | { 71 | "cell_type": "code", 72 | "execution_count": 4, 73 | "metadata": {}, 74 | "outputs": [], 75 | "source": [ 76 | "# Insert your function computing the average length of Hamiltonian cycles here:\n", 77 | "def average(g):\n", 78 | " # n is the number of vertices.\n", 79 | " n = g.number_of_nodes()\n", 80 | "\n", 81 | " # Sum of weights of all n*(n-1)/2 edges.\n", 82 | " sum_of_weights = sum(g[i][j]['weight'] for i in range(n) for j in range(i))\n", 83 | "\n", 84 | " # Write your code here.\n", 85 | " res = 2 * sum_of_weights / (n-1)\n", 86 | " \n", 87 | " return res " 88 | ] 89 | }, 90 | { 91 | "cell_type": "code", 92 | "execution_count": 5, 93 | "metadata": {}, 94 | "outputs": [ 95 | { 96 | "name": "stdout", 97 | "output_type": "stream", 98 | "text": [ 99 | "Example 1. The length of an optimal cycle is 179.99995803749266\n", 100 | "Example 1. The average cycle length is 179.99995803749266\n", 101 | "Example 2. The length of an optimal cycle is 660.0\n", 102 | "Example 2. The average cycle length is 1430.4731342610064\n" 103 | ] 104 | } 105 | ], 106 | "source": [ 107 | "# Check how close an average solution is to an optimal one for the two following examples:\n", 108 | "coordinates1 = [\n", 109 | " (0,0),\n", 110 | " (60, 0),\n", 111 | " (30, 51.9615)\n", 112 | " ]\n", 113 | "\n", 114 | "coordinates2 = [\n", 115 | " (0, 0),\n", 116 | " (300, 0),\n", 117 | " (0, 10),\n", 118 | " (300, 10),\n", 119 | " (0, 20),\n", 120 | " (300, 20),\n", 121 | " (0, 30),\n", 122 | " (300, 30)\n", 123 | " ]\n", 124 | "\n", 125 | "g1 = get_graph(coordinates1)\n", 126 | "print(\"Example 1. The length of an optimal cycle is\", all_permutations(g1))\n", 127 | "print(\"Example 1. The average cycle length is\", average(g1))\n", 128 | "\n", 129 | "g2 = get_graph(coordinates2)\n", 130 | "print(\"Example 2. The length of an optimal cycle is\", all_permutations(g2))\n", 131 | "print(\"Example 2. The average cycle length is\", average(g2))\n", 132 | "\n", 133 | "# You might want to copy these coordinates into the previous Jupiter Notebook \n", 134 | "# to visualize the datasets and see other examples." 135 | ] 136 | } 137 | ], 138 | "metadata": { 139 | "kernelspec": { 140 | "display_name": "Python 3", 141 | "language": "python", 142 | "name": "python3" 143 | }, 144 | "language_info": { 145 | "codemirror_mode": { 146 | "name": "ipython", 147 | "version": 3 148 | }, 149 | "file_extension": ".py", 150 | "mimetype": "text/x-python", 151 | "name": "python", 152 | "nbconvert_exporter": "python", 153 | "pygments_lexer": "ipython3", 154 | "version": "3.6.2" 155 | } 156 | }, 157 | "nbformat": 4, 158 | "nbformat_minor": 2 159 | } 160 | -------------------------------------------------------------------------------- /Delivery Problem/Week1/Quiz: Average Weight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Delivery Problem/Week1/Quiz: Average Weight.png -------------------------------------------------------------------------------- /Delivery Problem/Week1/Quiz: Brute Force Algorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Delivery Problem/Week1/Quiz: Brute Force Algorithm.png -------------------------------------------------------------------------------- /Delivery Problem/Week1/Quiz: Cycle Weight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Delivery Problem/Week1/Quiz: Cycle Weight.png -------------------------------------------------------------------------------- /Delivery Problem/Week1/Quiz: Nearest Neighbors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Delivery Problem/Week1/Quiz: Nearest Neighbors.png -------------------------------------------------------------------------------- /Delivery Problem/Week1/README.md: -------------------------------------------------------------------------------- 1 | Thanks !!! 2 | -------------------------------------------------------------------------------- /Delivery Problem/Week1/tsp.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Delivery Problem/Week1/tsp.pdf -------------------------------------------------------------------------------- /Delivery Problem/Week2/Dynamic Programming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Delivery Problem/Week2/Dynamic Programming.png -------------------------------------------------------------------------------- /Delivery Problem/Week2/Quiz: Branch and Bound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Delivery Problem/Week2/Quiz: Branch and Bound.png -------------------------------------------------------------------------------- /Delivery Problem/Week2/README.md: -------------------------------------------------------------------------------- 1 | Thanks !!! 2 | -------------------------------------------------------------------------------- /Delivery Problem/Week3/Notebook: 2-Approximation. Examples/Approximation.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": { 7 | "collapsed": true 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "import networkx as nx\n", 12 | "import math\n", 13 | "\n", 14 | "\n", 15 | "# This function computes the distance between two points.\n", 16 | "def dist(x1, y1, x2, y2):\n", 17 | " return math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)\n", 18 | "\n", 19 | "\n", 20 | "# This function receives a list of 2-tuples representing the points' coordinates,\n", 21 | "# and returns the corresponding graph.\n", 22 | "def get_graph(coordinates):\n", 23 | " g = nx.Graph()\n", 24 | " n = len(coordinates)\n", 25 | " for i in range(n):\n", 26 | " for j in range(i + 1):\n", 27 | " g.add_edge(i, j, weight=dist(coordinates[i][0], coordinates[i][1], coordinates[j][0], coordinates[j][1]))\n", 28 | " return g\n", 29 | "\n", 30 | "# This function computes the weight of the given cycle.\n", 31 | "def cycle_length(g, cycle):\n", 32 | " # Checking that the number of vertices in the graph equals the number of vertices in the cycle.\n", 33 | " assert len(cycle) == g.number_of_nodes()\n", 34 | " # Write your code here.\n", 35 | " return sum(g[cycle[i]][cycle[i + 1]]['weight'] for i in range(len(cycle) - 1)) + g[cycle[0]][cycle[-1]]['weight']" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": 2, 41 | "metadata": { 42 | "collapsed": true 43 | }, 44 | "outputs": [], 45 | "source": [ 46 | "# Copy your implementation of the 2-approximation algorithm here.\n", 47 | "def approximation(g):\n", 48 | " # n is the number of vertices.\n", 49 | " n = g.number_of_nodes()\n", 50 | "\n", 51 | " # You might want to use the function \"nx.minimum_spanning_tree(g)\"\n", 52 | " # which returns a Minimum Spanning Tree of the graph g\n", 53 | " MST = nx.minimum_spanning_tree(g)\n", 54 | " # You also might want to use the command \"list(nx.dfs_preorder_nodes(graph, 0))\"\n", 55 | " # which gives a list of vertices of the given graph in depth-first preorder.\n", 56 | " dfs = list(nx.dfs_preorder_nodes(MST, 0))\n", 57 | " \n", 58 | " res = 0\n", 59 | " for i in range(1, len(dfs)):\n", 60 | " res += g[dfs[i-1]][dfs[i]]['weight']\n", 61 | " res += g[dfs[-1]][dfs[0]]['weight'] \n", 62 | " \n", 63 | " return res" 64 | ] 65 | }, 66 | { 67 | "cell_type": "code", 68 | "execution_count": 3, 69 | "metadata": {}, 70 | "outputs": [ 71 | { 72 | "name": "stdout", 73 | "output_type": "stream", 74 | "text": [ 75 | "Example 1. The length of an optimal cycle is 813.5762308235903\n", 76 | "Example 1. The length of the cycle found by 2-approximation is 813.5762308235903\n" 77 | ] 78 | } 79 | ], 80 | "source": [ 81 | "# Example 1.\n", 82 | "# Compare the output of your approximation to the optimal solution on the following example.\n", 83 | "coordinates = [(181, 243), (101, 143), (100, 216), (167, 15), (37, 201), (163, 226), (2, 42), (35, 73), (85, 116), (142, 235), (200, 18)]\n", 84 | "optimal_cycle = [0, 5, 9, 2, 4, 1, 8, 7, 6, 3, 10]\n", 85 | "g = get_graph(coordinates)\n", 86 | "optimal_length = cycle_length(g, optimal_cycle) # 813.5762308235903\n", 87 | "print(\"Example 1. The length of an optimal cycle is\", optimal_length)\n", 88 | "print(\"Example 1. The length of the cycle found by 2-approximation is\", approximation(g))" 89 | ] 90 | }, 91 | { 92 | "cell_type": "code", 93 | "execution_count": 4, 94 | "metadata": {}, 95 | "outputs": [ 96 | { 97 | "name": "stdout", 98 | "output_type": "stream", 99 | "text": [ 100 | "Example 2. The length of an optimal cycle is 3899.6569479386735\n", 101 | "Example 2. The length of the cycle found by 2-approximation is 5460.730953887033\n" 102 | ] 103 | } 104 | ], 105 | "source": [ 106 | "# Example 2.\n", 107 | "# Check how fast your algorithm works on the following graph on 300 vertices.\n", 108 | "# Also see how close an approximation solution is to an optimal one.\n", 109 | "coordinates = [(145, 176), (185, 244), (67, 192), (5, 137), (165, 154), (106, 286), (132, 173), (285, 143), (164, 115), (41, 181), (27, 137), (242, 190), (56, 208), (126, 240), (269, 221), (166, 43), (98, 296), (290, 194), (146, 67), (27, 138), (68, 283), (110, 42), (252, 41), (7, 219), (262, 205), (136, 251), (184, 240), (251, 29), (50, 148), (185, 299), (172, 106), (164, 198), (28, 88), (4, 236), (75, 42), (259, 158), (21, 38), (298, 277), (46, 97), (71, 1), (210, 173), (71, 296), (74, 227), (230, 136), (148, 278), (197, 257), (226, 29), (154, 258), (102, 162), (197, 274), (74, 12), (87, 102), (276, 65), (14, 60), (81, 184), (129, 49), (45, 68), (119, 61), (201, 45), (35, 14), (134, 173), (199, 218), (269, 233), (53, 78), (171, 167), (267, 123), (291, 245), (252, 202), (101, 262), (54, 250), (219, 300), (209, 7), (125, 230), (25, 90), (0, 144), (98, 7), (254, 94), (111, 78), (48, 175), (35, 207), (208, 192), (132, 37), (236, 97), (240, 211), (298, 265), (160, 153), (235, 279), (29, 53), (251, 213), (17, 169), (62, 11), (75, 20), (4, 115), (92, 4), (227, 61), (290, 41), (66, 15), (68, 224), (69, 265), (195, 88), (194, 129), (73, 129), (143, 119), (219, 28), (170, 260), (199, 51), (31, 300), (64, 138), (2, 100), (166, 13), (268, 131), (176, 131), (125, 283), (145, 41), (90, 208), (251, 136), (220, 142), (277, 278), (130, 228), (169, 263), (190, 207), (44, 15), (295, 162), (259, 209), (39, 2), (218, 129), (41, 203), (48, 12), (161, 20), (154, 263), (233, 205), (116, 190), (272, 289), (234, 109), (31, 100), (208, 61), (128, 25), (103, 205), (101, 159), (274, 255), (169, 22), (2, 202), (292, 240), (276, 133), (283, 94), (226, 31), (75, 247), (180, 88), (8, 215), (82, 156), (214, 231), (220, 4), (72, 136), (109, 37), (91, 158), (169, 10), (187, 184), (13, 70), (165, 133), (210, 93), (142, 212), (103, 234), (9, 286), (211, 283), (249, 264), (25, 187), (95, 146), (265, 126), (220, 191), (9, 125), (89, 148), (286, 156), (146, 273), (262, 23), (148, 281), (102, 300), (99, 297), (295, 178), (295, 83), (4, 228), (289, 141), (9, 42), (285, 241), (73, 108), (85, 73), (209, 150), (58, 158), (72, 65), (213, 108), (40, 72), (193, 201), (169, 98), (246, 125), (44, 180), (201, 145), (33, 42), (243, 91), (80, 93), (139, 240), (145, 101), (150, 162), (11, 229), (66, 280), (97, 84), (283, 58), (199, 14), (97, 200), (280, 231), (47, 249), (188, 89), (91, 55), (191, 94), (235, 153), (219, 72), (236, 286), (142, 132), (44, 71), (258, 236), (138, 62), (98, 154), (266, 194), (235, 165), (28, 157), (56, 155), (75, 115), (161, 67), (292, 28), (252, 249), (124, 9), (131, 14), (104, 225), (121, 80), (155, 171), (225, 71), (113, 262), (154, 47), (37, 76), (64, 97), (29, 287), (259, 279), (268, 235), (125, 88), (11, 58), (183, 171), (254, 167), (26, 63), (73, 271), (35, 265), (62, 110), (235, 104), (136, 152), (157, 69), (280, 157), (108, 58), (42, 9), (4, 92), (28, 183), (214, 75), (213, 2), (16, 27), (36, 149), (93, 210), (228, 209), (120, 273), (229, 18), (66, 164), (12, 220), (26, 14), (194, 164), (212, 167), (251, 282), (31, 268), (221, 66), (31, 102), (27, 91), (137, 85), (300, 178), (50, 225), (55, 95), (9, 157), (77, 291), (90, 268), (67, 169), (276, 5), (189, 102), (227, 263), (246, 99), (195, 189), (64, 77), (118, 211), (274, 130), (34, 117), (188, 23), (291, 252), (163, 295), (65, 113), (167, 278), (162, 286), (135, 77), (81, 27)]\n", 110 | "optimal_cycle = [0, 60, 6, 250, 215, 102, 199, 275, 298, 241, 231, 77, 203, 184, 187, 288, 63, 56, 216, 189, 236, 32, 73, 274, 134, 273, 291, 38, 278, 237, 197, 51, 183, 248, 295, 224, 101, 152, 107, 149, 154, 170, 166, 219, 138, 48, 54, 2, 12, 126, 79, 277, 97, 42, 146, 281, 68, 234, 263, 112, 5, 175, 176, 16, 280, 41, 20, 202, 246, 98, 69, 208, 247, 271, 238, 106, 162, 33, 179, 201, 266, 23, 148, 141, 165, 256, 9, 193, 78, 282, 265, 186, 223, 28, 260, 19, 10, 222, 89, 279, 74, 3, 169, 92, 108, 255, 157, 242, 53, 245, 87, 195, 36, 181, 259, 267, 59, 124, 254, 121, 127, 90, 96, 39, 50, 91, 299, 34, 210, 253, 57, 21, 153, 93, 75, 228, 229, 136, 81, 55, 218, 18, 251, 225, 235, 113, 15, 140, 128, 109, 155, 292, 205, 71, 258, 151, 264, 46, 145, 103, 58, 105, 135, 257, 213, 233, 272, 94, 22, 27, 173, 283, 226, 95, 204, 52, 178, 144, 76, 286, 196, 82, 249, 133, 188, 159, 99, 211, 284, 209, 147, 191, 30, 8, 158, 111, 100, 194, 185, 116, 125, 43, 212, 221, 244, 35, 115, 192, 65, 167, 110, 290, 143, 180, 7, 252, 171, 122, 276, 177, 17, 220, 24, 123, 14, 207, 62, 240, 217, 227, 139, 182, 142, 66, 293, 84, 37, 117, 132, 239, 270, 164, 285, 86, 214, 70, 163, 49, 45, 1, 26, 104, 119, 296, 29, 294, 297, 174, 44, 172, 129, 47, 25, 198, 13, 118, 72, 161, 230, 261, 114, 206, 137, 131, 289, 160, 31, 156, 287, 190, 120, 61, 150, 262, 130, 83, 88, 67, 11, 168, 80, 40, 269, 268, 243, 64, 4, 85, 200, 232]\n", 111 | "g = get_graph(coordinates)\n", 112 | "optimal_length = cycle_length(g, optimal_cycle) # 3899.6569479386735\n", 113 | "print(\"Example 2. The length of an optimal cycle is\", optimal_length)\n", 114 | "print(\"Example 2. The length of the cycle found by 2-approximation is\", approximation(g))\n", 115 | "\n", 116 | "# You might want to copy these coordinates to your Jupiter Notebook to visualize the datasets and see other examples." 117 | ] 118 | } 119 | ], 120 | "metadata": { 121 | "kernelspec": { 122 | "display_name": "Python 3", 123 | "language": "python", 124 | "name": "python3" 125 | }, 126 | "language_info": { 127 | "codemirror_mode": { 128 | "name": "ipython", 129 | "version": 3 130 | }, 131 | "file_extension": ".py", 132 | "mimetype": "text/x-python", 133 | "name": "python", 134 | "nbconvert_exporter": "python", 135 | "pygments_lexer": "ipython3", 136 | "version": "3.6.2" 137 | } 138 | }, 139 | "nbformat": 4, 140 | "nbformat_minor": 2 141 | } 142 | -------------------------------------------------------------------------------- /Delivery Problem/Week3/Quiz: 2-Approximation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Delivery Problem/Week3/Quiz: 2-Approximation.png -------------------------------------------------------------------------------- /Delivery Problem/Week3/README.md: -------------------------------------------------------------------------------- 1 | Thanks !!! 2 | -------------------------------------------------------------------------------- /Introduction to Graph Theory/Certificate/Certificate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Certificate/Certificate.jpg -------------------------------------------------------------------------------- /Introduction to Graph Theory/Certificate/Certificate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Certificate/Certificate.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/Puzzle: Bridges of Königsberg/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/Puzzle: Bridges of Königsberg/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/Puzzle: Bridges of Königsberg/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/Puzzle: Bridges of Königsberg/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/Puzzle: Guarini's Puzzle/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/Puzzle: Guarini's Puzzle/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/Puzzle: Guarini's Puzzle/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/Puzzle: Guarini's Puzzle/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/Puzzle: Guarini's Puzzle/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/Puzzle: Guarini's Puzzle/Level 3.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/Puzzle: Make a Tree/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/Puzzle: Make a Tree/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/Puzzle: Make a Tree/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/Puzzle: Make a Tree/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/Puzzle: Make a Tree/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/Puzzle: Make a Tree/Level 3.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/Quiz: Definitions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/Quiz: Definitions.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/Quiz: Graph Types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/Quiz: Graph Types.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: Guarini's Puzzle](http://dm.compsciclub.ru/app/quiz-guarinis-puzzle) 2 | 3 | [Puzzle: Bridges of Königsberg](http://dm.compsciclub.ru/app/quiz-bridges) 4 | 5 | [Puzzle: Make a Tree](http://dm.compsciclub.ru/app/quiz-make-a-tree) 6 | -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/m1_l1_warmup.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/m1_l1_warmup.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/m1_l2_why_graphs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/m1_l2_why_graphs.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/m1_l3_basic_definitions.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/m1_l3_basic_definitions.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/m1_l4_basic_graphs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/m1_l4_basic_graphs.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week1/week1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week1/week1.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/Notebook: Connected Components/Connected Components.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "data": { 10 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAcsAAAEbCAYAAAC1PK9oAAAABmJLR0QA/wD/AP+gvaeTAAAgAElE\nQVR4nO3de1zO9/8/8EcnpZIiLsKIEJUQEZ2cz42M2QFz2Mwx+8zmsM1izGlYbLYcN/uYfRxHZoyh\ndHAK6+icUipKrlyk4+v3x376MrUc6nq963rcbzc3N11d1/tx1VOP3u/rfb3eekIIASIiIipNor7s\nBERERErHsiQiIioDy5KIiKgMhrIDEBEBQH5+PtLT05Geno67d+9CCAG1Wo2ioiKYmZmhWrVqMDMz\ng6WlJRo0aAALCwvZkUmHsCyJSKs0Gg1OnDiB6OhoxMXFITo6GomJiUhPT8fznG9oamqKRo0aoVWr\nVnBwcICTkxNcXFxgZ2dXgelJV+nxbFgiqkgFBQUICQnBgQMHEBwcjLNnz6KgoAAqlQqOjo5wcHBA\ns2bN0LBhQ9SrVw8qlQq1atUCAFhYWMDAwAAajQb5+fl48OAB7ty5g+TkZKSnp+P69euIj49HTEwM\nLl++jPz8fNjY2MDb2xvdunWDj48P6tatK/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CXFwcrl27hsLCQlhYWKBr167w\n9PSEt7c3XF1ddfkbTM+I80lKxvmUTntl+U8ajQZxcXGIjo5GbGwsrl69itTUVKSkpCA9PR2FhYWl\n3rd69epo0KBB8XDY29vD0dERjo6OsLOzg4GBgRafCVVFnE9SMs6n1skry7I8+k1Io9EgPz8fpqam\nMDY2Lv5NiUgmzicpGeez3Cm3LImIiBQikQejiYiIysCyJCIiKoMhgEjZIYiIiBQs9f8BjQG8Ztiw\nq7IAAAAASUVORK5CYII=\n", 11 | "text/plain": [ 12 | "" 13 | ] 14 | }, 15 | "execution_count": 1, 16 | "metadata": {}, 17 | "output_type": "execute_result" 18 | } 19 | ], 20 | "source": [ 21 | "import networkx as nx\n", 22 | "import pygraphviz as pgv\n", 23 | "from nxpd import draw, nxpdParams\n", 24 | "nxpdParams['show'] = 'ipynb'\n", 25 | "\n", 26 | "\n", 27 | "G = nx.Graph()\n", 28 | "G.add_edges_from([('a', 'b'), ('t', 'c'), ('b', 'x'), ('c', 'q'), ('q', 't')])\n", 29 | "draw(G, layout='circo')" 30 | ] 31 | }, 32 | { 33 | "cell_type": "code", 34 | "execution_count": 2, 35 | "metadata": {}, 36 | "outputs": [ 37 | { 38 | "name": "stdout", 39 | "output_type": "stream", 40 | "text": [ 41 | "G has 2 connected components\n", 42 | "['a', 'b', 'x']\n", 43 | "['t', 'c', 'q']\n" 44 | ] 45 | } 46 | ], 47 | "source": [ 48 | "print(\"G has {} connected components\".format(nx.number_connected_components(G)))\n", 49 | "for cc in nx.connected_components(G):\n", 50 | " print(cc)" 51 | ] 52 | } 53 | ], 54 | "metadata": { 55 | "kernelspec": { 56 | "display_name": "Python 3", 57 | "language": "python", 58 | "name": "python3" 59 | }, 60 | "language_info": { 61 | "codemirror_mode": { 62 | "name": "ipython", 63 | "version": 3 64 | }, 65 | "file_extension": ".py", 66 | "mimetype": "text/x-python", 67 | "name": "python", 68 | "nbconvert_exporter": "python", 69 | "pygments_lexer": "ipython3", 70 | "version": "3.6.2" 71 | } 72 | }, 73 | "nbformat": 4, 74 | "nbformat_minor": 1 75 | } 76 | -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/Notebook: Guarini Puzzle Solver/Guarini Solver.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "raw_mimetype": "text/html" 7 | }, 8 | "source": [ 9 | "

In this notebook, we'll implement a program that we'll solve the Guarini puzzle in blink of an eye!

\n", 10 | "\n", 11 | "

Before starting to implement, let's agree on the following representation of a configuration. First, let's enumerate the eight essential cells of a 3x3 board as follows:\n", 12 | "

\n", 13 | "By a configuration we mean a placement of two white and two black knight on this board. We will represent it as a string of length eight. Its i-th symbol is equal to \"*\", if there is no knight in the i-th cell of the board. It is equal to \"B\" or \"W\", if the i-th cell contains a black or white knight, respectively. See an example below.\n", 14 | "

" 15 | ] 16 | }, 17 | { 18 | "cell_type": "markdown", 19 | "metadata": {}, 20 | "source": [ 21 | "We now start creating the graph of all configurations. Below, we iterate through all possible strings of length 8 with two W's and two B's. For this, we iterate through all possible four indices of W's and B's (out of eight possible positions). " 22 | ] 23 | }, 24 | { 25 | "cell_type": "code", 26 | "execution_count": 1, 27 | "metadata": { 28 | "collapsed": true 29 | }, 30 | "outputs": [], 31 | "source": [ 32 | "import networkx as nx\n", 33 | "import itertools as it\n", 34 | "\n", 35 | "G = nx.Graph()\n", 36 | "\n", 37 | "for wb_indices in it.permutations(range(8), 4):\n", 38 | " configuration = ['*'] * 8\n", 39 | " configuration[wb_indices[0]] = 'W'\n", 40 | " configuration[wb_indices[1]] = 'W'\n", 41 | " configuration[wb_indices[2]] = 'B'\n", 42 | " configuration[wb_indices[3]] = 'B'\n", 43 | "\n", 44 | " G.add_node(\"\".join(configuration))" 45 | ] 46 | }, 47 | { 48 | "cell_type": "markdown", 49 | "metadata": {}, 50 | "source": [ 51 | "We then add edges to the graph. For this, we first fill in a list moves: moves[i] are the numbers of cells where a knight can move from the i-th cell." 52 | ] 53 | }, 54 | { 55 | "cell_type": "code", 56 | "execution_count": 2, 57 | "metadata": { 58 | "collapsed": true 59 | }, 60 | "outputs": [], 61 | "source": [ 62 | "moves = [[] for _ in range(8)]\n", 63 | "moves[0] = [4, 6]\n", 64 | "moves[1] = [5, 7]\n", 65 | "moves[2] = [3, 6]\n", 66 | "moves[3] = [2, 7]\n", 67 | "moves[4] = [0, 5]\n", 68 | "moves[5] = [1, 4]\n", 69 | "moves[6] = [0, 2]\n", 70 | "moves[7] = [1, 3]" 71 | ] 72 | }, 73 | { 74 | "cell_type": "markdown", 75 | "metadata": {}, 76 | "source": [ 77 | "Adding edges to the graph:" 78 | ] 79 | }, 80 | { 81 | "cell_type": "code", 82 | "execution_count": 3, 83 | "metadata": { 84 | "collapsed": true 85 | }, 86 | "outputs": [], 87 | "source": [ 88 | "for node in G.nodes():\n", 89 | " configuration = [c for c in node]\n", 90 | "\n", 91 | " for i in range(8):\n", 92 | " if configuration[i] != \"*\":\n", 93 | " for new_pos in moves[i]:\n", 94 | " if configuration[new_pos] != \"*\":\n", 95 | " continue\n", 96 | " new_configuration = list(configuration)\n", 97 | "\n", 98 | " new_configuration[i] = \"*\"\n", 99 | " new_configuration[new_pos] = configuration[i]\n", 100 | "\n", 101 | " if not G.has_edge(\"\".join(configuration), \"\".join(new_configuration)):\n", 102 | " G.add_edge(\"\".join(configuration), \"\".join(new_configuration))" 103 | ] 104 | }, 105 | { 106 | "cell_type": "markdown", 107 | "metadata": {}, 108 | "source": [ 109 | "OK, the graph has been cooked! We can now analyze it. Let's first print its number of nodes, number of edges, and number of connected components." 110 | ] 111 | }, 112 | { 113 | "cell_type": "code", 114 | "execution_count": 4, 115 | "metadata": {}, 116 | "outputs": [ 117 | { 118 | "name": "stdout", 119 | "output_type": "stream", 120 | "text": [ 121 | "420\n", 122 | "960\n", 123 | "2\n" 124 | ] 125 | } 126 | ], 127 | "source": [ 128 | "print(nx.number_of_nodes(G))\n", 129 | "print(nx.number_of_edges(G))\n", 130 | "print(nx.number_connected_components(G))" 131 | ] 132 | }, 133 | { 134 | "cell_type": "markdown", 135 | "metadata": { 136 | "raw_mimetype": "text/html" 137 | }, 138 | "source": [ 139 | "

Well, the fact that the graph has two connected components is not surprising. The eight nodes of a 3x3 board form a cycle. Thus, one connected component contains all configurations where along this cycle two white knights are followed by two black knights, while the other connected components consists of all configurations where the white and black knights are interchanged.

" 140 | ] 141 | }, 142 | { 143 | "cell_type": "raw", 144 | "metadata": {}, 145 | "source": [ 146 | "Let’s now ensure that the configurations \"W*B**W*B\" and \"B*B**W*W\" are reachable from \"W*W**B*B\", while \"W*B**B*W\" is not." 147 | ] 148 | }, 149 | { 150 | "cell_type": "code", 151 | "execution_count": 5, 152 | "metadata": { 153 | "collapsed": true 154 | }, 155 | "outputs": [], 156 | "source": [ 157 | "assert \"W*B**W*B\" in nx.node_connected_component(G, \"W*W**B*B\")\n", 158 | "assert \"B*B**W*W\" in nx.node_connected_component(G, \"W*W**B*B\")\n", 159 | "assert \"W*B**B*W\" not in nx.node_connected_component(G, \"W*W**B*B\")" 160 | ] 161 | }, 162 | { 163 | "cell_type": "markdown", 164 | "metadata": {}, 165 | "source": [ 166 | "The number of connected components of the resulting graph of configurations is not the only interesting property! We can now easily find an optimal (i.e., shortest) way of getting from one configuration to another one:" 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": 6, 172 | "metadata": {}, 173 | "outputs": [ 174 | { 175 | "name": "stdout", 176 | "output_type": "stream", 177 | "text": [ 178 | "W*W**B*B -> WBW**B** -> WBW*B*** -> *BW*B*W* -> BBW***W* -> B*W**BW* -> B*W*B*W* -> B**WB*W* -> B*WWB*** -> **WWB*B* -> B*WW**B* -> B*W***BW -> BWW***B* -> BW*W**B* -> BWBW**** -> BWB****W -> B*B**W*W\n" 179 | ] 180 | } 181 | ], 182 | "source": [ 183 | "print(\" -> \".join(nx.shortest_path(G, \"W*W**B*B\", \"B*B**W*W\")))" 184 | ] 185 | } 186 | ], 187 | "metadata": { 188 | "celltoolbar": "Raw Cell Format", 189 | "kernelspec": { 190 | "display_name": "Python 3", 191 | "language": "python", 192 | "name": "python3" 193 | }, 194 | "language_info": { 195 | "codemirror_mode": { 196 | "name": "ipython", 197 | "version": 3 198 | }, 199 | "file_extension": ".py", 200 | "mimetype": "text/x-python", 201 | "name": "python", 202 | "nbconvert_exporter": "python", 203 | "pygments_lexer": "ipython3", 204 | "version": "3.6.2" 205 | } 206 | }, 207 | "nbformat": 4, 208 | "nbformat_minor": 1 209 | } 210 | -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/Puzzle: Connect Points by Segments/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/Puzzle: Connect Points by Segments/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/Puzzle: Connect Points by Segments/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/Puzzle: Connect Points by Segments/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/Puzzle: Hamiltonian Cycle/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/Puzzle: Hamiltonian Cycle/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/Puzzle: Hamiltonian Cycle/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/Puzzle: Hamiltonian Cycle/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/Puzzle: Hamiltonian Cycle/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/Puzzle: Hamiltonian Cycle/Level 3.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/Quiz: Computing the Number of Edges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/Quiz: Computing the Number of Edges.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/Quiz: Eulerian Cycles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/Quiz: Eulerian Cycles.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/Quiz: Number of Connected Components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/Quiz: Number of Connected Components.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/Quiz: Number of Strongly Connected Components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/Quiz: Number of Strongly Connected Components.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: Connect Points by Segments](http://dm.compsciclub.ru/app/quiz-regular-graph) 2 | 3 | [Puzzle: Hamiltonian Cycle](http://dm.compsciclub.ru/app/quiz-hamiltonian-cycle) 4 | -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/connectedcomponents.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/connectedcomponents.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/eulerian_hamiltonian.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/eulerian_hamiltonian.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/handshaking.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/handshaking.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week2/week2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week2/week2.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Puzzle: Job Assignment/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Puzzle: Job Assignment/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Puzzle: Job Assignment/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Puzzle: Job Assignment/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Puzzle: Job Assignment/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Puzzle: Job Assignment/Level 3.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Puzzle: Road Repair/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Puzzle: Road Repair/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Puzzle: Road Repair/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Puzzle: Road Repair/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Puzzle: Road Repair/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Puzzle: Road Repair/Level 3.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Puzzle: Subway Lines/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Puzzle: Subway Lines/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Puzzle: Subway Lines/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Puzzle: Subway Lines/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Puzzle: Subway Lines/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Puzzle: Subway Lines/Level 3.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Quiz: Bipartite Graphs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Quiz: Bipartite Graphs.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Quiz: Planar Graphs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Quiz: Planar Graphs.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/Quiz: Trees.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/Quiz: Trees.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: Road Repair](http://dm.compsciclub.ru/app/quiz-road-repair) 2 | 3 | [Puzzle: Job Assignment](http://dm.compsciclub.ru/app/quiz-job-assignment) 4 | 5 | [Puzzle: Subway Lines](http://dm.compsciclub.ru/app/quiz-subway-lines) 6 | -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/m3_l1_trees.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/m3_l1_trees.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/m3_l2_bipartite_graphs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/m3_l2_bipartite_graphs.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/m3_l3_planar_graphs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/m3_l3_planar_graphs.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week3/week3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week3/week3.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Puzzle: Antivirus System/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Puzzle: Antivirus System/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Puzzle: Antivirus System/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Puzzle: Antivirus System/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Puzzle: Antivirus System/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Puzzle: Antivirus System/Level 3.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Puzzle: Balanced Graphs/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Puzzle: Balanced Graphs/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Puzzle: Balanced Graphs/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Puzzle: Balanced Graphs/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Puzzle: Graph Cliques/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Puzzle: Graph Cliques/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Puzzle: Graph Cliques/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Puzzle: Graph Cliques/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Puzzle: Graph Cliques/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Puzzle: Graph Cliques/Level 3.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Puzzle: Map Coloring/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Puzzle: Map Coloring/Level 1.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Puzzle: Map Coloring/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Puzzle: Map Coloring/Level 2.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Puzzle: Map Coloring/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Puzzle: Map Coloring/Level 3.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Quiz: Cliques and Independent Sets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Quiz: Cliques and Independent Sets.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Quiz: Graph Coloring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Quiz: Graph Coloring.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Quiz: Ramsey Numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Quiz: Ramsey Numbers.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/Quiz: Vertex Covers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/Quiz: Vertex Covers.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: Map Coloring](http://dm.compsciclub.ru/app/quiz-map-coloring) 2 | 3 | [Puzzle: Graph Cliques](http://dm.compsciclub.ru/app/quiz-graph-cliques) 4 | 5 | [Puzzle: Balanced Graphs](http://dm.compsciclub.ru/app/quiz-balanced-graphs) 6 | 7 | [Puzzle: Antivirus System](http://dm.compsciclub.ru/app/quiz-antivirus-system) 8 | -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/m4_l1_graph_coloring.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/m4_l1_graph_coloring.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/m4_l2_cliques_and_independent_sets.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/m4_l2_cliques_and_independent_sets.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/m4_l3_ramsey_numbers.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/m4_l3_ramsey_numbers.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/m4_l4_vertex_cover.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/m4_l4_vertex_cover.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week4/week4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week4/week4.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week5/Practice Quiz: Constant Degree Bipartite Graphs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week5/Practice Quiz: Constant Degree Bipartite Graphs.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week5/Quiz: Algorithm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week5/Quiz: Algorithm.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week5/Quiz: Base Cases.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week5/Quiz: Base Cases.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week5/Quiz: Choose an Augmenting Path Carefully.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week5/Quiz: Choose an Augmenting Path Carefully.png -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week5/README.md: -------------------------------------------------------------------------------- 1 | Thanks !!! 2 | -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week5/ff.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week5/ff.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week5/notes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week5/notes.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week5/stable.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week5/stable.pdf -------------------------------------------------------------------------------- /Introduction to Graph Theory/Week5/week5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Introduction to Graph Theory/Week5/week5.pdf -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Chanchal Kumar Maji 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Certificate/Certificate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Certificate/Certificate.jpg -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Certificate/Certificate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Certificate/Certificate.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week1/02_existence_proof.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week1/02_existence_proof.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week1/Puzzle: Pluses, Minuses and Splitting/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week1/Puzzle: Pluses, Minuses and Splitting/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week1/Puzzle: Pluses, Minuses and Splitting/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week1/Puzzle: Pluses, Minuses and Splitting/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week1/Puzzle: Two Congruent Parts/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week1/Puzzle: Two Congruent Parts/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week1/Puzzle: Two Congruent Parts/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week1/Puzzle: Two Congruent Parts/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week1/Puzzle: Two Congruent Parts/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week1/Puzzle: Two Congruent Parts/Level 3.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week1/Quiz: Tiles, dominos, black and white, even and odd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week1/Quiz: Tiles, dominos, black and white, even and odd.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week1/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: Tile a Chessboard](http://dm.compsciclub.ru/app/quiz-chessboard-tiling) 2 | 3 | [Puzzle: Two Congruent Parts](http://dm.compsciclub.ru/app/quiz-cut-the-figure) 4 | 5 | [Puzzle: Pluses, Minuses and Splitting](http://dm.compsciclub.ru/app/quiz-split-weights) 6 | -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week1/WhyProofs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week1/WhyProofs.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/03_how_to_find_an_example.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/03_how_to_find_an_example.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: 16 Diagonals (Optional)/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: 16 Diagonals (Optional)/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: 16 Diagonals (Optional)/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: 16 Diagonals (Optional)/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: 16 Diagonals (Optional)/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: 16 Diagonals (Optional)/Level 3.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: Different People Have Different Coins/Puzzle: Different People Have Different Coins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: Different People Have Different Coins/Puzzle: Different People Have Different Coins.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: Free accomodation/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: Free accomodation/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: Free accomodation/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: Free accomodation/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: Magic Square 3 times 3/Puzzle: Magic Square 3 times 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: Magic Square 3 times 3/Puzzle: Magic Square 3 times 3.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: Maximum Number of Bishops on a Chessboard/Puzzle: Maximum Number of Bishops on a Chessboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: Maximum Number of Bishops on a Chessboard/Puzzle: Maximum Number of Bishops on a Chessboard.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: Maximum Number of Knights on a Chessboard/Puzzle: Maximum Number of Knights on a Chessboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: Maximum Number of Knights on a Chessboard/Puzzle: Maximum Number of Knights on a Chessboard.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: Maximum Number of Rooks on a Chessboard/Puzzle: Maximum Number of Rooks on a Chessboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: Maximum Number of Rooks on a Chessboard/Puzzle: Maximum Number of Rooks on a Chessboard.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: N Queens (Optional)/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: N Queens (Optional)/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: N Queens (Optional)/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: N Queens (Optional)/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: N Queens (Optional)/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: N Queens (Optional)/Level 3.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: N Queens (Optional)/Level 4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: N Queens (Optional)/Level 4.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: N Queens (Optional)/Level 5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: N Queens (Optional)/Level 5.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Puzzle: Subset without x and 2x/Puzzle: Subset without x and 2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Puzzle: Subset without x and 2x/Puzzle: Subset without x and 2x.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Quiz: Is there....png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Quiz: Is there....png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Quiz: Maximum Number of Two-digit Integers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Quiz: Maximum Number of Two-digit Integers.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/Quiz: Number of Solutions for the 8 Queens Puzzle (Optional).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/Quiz: Number of Solutions for the 8 Queens Puzzle (Optional).png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: Magic Square 3 times 3](http://dm.compsciclub.ru/app/quiz-magic-square) 2 | 3 | [Puzzle: Different People Have Different Coins](http://dm.compsciclub.ru/app/quiz-florin-coins) 4 | 5 | [Puzzle: Free accomodation](http://dm.compsciclub.ru/app/quiz-three-hotels) 6 | 7 | [Puzzle: N Queens (Optional)](http://dm.compsciclub.ru/app/quiz-n-queens) 8 | 9 | [Puzzle: 16 Diagonals (Optional)](http://dm.compsciclub.ru/app/quiz-n-diagonals) 10 | 11 | [Puzzle: Maximum Number of Rooks on a Chessboard](http://dm.compsciclub.ru/app/quiz-n-rooks) 12 | 13 | [Puzzle: Maximum Number of Knights on a Chessboard](http://dm.compsciclub.ru/app/quiz-n-knights) 14 | 15 | [Puzzle: Maximum Number of Bishops on a Chessboard](http://dm.compsciclub.ru/app/quiz-n-bishops) 16 | 17 | [Puzzle: Subset without x and 2x](http://dm.compsciclub.ru/app/quiz-twice-numbers) 18 | -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/computersearch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/computersearch.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week2/optimality.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week2/optimality.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/07_induction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/07_induction.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/Bernoulli's Inequality.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "raw", 5 | "metadata": {}, 6 | "source": [ 7 | "Use this notebook 3-fold:\n", 8 | " * Play with parameters and visualize how (1 + x)^n grows compared to 1 + nx\n", 9 | " * Compute how much money you will have on day n given the starting cash if you earn x% every day\n", 10 | " * Determine when you will reach the specified wealth given the starting sum and the percentage you earn every day" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 1, 16 | "metadata": {}, 17 | "outputs": [ 18 | { 19 | "data": { 20 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEKCAYAAAAfGVI8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3Xl8lOW99/HPL/sOBEKIbEGIgAuoRBRxx61q1Wr1aK1Syynq01r76mprW22fc3pqq6fn2O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"metadata": { 26 | "needs_background": "light" 27 | }, 28 | "output_type": "display_data" 29 | } 30 | ], 31 | "source": [ 32 | "%matplotlib inline\n", 33 | "\n", 34 | "import matplotlib.pyplot as plt\n", 35 | "import numpy as np\n", 36 | "\n", 37 | "# You can play with the range of values for n and with the base 1.02, see what changes\n", 38 | "sample = 200\n", 39 | "x = np.arange(sample)\n", 40 | "# This is used to plot the graph of 1.02^n, it is blue on the picture below\n", 41 | "y = 1.02 ** x\n", 42 | "plt.plot(x, y)\n", 43 | "plt.xlabel('n')\n", 44 | "plt.ylabel('Money($)')\n", 45 | "# This is used to plot the graph of 1 + 0.02 * n, it is green on the picture below\n", 46 | "z = 1 + 0.02 * x\n", 47 | "plt.plot(x, z)\n", 48 | "plt.show()" 49 | ] 50 | }, 51 | { 52 | "cell_type": "code", 53 | "execution_count": 2, 54 | "metadata": {}, 55 | "outputs": [ 56 | { 57 | "name": "stdout", 58 | "output_type": "stream", 59 | "text": [ 60 | "If you start with $1000 and earn 2% each day, you will have more than $1003367 on day 350!\n" 61 | ] 62 | } 63 | ], 64 | "source": [ 65 | "# Computes how much money you will have on day *day*, if you start with *starting_amount* of cash\n", 66 | "# and earn *earn_percent* percents of what you already have every day.\n", 67 | "def HowMuchMoney(starting_amount, earn_percent, day):\n", 68 | " day_multiplier = 1 + (earn_percent / 100.0)\n", 69 | " return starting_amount * (day_multiplier ** (day - 1))\n", 70 | " \n", 71 | "def PrintExample(starting_amount, earn_percent, day):\n", 72 | " print(\"If you start with $%d and earn %d%% each day, you will have more than $%.0f on day %d!\" % \n", 73 | " (starting_amount, earn_percent, HowMuchMoney(starting_amount, earn_percent, day), day))\n", 74 | "\n", 75 | "# Prints what will happen by day 350 if you start with $1000 and earn 2% every day\n", 76 | "# Feel free to play with the parameters\n", 77 | "PrintExample(1000, 2, 350)" 78 | ] 79 | }, 80 | { 81 | "cell_type": "code", 82 | "execution_count": 3, 83 | "metadata": {}, 84 | "outputs": [ 85 | { 86 | "name": "stdout", 87 | "output_type": "stream", 88 | "text": [ 89 | "If you start with $1000 and earn 2% each day, you will have more than $1000000 on day 350 for the first time!\n" 90 | ] 91 | } 92 | ], 93 | "source": [ 94 | "# Compute the number of the first day when your wealth will exceed *target_amount*,\n", 95 | "# if you start with *starting_amount* of cash and earn *earn_percent* percents every day\n", 96 | "def DayToReachTarget(starting_amount, earn_percent, target_amount):\n", 97 | " day = 1\n", 98 | " amount = starting_amount\n", 99 | " day_multiplier = (1 + (earn_percent) / 100.0)\n", 100 | " while amount < target_amount:\n", 101 | " day += 1\n", 102 | " amount = amount * day_multiplier\n", 103 | " return day\n", 104 | "\n", 105 | "def PrintFirstDay(starting_amount, earn_percent, target_amount):\n", 106 | " print(\"If you start with $%d and earn %d%% each day, you will have more than $%d on day %d for the first time!\" %\n", 107 | " (starting_amount, earn_percent, target_amount, DayToReachTarget(starting_amount, earn_percent, target_amount)))\n", 108 | "\n", 109 | "# Prints when you will get more than $1000000 for the first time, if you start with $1000\n", 110 | "# and earn 2% every day.\n", 111 | "PrintFirstDay(1000, 2, 1000000)" 112 | ] 113 | } 114 | ], 115 | "metadata": { 116 | "kernelspec": { 117 | "display_name": "Python 2", 118 | "language": "python", 119 | "name": "python2" 120 | }, 121 | "language_info": { 122 | "codemirror_mode": { 123 | "name": "ipython", 124 | "version": 2 125 | }, 126 | "file_extension": ".py", 127 | "mimetype": "text/x-python", 128 | "name": "python", 129 | "nbconvert_exporter": "python", 130 | "pygments_lexer": "ipython2", 131 | "version": "2.7.15" 132 | } 133 | }, 134 | "nbformat": 4, 135 | "nbformat_minor": 2 136 | } 137 | -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/Puzzle: Connect Points/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/Puzzle: Connect Points/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/Puzzle: Connect Points/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/Puzzle: Connect Points/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/Puzzle: Hanoi Towers/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/Puzzle: Hanoi Towers/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/Puzzle: Hanoi Towers/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/Puzzle: Hanoi Towers/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/Puzzle: Hanoi Towers/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/Puzzle: Hanoi Towers/Level 3.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/Puzzle: Two Cells of Opposite Colors/Puzzle: Two Cells of Opposite Colors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/Puzzle: Two Cells of Opposite Colors/Puzzle: Two Cells of Opposite Colors.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/Quiz: Induction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/Quiz: Induction.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/Quiz: Largest Amount that Cannot Be Paid with 5- and 7-Coins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/Quiz: Largest Amount that Cannot Be Paid with 5- and 7-Coins.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/Quiz: Number of Moves to Solve the Hanoi Towers Puzzle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/Quiz: Number of Moves to Solve the Hanoi Towers Puzzle.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/Quiz: Pay Any Large Amount with 5- and 7-Coins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/Quiz: Pay Any Large Amount with 5- and 7-Coins.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: Hanoi Towers](http://dm.compsciclub.ru/app/quiz-hanoi-towers) 2 | 3 | [Puzzle: Two Cells of Opposite Colors](http://dm.compsciclub.ru/app/quiz-opposite-colors) 4 | 5 | [Puzzle: Connect Points](http://dm.compsciclub.ru/app/quiz-regular-graph) 6 | -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week3/recursion.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week3/recursion.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/08_logic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/08_logic.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/09_php.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/09_php.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/Puzzle: Always Prime?/Puzzle: Always Prime?.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/Puzzle: Always Prime?/Puzzle: Always Prime?.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/Puzzle: An (-1,0,1) Antimagic Square/Puzzle: An (-1,0,1) Antimagic Square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/Puzzle: An (-1,0,1) Antimagic Square/Puzzle: An (-1,0,1) Antimagic Square.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/Puzzle: Balls in Boxes/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/Puzzle: Balls in Boxes/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/Puzzle: Balls in Boxes/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/Puzzle: Balls in Boxes/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/Puzzle: Balls in Boxes/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/Puzzle: Balls in Boxes/Level 3.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/Puzzle: Numbers in Boxes/Puzzle: Numbers in Boxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/Puzzle: Numbers in Boxes/Puzzle: Numbers in Boxes.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/Puzzle: Numbers on the Chessboard/Puzzle: Numbers on the Chessboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/Puzzle: Numbers on the Chessboard/Puzzle: Numbers on the Chessboard.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/Quiz: Examples, Counterexamples and Logic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/Quiz: Examples, Counterexamples and Logic.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/Quiz: How to Pick Socks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/Quiz: How to Pick Socks.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/Quiz: Numbers in Boxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/Quiz: Numbers in Boxes.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/Quiz: Pigeonhole Principle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week4/Quiz: Pigeonhole Principle.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week4/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: Always Prime?](http://dm.compsciclub.ru/app/quiz-prime) 2 | 3 | [Puzzle: Balls in Boxes](http://dm.compsciclub.ru/app/quiz-balls-in-boxes) 4 | 5 | [Puzzle: Numbers in Boxes](http://dm.compsciclub.ru/app/quiz-numbers-in-boxes) 6 | 7 | [Puzzle: Numbers on the Chessboard](http://dm.compsciclub.ru/app/quiz-numbers-on-chessboard) 8 | 9 | [Puzzle: An (-1,0,1) Antimagic Square](http://dm.compsciclub.ru/app/quiz-antimagic-square) 10 | -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/10_double_counting.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/10_double_counting.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/11_invariants.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/11_invariants.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/12_termination.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/12_termination.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/13_even_and_odd.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/13_even_and_odd.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Practice Quiz: Coffee with Milk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Practice Quiz: Coffee with Milk.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Practice Quiz: Football Fans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Practice Quiz: Football Fans.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Practice Quiz: More Coffee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Practice Quiz: More Coffee.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 3.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 4.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 5.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Arthur's Books/Level 6.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Piece on a Chessboard/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Piece on a Chessboard/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Piece on a Chessboard/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Piece on a Chessboard/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Summing Up Digits/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Summing Up Digits/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Summing Up Digits/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Summing Up Digits/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Summing Up Digits/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Summing Up Digits/Level 3.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Summing Up Digits/Level 4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Summing Up Digits/Level 4.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Sums of Rows and Columns/Puzzle: Sums of Rows and Columns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Sums of Rows and Columns/Puzzle: Sums of Rows and Columns.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 3.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 4.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 5.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 6.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Puzzle: Switching Signs/Level 7.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Quiz: 'Homework Assignment' Problem 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Quiz: 'Homework Assignment' Problem 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Quiz: 'Homework Assignment' Problem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Quiz: 'Homework Assignment' Problem.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Quiz: Chess Tournaments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Quiz: Chess Tournaments.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Quiz: Debugging Problem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Quiz: Debugging Problem.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Quiz: Merging Bank Accounts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Quiz: Merging Bank Accounts.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Quiz: Operations on Even and Odd Numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Quiz: Operations on Even and Odd Numbers.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/Quiz: Recolouring Chessboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week5/Quiz: Recolouring Chessboard.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week5/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: Sums of Rows and Columns](http://dm.compsciclub.ru/app/quiz-sums-of-rows-and-columns) 2 | 3 | [Puzzle: Arthur's Books](http://dm.compsciclub.ru/app/quiz-arthurs-books) 4 | 5 | [Puzzle: Piece on a Chessboard](http://dm.compsciclub.ru/app/quiz-piece-on-chessboard) 6 | 7 | [Puzzle: Summing Up Digits](http://dm.compsciclub.ru/app/quiz-summing-up-digits) 8 | 9 | [Puzzle: Switching Signs](http://dm.compsciclub.ru/app/quiz-switching-signs) 10 | -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week6/15_game.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week6/15_game.pdf -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 1.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 2.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 3.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 4.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 5.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week6/Puzzle: 15/Game 6.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week6/Quiz: Is a permutation even?.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week6/Quiz: Is a permutation even?.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week6/Quiz: Neighbor transpositions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week6/Quiz: Neighbor transpositions.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week6/Quiz: Transpositions and Permutations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Mathematical Thinking in Computer Science/Week6/Quiz: Transpositions and Permutations.png -------------------------------------------------------------------------------- /Mathematical Thinking in Computer Science/Week6/README.md: -------------------------------------------------------------------------------- 1 | [Puzzle: 15](http://dm.compsciclub.ru/app/quiz-15-game) 2 | -------------------------------------------------------------------------------- /Number Theory and Cryptography/Certificate/Certificate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Certificate/Certificate.jpg -------------------------------------------------------------------------------- /Number Theory and Cryptography/Certificate/Certificate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Certificate/Certificate.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/411_divisibility.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/411_divisibility.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/412_division_by_2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/412_division_by_2.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/413_modular_arithmetic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/413_modular_arithmetic.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Practice Quiz: Division by 101.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Practice Quiz: Division by 101.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Practice Quiz: Division by 4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Practice Quiz: Division by 4.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Practice Quiz: Four Numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Practice Quiz: Four Numbers.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Quiz: Binary System.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Quiz: Binary System.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Quiz: Divisibility Tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Quiz: Divisibility Tests.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Quiz: Divisibility.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Quiz: Divisibility.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Quiz: Division by 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Quiz: Division by 2.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Quiz: Modular Arithmetic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Quiz: Modular Arithmetic.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Quiz: Modular Division.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Quiz: Modular Division.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Quiz: Properties of Divisibility.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Quiz: Properties of Divisibility.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Quiz: Remainders of Large Numbers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Quiz: Remainders of Large Numbers.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Quiz: Remainders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Quiz: Remainders.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/README.md: -------------------------------------------------------------------------------- 1 | [Take the Last Rock](http://dm.compsciclub.ru/app/quiz-take-the-last-rock) 2 | -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Take the Last Rock/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Take the Last Rock/Level 1.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Take the Last Rock/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Take the Last Rock/Level 2.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Take the Last Rock/Level 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Take the Last Rock/Level 3.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Take the Last Rock/Level 4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Take the Last Rock/Level 4.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Take the Last Rock/Level 5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Take the Last Rock/Level 5.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Take the Last Rock/Level 6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Take the Last Rock/Level 6.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week1/Take the Last Rock/Level 7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week1/Take the Last Rock/Level 7.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week2/Practice Quiz: Diophantine Equations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week2/Practice Quiz: Diophantine Equations.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week2/Practice Quiz: Greatest Common Divisor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week2/Practice Quiz: Greatest Common Divisor.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week2/Practice Quiz: Least Common Multiple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week2/Practice Quiz: Least Common Multiple.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week2/Quiz: Diophantine Equations: Code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week2/Quiz: Diophantine Equations: Code.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week2/Quiz: Least Common Multiple: Code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week2/Quiz: Least Common Multiple: Code.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week2/Quiz: Modular Division: Code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week2/Quiz: Modular Division: Code.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week2/Quiz: Tile a Rectangle with Squares.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week2/Quiz: Tile a Rectangle with Squares.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week2/README.md: -------------------------------------------------------------------------------- 1 | Thanks !!! 2 | -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week2/c4_m2_l1_Euclids_Algorithm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week2/c4_m2_l1_Euclids_Algorithm.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week2/c4_m2_l2_Applications.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week2/c4_m2_l2_Applications.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week3/Arrange Apples/Level 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week3/Arrange Apples/Level 1.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week3/Arrange Apples/Level 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week3/Arrange Apples/Level 2.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week3/Quiz: Chinese Remainder Theorem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week3/Quiz: Chinese Remainder Theorem.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week3/Quiz: Modular Exponentiation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week3/Quiz: Modular Exponentiation.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week3/Quiz: Remainders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week3/Quiz: Remainders.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week3/README.md: -------------------------------------------------------------------------------- 1 | [Arrange Apples](http://dm.compsciclub.ru/app/quiz-arrange-apples) 2 | -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week3/chinese_remainder_theorem.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week3/chinese_remainder_theorem.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week3/integer_factorization.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week3/integer_factorization.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week3/introduction.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week3/introduction.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week3/modular_exponentiation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week3/modular_exponentiation.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week4/Notebook: Many Time Pad Attack/One-time Pad.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "raw", 5 | "metadata": {}, 6 | "source": [ 7 | "This notebook shows examples of One-time Pad encryption and partial decryption of the messages when the same key is used more than once for encryption." 8 | ] 9 | }, 10 | { 11 | "cell_type": "raw", 12 | "metadata": {}, 13 | "source": [ 14 | "Before using XOR operation, we are going to convert plaintext messages to hex strings. This way, each character is represented by its ASCII code - a number from 0 to 255. In the hexadecimal system, any such number has two digits. We write these two hexadecimal digits instead of the initial character, like \"6f\" instead of letter \"o\", where 'f' corresponds to hexadecimal number 15. We can also convert back from hex strings to the regular strings. These conversions are needed for demonstration purposes only: to avoid using unreadable/invisible characters in the strings we work with." 15 | ] 16 | }, 17 | { 18 | "cell_type": "code", 19 | "execution_count": 1, 20 | "metadata": {}, 21 | "outputs": [ 22 | { 23 | "name": "stdout", 24 | "output_type": "stream", 25 | "text": [ 26 | "toHex(\"Hello World\") = \"48656c6c6f20576f726c64\"\n", 27 | "toStr(\"736f6d65206d657373616765\") = \"some message\"\n" 28 | ] 29 | } 30 | ], 31 | "source": [ 32 | "# Converts string to hex\n", 33 | "def toHex(s):\n", 34 | " lst = []\n", 35 | " for ch in s:\n", 36 | " hv = hex(ord(ch)).replace('0x', '')\n", 37 | " if len(hv) == 1:\n", 38 | " hv = '0'+hv\n", 39 | " lst.append(hv)\n", 40 | " \n", 41 | " return reduce(lambda x,y:x+y, lst)\n", 42 | "\n", 43 | "print(\"toHex(\\\"Hello World\\\") = \\\"%s\\\"\" % toHex(\"Hello World\"))\n", 44 | "\n", 45 | "# Converts hex to string\n", 46 | "def toStr(s):\n", 47 | " return s and chr(int(s[:2], base=16)) + toStr(s[2:]) or ''\n", 48 | "\n", 49 | "print(\"toStr(\\\"736f6d65206d657373616765\\\") = \\\"%s\\\"\" % toStr(\"736f6d65206d657373616765\"))" 50 | ] 51 | }, 52 | { 53 | "cell_type": "code", 54 | "execution_count": 2, 55 | "metadata": {}, 56 | "outputs": [], 57 | "source": [ 58 | "# Computes XOR of two messages s1 and s2.\n", 59 | "# s1 and s2 must have the same length.\n", 60 | "def Xor(s1, s2):\n", 61 | " res = \"\"\n", 62 | " for i in range(len(s1)):\n", 63 | " res += format(int(s1[i], 16) ^ int(s2[i], 16), '01x')\n", 64 | " return res" 65 | ] 66 | }, 67 | { 68 | "cell_type": "raw", 69 | "metadata": {}, 70 | "source": [ 71 | "To encrypt, we need to Xor the message with the key and get the ciphertext. However, before doing that we are going to convert them both to hex strings. To decrypt, we need to xor the ciphertext with the key. However, before doing that we need to convert key to hex, and after doing that we need to convert the resulting hex string to the regular string, so that we get the initial message and not its hex form." 72 | ] 73 | }, 74 | { 75 | "cell_type": "code", 76 | "execution_count": 3, 77 | "metadata": {}, 78 | "outputs": [ 79 | { 80 | "name": "stdout", 81 | "output_type": "stream", 82 | "text": [ 83 | "hex(message) = 736563726574206d657373616765\n", 84 | "hex(key) = 6d7920736563726574206b657973\n", 85 | "ciphertext: 1e1c430100175208115318041e16\n", 86 | "recovered message: secret message\n" 87 | ] 88 | } 89 | ], 90 | "source": [ 91 | "message = \"secret message\"\n", 92 | "key = \"my secret keys\"\n", 93 | "print(\"hex(message) = %s\" % toHex(message))\n", 94 | "print(\"hex(key) = %s\" % toHex(key))\n", 95 | "ciphertext = Xor(toHex(message), toHex(key))\n", 96 | "print(\"ciphertext: %s\" % ciphertext)\n", 97 | "recovered_message = toStr(Xor(ciphertext, toHex(key)))\n", 98 | "print(\"recovered message: %s\" % recovered_message)" 99 | ] 100 | }, 101 | { 102 | "cell_type": "raw", 103 | "metadata": {}, 104 | "source": [ 105 | "Now let's see what happens if the same key is used to encrypt two different messages:" 106 | ] 107 | }, 108 | { 109 | "cell_type": "code", 110 | "execution_count": 4, 111 | "metadata": {}, 112 | "outputs": [ 113 | { 114 | "name": "stdout", 115 | "output_type": "stream", 116 | "text": [ 117 | "071c00410e4f0d4811481645041b1718\n", 118 | "071c00410e4f0d4811481645041b1718\n", 119 | "Xor of the ciphertexts is the same as xor of messages\n" 120 | ] 121 | } 122 | ], 123 | "source": [ 124 | "message1 = \"steal the secret\"\n", 125 | "message2 = \"the boy the girl\"\n", 126 | "key = \"supersecretverys\"\n", 127 | "ciphertext1 = Xor(toHex(message1), toHex(key))\n", 128 | "ciphertext2 = Xor(toHex(message2), toHex(key))\n", 129 | "xor_ciphertexts = Xor(ciphertext1, ciphertext2)\n", 130 | "xor_messages = Xor(toHex(message1), toHex(message2))\n", 131 | "print(xor_ciphertexts)\n", 132 | "print(xor_messages)\n", 133 | "if xor_ciphertexts == xor_messages:\n", 134 | " print(\"Xor of the ciphertexts is the same as xor of messages\")\n", 135 | "else:\n", 136 | " print(\"Xor of the ciphertexts differs from the xor of messages\")" 137 | ] 138 | }, 139 | { 140 | "cell_type": "raw", 141 | "metadata": {}, 142 | "source": [ 143 | "Now you see that if Eve doesn't know the key and doesn't know the messages but intercepts just the ciphertexts,\n", 144 | "she can compute Xor of the ciphertexts and get the same result as if she computed Xor of the initial messages!\n", 145 | "\n", 146 | "How does this help?\n", 147 | "\n", 148 | "We can do some statistical analysis using our knowledge of English. The simplest example is the following.\n", 149 | "We know that English sentences often contain word \" the \" delimited by spaces on both sides. Let's try\n", 150 | "to \"guess\" that one of the messages contains this word \" the \" starting from position 1, 2, 3,... and so on.\n", 151 | "If our guess is correct, and message1 indeed contains word \" the \" starting from some position, then by\n", 152 | "xoring this \" the \" with the corresponding positions of the xor_ciphertexts we will get some English letters\n", 153 | "in the corresponding positions of message2. If our guess is incorrect, we will get just some rubbish." 154 | ] 155 | }, 156 | { 157 | "cell_type": "code", 158 | "execution_count": 5, 159 | "metadata": {}, 160 | "outputs": [ 161 | { 162 | "name": "stdout", 163 | "output_type": "stream", 164 | "text": [ 165 | "\n", 166 | "Good guesses:\n", 167 | "position: 5, one message part: \" the \", another message part: \"oy th\"\n", 168 | "position: 7, one message part: \" the \", another message part: \"he se\"\n" 169 | ] 170 | } 171 | ], 172 | "source": [ 173 | "def TryGuessingSubstring(substring, message_length, xor_messages):\n", 174 | " good_guesses = []\n", 175 | " for pos in range(message_length - len(substring) + 1):\n", 176 | " guess = toHex(chr(0) * pos + substring + chr(0) * (message_length - len(substring) - pos))\n", 177 | " other_message_part = toStr(Xor(guess, xor_messages))[pos:pos + len(substring)]\n", 178 | " good_guess = True\n", 179 | " for i in range(len(other_message_part)):\n", 180 | " if not other_message_part[i].isalpha() and not other_message_part[i].isspace():\n", 181 | " good_guess = False\n", 182 | " break\n", 183 | " if good_guess:\n", 184 | " good_guesses.append((guess, pos, other_message_part))\n", 185 | " \n", 186 | " print(\"\\nGood guesses:\")\n", 187 | " for guess in good_guesses:\n", 188 | " print(\"position: %d, one message part: \\\"%s\\\", another message part: \\\"%s\\\"\" % (guess[1], substring, guess[2]))\n", 189 | " \n", 190 | "TryGuessingSubstring(\" the \", len(message1), xor_messages)" 191 | ] 192 | }, 193 | { 194 | "cell_type": "raw", 195 | "metadata": {}, 196 | "source": [ 197 | "Now we can see that one of the messages has \"oy th\" starting from position 5, or \" th\" starting from position 7, and one of the messages has \" the \" startin from position 7. We could guess that this is the same message which has \"oy the \" starting from position 5." 198 | ] 199 | }, 200 | { 201 | "cell_type": "code", 202 | "execution_count": 6, 203 | "metadata": {}, 204 | "outputs": [ 205 | { 206 | "name": "stdout", 207 | "output_type": "stream", 208 | "text": [ 209 | "\n", 210 | "Good guesses:\n", 211 | "position: 5, one message part: \"oy the \", another message part: \" the se\"\n" 212 | ] 213 | } 214 | ], 215 | "source": [ 216 | "TryGuessingSubstring(\"oy the \", len(message1), xor_messages)" 217 | ] 218 | }, 219 | { 220 | "cell_type": "raw", 221 | "metadata": {}, 222 | "source": [ 223 | "Now we've guessed parts of both initial messages. If we had even more ciphertexts of different messages encypted with the same key, by xoring each pair the same way we could reconstruct more." 224 | ] 225 | } 226 | ], 227 | "metadata": { 228 | "kernelspec": { 229 | "display_name": "Python 2", 230 | "language": "python", 231 | "name": "python2" 232 | }, 233 | "language_info": { 234 | "codemirror_mode": { 235 | "name": "ipython", 236 | "version": 2 237 | }, 238 | "file_extension": ".py", 239 | "mimetype": "text/x-python", 240 | "name": "python", 241 | "nbconvert_exporter": "python", 242 | "pygments_lexer": "ipython2", 243 | "version": "2.7.15" 244 | } 245 | }, 246 | "nbformat": 4, 247 | "nbformat_minor": 2 248 | } 249 | -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week4/Quiz: RSA Quiz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week4/Quiz: RSA Quiz.png -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week4/README.md: -------------------------------------------------------------------------------- 1 | Thanks !!! 2 | -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week4/cryptography.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week4/cryptography.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week4/rsa-attacks.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week4/rsa-attacks.pdf -------------------------------------------------------------------------------- /Number Theory and Cryptography/Week4/rsa.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChanchalKumarMaji/Introduction-to-Discrete-Mathematics-for-Computer-Science-Specialization/79927d008f70d36345755759aad54900e6cba464/Number Theory and Cryptography/Week4/rsa.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Introduction to Discrete Mathematics for Computer Science 2 | 3 | **[Introduction to Discrete Mathematics for Computer Science Specialization](https://www.coursera.org/specializations/discrete-mathematics?)** 4 | + **[Mathematical Thinking in Computer Science](https://www.coursera.org/learn/what-is-a-proof?specialization=discrete-mathematics)** 5 | + **[Combinatorics and Probability](https://www.coursera.org/learn/combinatorics?specialization=discrete-mathematics)** 6 | + **[Introduction to Graph Theory](https://www.coursera.org/learn/graphs?specialization=discrete-mathematics)** 7 | + **[Number Theory and Cryptography](https://www.coursera.org/learn/number-theory-cryptography?specialization=discrete-mathematics)** 8 | + **[Delivery Problem](https://www.coursera.org/learn/delivery-problem)** 9 | 10 | 11 | **Instructors** : `Alexander S. Kulikov`, `Michael Levin` and `Vladimir Podolskii` 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | --------------------------------------------------------------------------------