This document summarizes a seminar on algorithm verification and efficiency. It discusses verifying that algorithms are correct through mathematical proofs and analyzing computational efficiency by calculating the number of operations. Basic arithmetic algorithms like multiplication and finding the greatest common divisor are analyzed. The most efficient multiplication algorithm runs in O(log y) time while the naive approach is O(y). Euclid's algorithm for finding the greatest common divisor runs in O(log n) time.
Design and Implementation of Parallel and Randomized Approximation AlgorithmsAjay Bidyarthy
This document summarizes the design and implementation of parallel and randomized approximation algorithms for solving matrix games, linear programs, and semi-definite programs. It presents solvers for these problems that provide approximate solutions in sublinear or near-linear time. It analyzes the performance and precision-time tradeoffs of the solvers compared to other algorithms. It also provides examples of applying the SDP solver to approximate the Lovasz theta function.
The document discusses numerical simulation techniques for real-time game physics. It introduces particle physics concepts like position, velocity, and acceleration. Finite difference methods are described as the most common approach for incremental numerical solutions when closed-form equations do not exist. Explicit Euler integration is provided as a basic finite difference method, where the state vector is updated over small time steps using the prior state and derivatives. Examples are given of applying explicit Euler integration to simulate 3D projectile motion towards a target.
The document summarizes a seminar on recursion, divide and conquer algorithms, and two specific algorithms: finding medians and closest pair of points. It introduces recursion as a basic concept. Divide and conquer is described as breaking a problem into smaller subproblems, solving them recursively, and combining the solutions. Finding medians and closest pair of points are then discussed as examples solved using divide and conquer. Finding medians uses random selection of a pivot value to partition the data set. Closest pair of points works by recursively finding the closest pairs in each half of the data set and using geometric constraints to limit the search space for the overall closest pair.
The document discusses the greedy approach problem solving paradigm. It covers several examples of problems that can be solved using greedy algorithms, including interval scheduling and interval partitioning. For interval scheduling, the greedy approach is to always select the interval with the earliest finish time at each step. This guarantees finding the optimal solution because any feasible solution must respect the finish time ordering of intervals. For interval partitioning, the minimum number of classrooms needed is the maximum number of overlapping intervals. The greedy algorithm assigns intervals to classrooms in order of finish time.
The document discusses various advanced data structures including heaps, indexed trees, binomial heaps, and Fibonacci heaps. It provides details on the operations, implementations, and time complexities of each. Specifically, it describes d-ary heaps, binomial trees, how binomial heaps merge trees and rearrange during deletion, and how Fibonacci heaps have lazier updates than binomial heaps.
The document discusses dynamic programming and covers the longest increasing subsequence problem. It begins by defining dynamic programming as breaking down a problem into smaller subproblems and using previously solved subproblems to solve larger ones. It then covers the longest increasing subsequence problem in detail, showing how to define a table, find the recurrence relation, and calculate the solution. The example problem is finding the longest increasing subsequence of the numbers 5, 2, 8, 6, 3, 6, 9, 7. The solution is shown to be the sequence 2, 3, 6, 9, which has a length of 4.
Design and Implementation of Parallel and Randomized Approximation AlgorithmsAjay Bidyarthy
This document summarizes the design and implementation of parallel and randomized approximation algorithms for solving matrix games, linear programs, and semi-definite programs. It presents solvers for these problems that provide approximate solutions in sublinear or near-linear time. It analyzes the performance and precision-time tradeoffs of the solvers compared to other algorithms. It also provides examples of applying the SDP solver to approximate the Lovasz theta function.
The document discusses numerical simulation techniques for real-time game physics. It introduces particle physics concepts like position, velocity, and acceleration. Finite difference methods are described as the most common approach for incremental numerical solutions when closed-form equations do not exist. Explicit Euler integration is provided as a basic finite difference method, where the state vector is updated over small time steps using the prior state and derivatives. Examples are given of applying explicit Euler integration to simulate 3D projectile motion towards a target.
The document summarizes a seminar on recursion, divide and conquer algorithms, and two specific algorithms: finding medians and closest pair of points. It introduces recursion as a basic concept. Divide and conquer is described as breaking a problem into smaller subproblems, solving them recursively, and combining the solutions. Finding medians and closest pair of points are then discussed as examples solved using divide and conquer. Finding medians uses random selection of a pivot value to partition the data set. Closest pair of points works by recursively finding the closest pairs in each half of the data set and using geometric constraints to limit the search space for the overall closest pair.
The document discusses the greedy approach problem solving paradigm. It covers several examples of problems that can be solved using greedy algorithms, including interval scheduling and interval partitioning. For interval scheduling, the greedy approach is to always select the interval with the earliest finish time at each step. This guarantees finding the optimal solution because any feasible solution must respect the finish time ordering of intervals. For interval partitioning, the minimum number of classrooms needed is the maximum number of overlapping intervals. The greedy algorithm assigns intervals to classrooms in order of finish time.
The document discusses various advanced data structures including heaps, indexed trees, binomial heaps, and Fibonacci heaps. It provides details on the operations, implementations, and time complexities of each. Specifically, it describes d-ary heaps, binomial trees, how binomial heaps merge trees and rearrange during deletion, and how Fibonacci heaps have lazier updates than binomial heaps.
The document discusses dynamic programming and covers the longest increasing subsequence problem. It begins by defining dynamic programming as breaking down a problem into smaller subproblems and using previously solved subproblems to solve larger ones. It then covers the longest increasing subsequence problem in detail, showing how to define a table, find the recurrence relation, and calculate the solution. The example problem is finding the longest increasing subsequence of the numbers 5, 2, 8, 6, 3, 6, 9, 7. The solution is shown to be the sequence 2, 3, 6, 9, which has a length of 4.
This document discusses shortest path algorithms like Dijkstra's algorithm. It uses an example graph to demonstrate how Dijkstra's algorithm works to find the shortest path between vertices. The algorithm works by gradually filling in the shortest path lengths from the starting vertex to all other vertices. It begins by setting the shortest path to the starting vertex as 0 and all others as infinity. It then iteratively updates the shortest path lengths by exploring the neighbors of vertices whose shortest path is known.
The document discusses minimum spanning trees and Kruskal's algorithm. It begins by defining minimum spanning trees and the cut property. It then explains Kruskal's algorithm, which finds a minimum spanning tree by iteratively adding the lightest edge that does not form a cycle. It uses disjoint sets to determine if an edge connects two vertices in different sets, and thus would not form a cycle.
The document discusses two problems solved using dynamic programming: longest palindrome and team division. For longest palindrome, it defines a table to store the length of the longest palindrome between two indices, and a recurrence relation to consider if the characters at the indices are the same or different. For team division, the goal is to minimize the maximum sum of teams when dividing people into teams. It defines a table to store the minimum value for a given number of teams, and a recurrence relation to try dividing at each index and take the minimum.
The document discusses different methods for representing graphs in a computer, including adjacency matrices and adjacency lists. An adjacency matrix uses a 2D matrix to represent a graph, with rows and columns representing vertices and a 1 or 0 in the cell indicating whether an edge exists between those two vertices. While this allows directly checking for edges, it takes up more space than necessary for sparse graphs. Adjacency lists store only the relevant adjacent vertices for each vertex.
This document discusses brute force algorithms and provides an example problem of finding the maximum sum of consecutive elements in an array. It first explains that a brute force approach considers all possible cases to find the solution. For the example, it shows that one can consider all possible starting and ending indices to calculate the sum of each subarray, and take the maximum. This results in an O(n3) time complexity. However, by removing one of the loops, the time complexity can be improved to O(n2), making the algorithm efficient for the given constraints.
Each month, join us as we highlight and discuss hot topics ranging from the future of higher education to wearable technology, best productivity hacks and secrets to hiring top talent. Upload your SlideShares, and share your expertise with the world!
Not sure what to share on SlideShare?
SlideShares that inform, inspire and educate attract the most views. Beyond that, ideas for what you can upload are limitless. We’ve selected a few popular examples to get your creative juices flowing.
SlideShare is a global platform for sharing presentations, infographics, videos and documents. It has over 18 million pieces of professional content uploaded by experts like Eric Schmidt and Guy Kawasaki. The document provides tips for setting up an account on SlideShare, uploading content, optimizing it for searchability, and sharing it on social media to build an audience and reputation as a subject matter expert.
Runge-Kutta Fehlberg and Dormand-Prince methods provide improvements over traditional Runge-Kutta methods for numerically solving initial value problems. They allow adaptive step size control to maintain a desired error tolerance. Runge-Kutta Fehlberg derives coefficients through Taylor expansions to perform the same task as Runge-Kutta with fewer function evaluations. Dormand-Prince similarly aims for efficiency with a family of embedded Runge-Kutta formulas that can estimate errors economically. These adaptive methods are widely used due to their ability to balance accuracy and computational cost compared to fixed step size approaches.
1. Introduction to time and space complexity.
2. Different types of asymptotic notations and their limit definitions.
3. Growth of functions and types of time complexities.
4. Space and time complexity analysis of various algorithms.
The document contains solutions to several algorithm problems. For problem 1, it provides two solutions: 1) A divide-and-conquer algorithm that finds the rank of points in O(n log n) time by sorting and merging. 2) A sweep line algorithm using a binary indexed tree that also runs in O(n log n) time. For problem 2, it describes a selection algorithm solution that finds the median in O(n) time and partitions the items around the median, recursively solving in halves. For problem 3, it uses a pigeonhole principle argument to identify good chips in O(n) tests by randomly pairing chips and eliminating inconsistent results.
Ch-2 final exam documet compler design elementsMAHERMOHAMED27
The "Project Risk Management" course transformed me from a passive observer of risk to a proactive risk management champion. Here are some key learnings that will forever change my approach to projects:
The Proactive Mindset: I transitioned from simply reacting to problems to anticipating and mitigating them. The course emphasized the importance of proactive risk identification through techniques like brainstorming, SWOT analysis, and FMEA (Failure Mode and Effect Analysis). This allows for early intervention and prevents minor issues from snowballing into major roadblocks.
Risk Assessment and Prioritization: I learned to assess the likelihood and impact of each identified risk. The course introduced qualitative and quantitative risk analysis methods, allowing me to prioritize risks based on their potential severity. This empowers me to focus resources on the most critical threats to project success.
Developing Response Strategies: The course equipped me with a toolbox of risk response strategies. I learned about risk avoidance, mitigation, transference, and acceptance strategies, allowing me to choose the most appropriate approach for each risk. For example, I can now advocate for additional training to mitigate a knowledge gap risk or build buffer time into the schedule to address potential delays.
Communication and Monitoring: The course highlighted the importance of clear communication regarding risks. I learned to effectively communicate risks to stakeholders, ensuring everyone is aware of potential challenges and mitigation plans. Additionally, I gained valuable insights into risk monitoring and tracking, allowing for continuous evaluation and adaptation as the project progresses.
In essence, "Project Risk Management" equipped me with the knowledge and tools to navigate the inevitable uncertainties of projects. By embracing a proactive approach, I can now lead projects with greater confidence, increasing the chances of achieving successful outcomes.
This document discusses NP-complete problems and nondeterministic algorithms. It begins by introducing NP-completeness as evidence that many important problems cannot be solved quickly. It then defines different complexity classes like P, NP, NP-hard, and NP-complete. It provides examples of NP-complete problems like maximum clique and 0/1 knapsack. It also discusses how to show that a problem is NP-complete using polynomial-time reductions from another known NP-complete problem. In particular, it shows that the clique decision problem is NP-complete by reducing SAT to it.
This document provides an overview of data structures and algorithms. It defines key concepts like data structures, abstract data types, algorithms, asymptotic analysis and different algorithm design methods. It discusses analyzing time and space complexity of algorithms and introduces common asymptotic notations like Big-O, Omega and Theta notations. It also provides examples of different algorithm design techniques like divide and conquer, dynamic programming, greedy algorithms, backtracking and branch and bound.
GECCO-2014 Learning Classifier Systems: A Gentle IntroductionPier Luca Lanzi
The document provides an introduction to learning classifier systems, including an overview of their history and applications. It discusses the key components of learning classifier systems, such as how they represent knowledge as classifiers, use reinforcement learning to update classifier predictions, and employ a genetic algorithm to discover new classifiers. Examples are also given to illustrate how learning classifier systems work and the types of decisions that must be made when applying them.
The document provides an overview of the topics covered in a discrete mathematics course, including methods of proof, algorithms, growth of functions, complexity of algorithms, integers and division, and number theory applications. It discusses different methods of proof like direct proof, proof by contradiction, and proof by equivalence. It also describes algorithms for finding the maximum element in a sequence, linear search, binary search, and sorting algorithms like bubble sort and insertion sort. It provides pseudocode and sample programs for these algorithms.
This document discusses an algorithms study group meeting at Seoul Metropolitan University. It introduces the lecturer, announces study group notices for problem solving practice and algorithm competition preparation. It also covers some prerequisite knowledge like Python programming, mathematics concepts. The main topic of the meeting is brute-force search, which examines all possible cases to solve a problem. It explains analyzing algorithms' time and space complexity using Big-O notation and predicting feasibility within resource limits.
The document discusses several techniques for using symbolic execution for software debugging, including regression debugging, cause clue clauses, error invariants, and angelic debugging. Regression debugging involves comparing execution paths of a failing test case in a new buggy program version to paths in an older stable version to find differences that may indicate the root cause. Other techniques use symbolic execution to extract specifications from passing tests, internal program properties, or previous versions to infer the intended behavior and identify inconsistencies in a failing run.
L’Intégration Continue comme partenaire pour des suggestions d'amélioration des tests
Le CI (Intégration Continue) exécute en continu les tests unitaires et d'intégration pour donner aux développeurs un retour d'information sur la qualité du code. Cependant, il fournit peu de rétroaction sur la qualité des cas de test eux-mêmes. Cet exposé présente deux techniques automatiques qui fonctionnent dans le CI afin de suggérer les faiblesses et les améliorations possibles des cas de test.
La première technique est basée sur du test par mutation. Elle identifie les méthodes pseudo-testées : méthodes qui sont couvertes par la suite de tests mais qui peuvent être complètement supprimées sans qu'aucun cas de test n'échoue. Ceci indique que les cas de test qui couvrent ces méthodes doivent être améliorés pour observer et spécifier le comportement de manière plus approfondie. La seconde technique est basée sur l'amplification de test : elle suggère des améliorations possibles des cas de test pour mieux tester les méthodes pseudo-testées. Les deux techniques sont implémentées pour Java et sont disponibles sous forme d'outils open source : Descartes et DSpot.
The document discusses a new reinforcement learning algorithm called Learned Policy Gradient (LPG). LPG learns to optimize the policy and value function of an agent directly from interactions with the environment. It does this without requiring domain knowledge or manual engineering. LPG consists of an agent parameterized by θ that outputs a policy and prediction vector, and an LPG module parameterized by η that learns to update the agent's θ based on its performance. Experiments show LPG can learn effective policies across different environments, generalize to new tasks, and achieve better performance than baseline algorithms on Atari games after training on simple grid worlds.
This document discusses shortest path algorithms like Dijkstra's algorithm. It uses an example graph to demonstrate how Dijkstra's algorithm works to find the shortest path between vertices. The algorithm works by gradually filling in the shortest path lengths from the starting vertex to all other vertices. It begins by setting the shortest path to the starting vertex as 0 and all others as infinity. It then iteratively updates the shortest path lengths by exploring the neighbors of vertices whose shortest path is known.
The document discusses minimum spanning trees and Kruskal's algorithm. It begins by defining minimum spanning trees and the cut property. It then explains Kruskal's algorithm, which finds a minimum spanning tree by iteratively adding the lightest edge that does not form a cycle. It uses disjoint sets to determine if an edge connects two vertices in different sets, and thus would not form a cycle.
The document discusses two problems solved using dynamic programming: longest palindrome and team division. For longest palindrome, it defines a table to store the length of the longest palindrome between two indices, and a recurrence relation to consider if the characters at the indices are the same or different. For team division, the goal is to minimize the maximum sum of teams when dividing people into teams. It defines a table to store the minimum value for a given number of teams, and a recurrence relation to try dividing at each index and take the minimum.
The document discusses different methods for representing graphs in a computer, including adjacency matrices and adjacency lists. An adjacency matrix uses a 2D matrix to represent a graph, with rows and columns representing vertices and a 1 or 0 in the cell indicating whether an edge exists between those two vertices. While this allows directly checking for edges, it takes up more space than necessary for sparse graphs. Adjacency lists store only the relevant adjacent vertices for each vertex.
This document discusses brute force algorithms and provides an example problem of finding the maximum sum of consecutive elements in an array. It first explains that a brute force approach considers all possible cases to find the solution. For the example, it shows that one can consider all possible starting and ending indices to calculate the sum of each subarray, and take the maximum. This results in an O(n3) time complexity. However, by removing one of the loops, the time complexity can be improved to O(n2), making the algorithm efficient for the given constraints.
Each month, join us as we highlight and discuss hot topics ranging from the future of higher education to wearable technology, best productivity hacks and secrets to hiring top talent. Upload your SlideShares, and share your expertise with the world!
Not sure what to share on SlideShare?
SlideShares that inform, inspire and educate attract the most views. Beyond that, ideas for what you can upload are limitless. We’ve selected a few popular examples to get your creative juices flowing.
SlideShare is a global platform for sharing presentations, infographics, videos and documents. It has over 18 million pieces of professional content uploaded by experts like Eric Schmidt and Guy Kawasaki. The document provides tips for setting up an account on SlideShare, uploading content, optimizing it for searchability, and sharing it on social media to build an audience and reputation as a subject matter expert.
Runge-Kutta Fehlberg and Dormand-Prince methods provide improvements over traditional Runge-Kutta methods for numerically solving initial value problems. They allow adaptive step size control to maintain a desired error tolerance. Runge-Kutta Fehlberg derives coefficients through Taylor expansions to perform the same task as Runge-Kutta with fewer function evaluations. Dormand-Prince similarly aims for efficiency with a family of embedded Runge-Kutta formulas that can estimate errors economically. These adaptive methods are widely used due to their ability to balance accuracy and computational cost compared to fixed step size approaches.
1. Introduction to time and space complexity.
2. Different types of asymptotic notations and their limit definitions.
3. Growth of functions and types of time complexities.
4. Space and time complexity analysis of various algorithms.
The document contains solutions to several algorithm problems. For problem 1, it provides two solutions: 1) A divide-and-conquer algorithm that finds the rank of points in O(n log n) time by sorting and merging. 2) A sweep line algorithm using a binary indexed tree that also runs in O(n log n) time. For problem 2, it describes a selection algorithm solution that finds the median in O(n) time and partitions the items around the median, recursively solving in halves. For problem 3, it uses a pigeonhole principle argument to identify good chips in O(n) tests by randomly pairing chips and eliminating inconsistent results.
Ch-2 final exam documet compler design elementsMAHERMOHAMED27
The "Project Risk Management" course transformed me from a passive observer of risk to a proactive risk management champion. Here are some key learnings that will forever change my approach to projects:
The Proactive Mindset: I transitioned from simply reacting to problems to anticipating and mitigating them. The course emphasized the importance of proactive risk identification through techniques like brainstorming, SWOT analysis, and FMEA (Failure Mode and Effect Analysis). This allows for early intervention and prevents minor issues from snowballing into major roadblocks.
Risk Assessment and Prioritization: I learned to assess the likelihood and impact of each identified risk. The course introduced qualitative and quantitative risk analysis methods, allowing me to prioritize risks based on their potential severity. This empowers me to focus resources on the most critical threats to project success.
Developing Response Strategies: The course equipped me with a toolbox of risk response strategies. I learned about risk avoidance, mitigation, transference, and acceptance strategies, allowing me to choose the most appropriate approach for each risk. For example, I can now advocate for additional training to mitigate a knowledge gap risk or build buffer time into the schedule to address potential delays.
Communication and Monitoring: The course highlighted the importance of clear communication regarding risks. I learned to effectively communicate risks to stakeholders, ensuring everyone is aware of potential challenges and mitigation plans. Additionally, I gained valuable insights into risk monitoring and tracking, allowing for continuous evaluation and adaptation as the project progresses.
In essence, "Project Risk Management" equipped me with the knowledge and tools to navigate the inevitable uncertainties of projects. By embracing a proactive approach, I can now lead projects with greater confidence, increasing the chances of achieving successful outcomes.
This document discusses NP-complete problems and nondeterministic algorithms. It begins by introducing NP-completeness as evidence that many important problems cannot be solved quickly. It then defines different complexity classes like P, NP, NP-hard, and NP-complete. It provides examples of NP-complete problems like maximum clique and 0/1 knapsack. It also discusses how to show that a problem is NP-complete using polynomial-time reductions from another known NP-complete problem. In particular, it shows that the clique decision problem is NP-complete by reducing SAT to it.
This document provides an overview of data structures and algorithms. It defines key concepts like data structures, abstract data types, algorithms, asymptotic analysis and different algorithm design methods. It discusses analyzing time and space complexity of algorithms and introduces common asymptotic notations like Big-O, Omega and Theta notations. It also provides examples of different algorithm design techniques like divide and conquer, dynamic programming, greedy algorithms, backtracking and branch and bound.
GECCO-2014 Learning Classifier Systems: A Gentle IntroductionPier Luca Lanzi
The document provides an introduction to learning classifier systems, including an overview of their history and applications. It discusses the key components of learning classifier systems, such as how they represent knowledge as classifiers, use reinforcement learning to update classifier predictions, and employ a genetic algorithm to discover new classifiers. Examples are also given to illustrate how learning classifier systems work and the types of decisions that must be made when applying them.
The document provides an overview of the topics covered in a discrete mathematics course, including methods of proof, algorithms, growth of functions, complexity of algorithms, integers and division, and number theory applications. It discusses different methods of proof like direct proof, proof by contradiction, and proof by equivalence. It also describes algorithms for finding the maximum element in a sequence, linear search, binary search, and sorting algorithms like bubble sort and insertion sort. It provides pseudocode and sample programs for these algorithms.
This document discusses an algorithms study group meeting at Seoul Metropolitan University. It introduces the lecturer, announces study group notices for problem solving practice and algorithm competition preparation. It also covers some prerequisite knowledge like Python programming, mathematics concepts. The main topic of the meeting is brute-force search, which examines all possible cases to solve a problem. It explains analyzing algorithms' time and space complexity using Big-O notation and predicting feasibility within resource limits.
The document discusses several techniques for using symbolic execution for software debugging, including regression debugging, cause clue clauses, error invariants, and angelic debugging. Regression debugging involves comparing execution paths of a failing test case in a new buggy program version to paths in an older stable version to find differences that may indicate the root cause. Other techniques use symbolic execution to extract specifications from passing tests, internal program properties, or previous versions to infer the intended behavior and identify inconsistencies in a failing run.
L’Intégration Continue comme partenaire pour des suggestions d'amélioration des tests
Le CI (Intégration Continue) exécute en continu les tests unitaires et d'intégration pour donner aux développeurs un retour d'information sur la qualité du code. Cependant, il fournit peu de rétroaction sur la qualité des cas de test eux-mêmes. Cet exposé présente deux techniques automatiques qui fonctionnent dans le CI afin de suggérer les faiblesses et les améliorations possibles des cas de test.
La première technique est basée sur du test par mutation. Elle identifie les méthodes pseudo-testées : méthodes qui sont couvertes par la suite de tests mais qui peuvent être complètement supprimées sans qu'aucun cas de test n'échoue. Ceci indique que les cas de test qui couvrent ces méthodes doivent être améliorés pour observer et spécifier le comportement de manière plus approfondie. La seconde technique est basée sur l'amplification de test : elle suggère des améliorations possibles des cas de test pour mieux tester les méthodes pseudo-testées. Les deux techniques sont implémentées pour Java et sont disponibles sous forme d'outils open source : Descartes et DSpot.
The document discusses a new reinforcement learning algorithm called Learned Policy Gradient (LPG). LPG learns to optimize the policy and value function of an agent directly from interactions with the environment. It does this without requiring domain knowledge or manual engineering. LPG consists of an agent parameterized by θ that outputs a policy and prediction vector, and an LPG module parameterized by η that learns to update the agent's θ based on its performance. Experiments show LPG can learn effective policies across different environments, generalize to new tasks, and achieve better performance than baseline algorithms on Atari games after training on simple grid worlds.
A dynamical system for PageRank with time-dependent teleportationDavid Gleich
This document summarizes a presentation about modeling PageRank as a dynamical system with time-dependent teleportation. It discusses representing PageRank as the solution to a differential equation to model how it changes over time as the teleportation distribution varies. This allows PageRank values to become time-series rather than static scores. The model is applied to predict Twitter retweets and analyze causality between Wikipedia pages.
This document discusses dynamic programming algorithms and NP-completeness. It begins by outlining 12 steps for proving that a new problem Pnew is NP-complete. It then provides examples of reducing the clique problem to the independent set problem to show they are equivalent. The document explains the concepts of instances, solutions, validity and reductions. It shows how to reduce any NP problem to the circuit satisfiability problem by building a circuit VI(S) that is equivalent to checking if a solution S is valid for a given instance I.
The document discusses topics in discrete mathematics including methods of proof, algorithms, and number theory. It provides overviews and examples of different types of proofs like direct proof, proof by contradiction, and proof by equivalence. It also discusses algorithms like searching algorithms, sorting algorithms, analyzing their properties, and providing pseudocode examples. Specific algorithms discussed include linear search, binary search, bubble sort, and insertion sort.
GECCO 2014 - Learning Classifier System TutorialPier Luca Lanzi
Learning classifier systems are reinforcement learning methods that represent the value function as a population of condition-action rules called classifiers. Classifiers predict the expected payoff for state-action pairs. At each time step, the classifiers matching the current state are evaluated, an action is selected, and the reward is used to update the predictions of matching classifiers. A genetic algorithm optimizes the population of classifiers to improve the accuracy of predictions over time.
This document provides an introduction to algorithms and their design and analysis. It discusses what algorithms are, their key characteristics, and the steps to develop an algorithm to solve a problem. These steps include defining the problem, developing a model, specifying and designing the algorithm, checking correctness, analyzing efficiency, implementing, testing, and documenting. Common algorithm design techniques like top-down design and recursion are explained. Factors that impact algorithm efficiency like use of loops, initial conditions, invariants, and termination conditions are covered. Finally, common control structures for algorithms like if/else, loops, and branching are defined.
This document describes a parallel k-means clustering algorithm implemented with MPI. The algorithm partitions data points into k clusters based on their distances from centroid points. It was tested with various configurations of centroids, data points, processors, and tasks. Testing showed that processing time increases dramatically with more centroids and data, but only slowly increases or decreases with more processors and tasks, up to a point where adding more processors results in too little data per processor. The algorithm iterates until the difference between new and old centroid positions is minimal, converging on the cluster solutions.
The document describes Q-learning, an algorithm for reinforcement learning. Q-learning allows an agent to learn through trial-and-error interactions with its environment without relying on training data. The algorithm works by the agent storing the quality (Q) of taking actions in a Q-table, which is updated each time an action is taken. The agent's goal is to learn which actions yield the maximum reward by finding the optimal policy that maximizes long-term rewards. The document provides an example of using Q-learning to train a robot to navigate a maze by updating the Q-table after each action based on the reward received.
This document provides an overview of wound healing, its functions, stages, mechanisms, factors affecting it, and complications.
A wound is a break in the integrity of the skin or tissues, which may be associated with disruption of the structure and function.
Healing is the body’s response to injury in an attempt to restore normal structure and functions.
Healing can occur in two ways: Regeneration and Repair
There are 4 phases of wound healing: hemostasis, inflammation, proliferation, and remodeling. This document also describes the mechanism of wound healing. Factors that affect healing include infection, uncontrolled diabetes, poor nutrition, age, anemia, the presence of foreign bodies, etc.
Complications of wound healing like infection, hyperpigmentation of scar, contractures, and keloid formation.
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
Temple of Asclepius in Thrace. Excavation resultsKrassimira Luka
The temple and the sanctuary around were dedicated to Asklepios Zmidrenus. This name has been known since 1875 when an inscription dedicated to him was discovered in Rome. The inscription is dated in 227 AD and was left by soldiers originating from the city of Philippopolis (modern Plovdiv).
Gender and Mental Health - Counselling and Family Therapy Applications and In...PsychoTech Services
A proprietary approach developed by bringing together the best of learning theories from Psychology, design principles from the world of visualization, and pedagogical methods from over a decade of training experience, that enables you to: Learn better, faster!
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
Chapter wise All Notes of First year Basic Civil Engineering.pptxDenish Jangid
Chapter wise All Notes of First year Basic Civil Engineering
Syllabus
Chapter-1
Introduction to objective, scope and outcome the subject
Chapter 2
Introduction: Scope and Specialization of Civil Engineering, Role of civil Engineer in Society, Impact of infrastructural development on economy of country.
Chapter 3
Surveying: Object Principles & Types of Surveying; Site Plans, Plans & Maps; Scales & Unit of different Measurements.
Linear Measurements: Instruments used. Linear Measurement by Tape, Ranging out Survey Lines and overcoming Obstructions; Measurements on sloping ground; Tape corrections, conventional symbols. Angular Measurements: Instruments used; Introduction to Compass Surveying, Bearings and Longitude & Latitude of a Line, Introduction to total station.
Levelling: Instrument used Object of levelling, Methods of levelling in brief, and Contour maps.
Chapter 4
Buildings: Selection of site for Buildings, Layout of Building Plan, Types of buildings, Plinth area, carpet area, floor space index, Introduction to building byelaws, concept of sun light & ventilation. Components of Buildings & their functions, Basic concept of R.C.C., Introduction to types of foundation
Chapter 5
Transportation: Introduction to Transportation Engineering; Traffic and Road Safety: Types and Characteristics of Various Modes of Transportation; Various Road Traffic Signs, Causes of Accidents and Road Safety Measures.
Chapter 6
Environmental Engineering: Environmental Pollution, Environmental Acts and Regulations, Functional Concepts of Ecology, Basics of Species, Biodiversity, Ecosystem, Hydrological Cycle; Chemical Cycles: Carbon, Nitrogen & Phosphorus; Energy Flow in Ecosystems.
Water Pollution: Water Quality standards, Introduction to Treatment & Disposal of Waste Water. Reuse and Saving of Water, Rain Water Harvesting. Solid Waste Management: Classification of Solid Waste, Collection, Transportation and Disposal of Solid. Recycling of Solid Waste: Energy Recovery, Sanitary Landfill, On-Site Sanitation. Air & Noise Pollution: Primary and Secondary air pollutants, Harmful effects of Air Pollution, Control of Air Pollution. . Noise Pollution Harmful Effects of noise pollution, control of noise pollution, Global warming & Climate Change, Ozone depletion, Greenhouse effect
Text Books:
1. Palancharmy, Basic Civil Engineering, McGraw Hill publishers.
2. Satheesh Gopi, Basic Civil Engineering, Pearson Publishers.
3. Ketki Rangwala Dalal, Essentials of Civil Engineering, Charotar Publishing House.
4. BCP, Surveying volume 1
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
3. Problem Solving Procedure
문제를 푸는 과정
− 알고리즘을 개발한 후에 이 알고리즘이 정확하다는 것을 증명
− 이 알고리즘이 충분히 빠른 알고리즘인지를 생각
− 괜찮은 알고리즘이면 위의 알고리즘을 오류 없이 구현
정확성의 증명과 효율성
− 알고리즘의 정확성에 대한 수학적 증명
− 알고리즘의 시간이 얼마나 걸릴지 계산하는 과정
POSCAT Seminar 1-3
9 July 2014
yougatup
4. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Verification : Is this algorithm true ?
Efficiency : How long does it takes ?
POSCAT Seminar 1-4
9 July 2014
yougatup
7. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Efficiency : How long does it takes ?
POSCAT Seminar 1-7
9 July 2014
yougatup
8. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Efficiency : How long does it takes ?
POSCAT Seminar 1-8
9 July 2014
yougatup
What is the unit ?
9. Computational Efficiency
알고리즘의 대략적인 연산횟수를 계산
− 연산을 오래 하는 알고리즘이면 시간도 더 느릴 것이다
− 사칙연산, 비교연산 등 연산에 관계없이 모두 1번이라 생각
− 데이터 크기에 따라 연산 횟수가 달라짐 n에 대한 함수 필요
− 정확하게는 세기 어려움
몇 번의 연산이 필요한가 ?
POSCAT Seminar 1-9
9 July 2014
yougatup
10. Computational Efficiency
알고리즘의 대략적인 연산횟수를 계산
− 연산을 오래 하는 알고리즘이면 시간도 더 느릴 것이다
− 사칙연산, 비교연산 등 연산에 관계없이 모두 1번이라 생각
− 데이터 크기에 따라 연산 횟수가 달라짐 n에 대한 함수 필요
− 정확하게는 세기 어려움
몇 번의 연산이 필요한가 ? 약 n번
POSCAT Seminar 1-10
9 July 2014
yougatup
11. Computational Efficiency
알고리즘의 대략적인 연산횟수를 계산
− 연산을 오래 하는 알고리즘이면 시간도 더 느릴 것이다
− 사칙연산, 비교연산 등 연산에 관계없이 모두 1번이라 생각
− 데이터 크기에 따라 연산 횟수가 달라짐 n에 대한 함수 필요
− 정확하게는 세기 어려움
몇 번의 연산이 필요한가 ? O(𝒏)
POSCAT Seminar 1-11
9 July 2014
yougatup
22. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Efficiency : How long does it takes ?
POSCAT Seminar 1-22
9 July 2014
yougatup
What is the unit ?
23. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Efficiency : How long does it takes ?
POSCAT Seminar 1-23
9 July 2014
yougatup
What is the unit ?
The number of operations !
24. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Efficiency : How long does it takes ?
POSCAT Seminar 1-24
9 July 2014
yougatup
So, what is the efficiency ?
25. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Efficiency : How long does it takes ?
POSCAT Seminar 1-25
9 July 2014
yougatup
So, what is the efficiency ?
26. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Efficiency : How long does it takes ?
POSCAT Seminar 1-26
9 July 2014
yougatup
So, what is the efficiency ?
We need pseudo-code
27. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Efficiency : How long does it takes ?
POSCAT Seminar 1-27
9 July 2014
yougatup
28. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Efficiency : How long does it takes ?
POSCAT Seminar 1-28
9 July 2014
yougatup
O(y)
29. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Efficiency : How long does it takes ?
POSCAT Seminar 1-29
9 July 2014
yougatup
O(y)
Done!
30. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥
𝑥 ∙ 𝑦 − 1 + 𝑥
𝑖𝑓 𝑦 = 1
𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Efficiency : How long does it takes ?
POSCAT Seminar 1-30
9 July 2014
yougatup
O(y)
Done!
Is there another algorithm faster ?
31. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥 + (2 ∙ 𝑥 ∙
𝑦
2
)
2 ∙ 𝑥 ∙
𝑦
2
𝑖𝑓 𝑦 𝑖𝑠 𝑜𝑑𝑑
𝑖𝑓 𝑦 𝑖𝑠 𝑒𝑣𝑒𝑛
Verification : Is this algorithm true ?
Efficiency : How long does it takes ?
POSCAT Seminar 1-31
9 July 2014
yougatup
32. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥 + (2 ∙ 𝑥 ∙
𝑦
2
)
2 ∙ 𝑥 ∙
𝑦
2
𝑖𝑓 𝑦 𝑖𝑠 𝑜𝑑𝑑
𝑖𝑓 𝑦 𝑖𝑠 𝑒𝑣𝑒𝑛
Verification : Is this algorithm true ? Mathematical Induc.
Efficiency : How long does it takes ? O(log 𝑦)
POSCAT Seminar 1-32
9 July 2014
yougatup
33. Basic Arithmetic
Multiplication
𝑥 ∙ 𝑦 =
𝑥 + (2 ∙ 𝑥 ∙
𝑦
2
)
2 ∙ 𝑥 ∙
𝑦
2
𝑖𝑓 𝑦 𝑖𝑠 𝑜𝑑𝑑
𝑖𝑓 𝑦 𝑖𝑠 𝑒𝑣𝑒𝑛
Verification : Is this algorithm true ? Mathematical Induc.
Efficiency : How long does it takes ? O(log 𝑦)
POSCAT Seminar 1-33
9 July 2014
yougatup
그냥 x*y 하면 될걸 무슨 이런 헛짓을…
34. Basic Arithmetic
Power
Derive the efficient algorithm to calculate 𝑥 𝑦
Find correct algorithm which takes O(log 𝑦)
Also, give me the pseudo-code
POSCAT Seminar 1-34
9 July 2014
yougatup
45. Basic Arithmetic
Euclid’s Rule
gcd 𝑥, 𝑦 = gcd(𝑥 𝑚𝑜𝑑 𝑦, 𝑦)
How long does it takes ?
POSCAT Seminar 1-45
9 July 2014
yougatup
46. Basic Arithmetic
Euclid’s Rule
gcd 𝑥, 𝑦 = gcd(𝑥 𝑚𝑜𝑑 𝑦, 𝑦)
How long does it takes ?
Claim. If 𝑎 ≥ 𝑏 then 𝑎 𝑚𝑜𝑑 𝑏 < 𝑎/2
Consider the cases 𝑏 ≤ 𝑎/2 and 𝑏 > 𝑎/2
POSCAT Seminar 1-46
9 July 2014
yougatup
47. Basic Arithmetic
Euclid’s Rule
gcd 𝑥, 𝑦 = gcd(𝑥 𝑚𝑜𝑑 𝑦, 𝑦)
How long does it takes ?
Claim. If 𝑎 ≥ 𝑏 then 𝑎 𝑚𝑜𝑑 𝑏 ≤ 𝑎/2
Consider the cases 𝑏 ≤ 𝑎/2 and 𝑏 > 𝑎/2
If 𝑏 ≤ 𝑎/2 then 𝑎 𝑚𝑜𝑑 𝑏 < 𝑏 ≤ 𝑎/2
𝑏 > 𝑎/2 then 𝑎 𝑚𝑜𝑑 𝑏 = 𝑎 − 𝑏 < 𝑎/2
POSCAT Seminar 1-47
9 July 2014
yougatup
48. Basic Arithmetic
Euclid’s Rule
gcd 𝑥, 𝑦 = gcd(𝑥 𝑚𝑜𝑑 𝑦, 𝑦)
How long does it takes ?
After two consecutive round, a and b are at least half
O(𝐥𝐨𝐠 𝒏)
POSCAT Seminar 1-48
9 July 2014
yougatup
49. Primarity Testing
Problem Definition
Given p, determine whether p is prime number or not
Given a interval [s, e], show all of the prime numbers in the interval
Approach
− Naïve approach
− Eratosthenes’ seive
POSCAT Seminar 1-49
9 July 2014
yougatup
50. Primarity Testing
Given p, determine whether p is prime number or not
Naïve approach
For all 2 ≤ 𝑖 ≤ 𝑝 − 1, test whether 𝑖 divides p
If there is such 𝑖, then p is NOT prime number
Otherwise, p is prime number
Verification : Is this algorithm true ?
Efficiency : How long does it takes ?
POSCAT Seminar 1-50
9 July 2014
yougatup
51. Primarity Testing
Given p, determine whether p is prime number or not
Naïve approach
For all 2 ≤ 𝑖 ≤ 𝑝 − 1, test whether 𝑖 divides p
If there is such 𝑖, then p is NOT prime number
Otherwise, p is prime number
Verification : Is this algorithm true ? By definition of prime number
Efficiency : How long does it takes ? O(𝑝)
POSCAT Seminar 1-51
9 July 2014
yougatup
52. Primarity Testing
Given p, determine whether p is prime number or not
Naïve approach
For all 2 ≤ 𝑖 ≤ 𝑝 − 1, test whether 𝑖 divides p
If there is such 𝑖, then p is NOT prime number
Otherwise, p is prime number
Verification : Is this algorithm true ? By definition of prime number
Efficiency : How long does it takes ? O(𝑝)
POSCAT Seminar 1-52
9 July 2014
yougatup
Is there another algorithm faster ?
53. Primarity Testing
Given p, determine whether p is prime number or not
We don’t have to consider all such 𝑖 !
It is sufficient to consider 2 ≤ 𝑖 ≤ √𝑝, Why ?
Verification : Is this algorithm true ? By definition of prime number
Efficiency : How long does it takes ? O(𝑝)
POSCAT Seminar 1-53
9 July 2014
yougatup
54. Primarity Testing
Given p, determine whether p is prime number or not
We don’t have to consider all such 𝑖 !
It is sufficient to consider 2 ≤ 𝑖 ≤ √𝑝, Why ?
If p is tested as prime number when 𝑖 > √𝑝, It must be tested before !
Verification : Is this algorithm true ? By definition of prime number
Efficiency : How long does it takes ? O(𝑝)
POSCAT Seminar 1-54
9 July 2014
yougatup
55. Primarity Testing
Given p, determine whether p is prime number or not
We don’t have to consider all such 𝑖 !
It is sufficient to consider 2 ≤ 𝑖 ≤ √𝑝, Why ?
If p is tested as prime number when 𝑖 > √𝑝, It must be tested before !
Verification : Is this algorithm true ? By definition of prime number
Efficiency : How long does it takes ? O(√𝒑)
POSCAT Seminar 1-55
9 July 2014
yougatup
56. Given a interval [s, e], show all of the prime numbers in the interval
Naïve approach
For all numbers 𝑥 in the interval, test it
Verification : Is this algorithm true ? Trivial
Efficiency : How long does it takes ? O(𝒏√𝒏)
POSCAT Seminar 1-56
9 July 2014
yougatup
Primarity Testing
57. Given a interval [s, e], show all of the prime numbers in the interval
Naïve approach
For all numbers 𝑥 in the interval, test it
Verification : Is this algorithm true ? Trivial
Efficiency : How long does it takes ? O(𝒏√𝒏)
POSCAT Seminar 1-57
9 July 2014
yougatup
Is there another algorithm faster ?
Primarity Testing
58. Eratosthenes’ seive
Simple Algorithm
1. ‘1’ is not a prime number by definition
2. Pick the smallest value among we have, which is 2
3. Erase all the numbers divided by 2 ( except 2 )
4. Pick the smallest value among we have, which is 3
5. Erase all the numbers divided by 3 ( except 3 )
6. Repeat this procedure
POSCAT Seminar 1-58
9 July 2014
yougatup
60. Eratosthenes’ seive
Simple Algorithm
‘1’ is not a prime number by definition
POSCAT Seminar 1-60
9 July 2014
yougatup
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
61. Eratosthenes’ seive
Simple Algorithm
Pick the smallest value among we have, which is 2
POSCAT Seminar 1-61
9 July 2014
yougatup
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
62. Eratosthenes’ seive
Simple Algorithm
Erase all the numbers divided by 2 ( except 2 )
POSCAT Seminar 1-62
9 July 2014
yougatup
2 3 5 7 9 11 13 15 17
63. Eratosthenes’ seive
Simple Algorithm
Pick the smallest value among we have, which is 3
POSCAT Seminar 1-63
9 July 2014
yougatup
2 3 5 7 9 11 13 15 17
64. Eratosthenes’ seive
Simple Algorithm
Erase all the numbers divided by 3 ( except 3 )
POSCAT Seminar 1-64
9 July 2014
yougatup
2 3 5 7 11 13 17
65. Eratosthenes’ seive
Simple Algorithm
Pick the smallest value among we have, which is 5
POSCAT Seminar 1-65
9 July 2014
yougatup
2 3 5 7 11 13 17
66. Eratosthenes’ seive
Simple Algorithm
Erase all the numbers divided by 5 ( except 5 )
POSCAT Seminar 1-66
9 July 2014
yougatup
2 3 5 7 11 13 17
69. Eratosthenes’ seive
Analysis
Verification : Is this algorithm true ? It looks like …
Efficiency : How long does it takes ?
Suppose that we want to find all the prime numbers in [1, n]
Let’s focus on a integer 𝑥 in the interval
Then 𝑥 is “clicked” as many as the number of divisor of 𝑥
It must be bounded by O(log 𝑥) for each 𝑥
Therefore, It takes O(𝒏 𝐥𝐨𝐠 𝒏)
POSCAT Seminar 1-69
9 July 2014
yougatup
Much better than O(𝑛√𝑛) !
70. Bipartite Matching
Problem Definition (weak)
Maximize the number of matched pair on bipartite graph
POSCAT Seminar 1-70
9 July 2014
yougatup
1
2
3
4
1
2
3
4
71. Bipartite Matching
Problem Definition (weak)
Maximize the number of matched pair on bipartite graph
POSCAT Seminar 1-71
9 July 2014
yougatup
1
2
3
4
1
2
3
4
72. Stable Matching
Problem Definition (weak)
N명의 남자와 여자가 미팅을 하기 위해서 만남
남자와 여자 모두 원하는 상대방의 우선순위를 정함
서로 짝이 아닌 두 남녀가 자신의 짝보다 상대방을 더 선호하면 ?
POSCAT Seminar 1-72
9 July 2014
yougatup
1
2
3
1
2
3
난 1번보다 3번이 더 좋은데…난 1번보다 3번이 더 좋은데…
男 女
73. Stable Matching
Problem Definition (weak)
N명의 남자와 여자가 미팅을 하기 위해서 만남
남자와 여자 모두 원하는 상대방의 우선순위를 정함
서로 짝이 아닌 두 남녀가 자신의 짝보다 상대방을 더 선호하면 ?
POSCAT Seminar 1-73
9 July 2014
yougatup
1
2
3
1
2
3
男 女
도망ㅋ
헐
헐
??
74. Stable Matching
Problem Definition (weak)
N명의 남자와 여자가 미팅을 하기 위해서 만남
남자와 여자 모두 원하는 상대방의 우선순위를 정함
서로 짝이 아닌 두 남녀가 자신의 짝보다 상대방을 더 선호하면 ?
이런 불상사가 나지 않도록 짝을 짓는 것이 가능한가?
POSCAT Seminar 1-74
9 July 2014
yougatup
75. Stable Matching
Problem Definition (weak)
N명의 남자와 여자가 미팅을 하기 위해서 만남
남자와 여자 모두 원하는 상대방의 우선순위를 정함
서로 짝이 아닌 두 남녀가 자신의 짝보다 상대방을 더 선호하면 ?
이런 불상사가 나지 않도록 짝을 짓는 것이 가능한가?
Yes ! 가능하다는 것을 해를 구하는 알고리즘으로 증명
2012년 노벨 경제학상을 받게 한 알고리즘 (Gale-Shapely Algorithm)
POSCAT Seminar 1-75
9 July 2014
yougatup
76. Stable Matching
Problem Definition (weak)
1. 처음에 남성이 모두 가장 선호하는 여성에게 프로포즈를 함
2. 여성이 그 중 가장 마음에 드는 남성을 고르고 나머지는 퇴짜
3. 퇴짜맞은 남성은 그 다음으로 선호하는 여성이 파트너가 있던
말던 프로포즈를 함
4. 여성은 현재 자신의 파트너보다 프로포즈 한 남성이 더 마음에
든다면 자신의 파트너에게 퇴짜를 놓음
5. 이 과정을 계속해서 반복 !
POSCAT Seminar 1-76
9 July 2014
yougatup
77. Stable Matching
Correctness
− Is it terminate ? // 언젠간 종료하는가 ?
− Is there any lonely man or woman ? // 짝 없는 사람이 존재하는가 ?
− Is it stable ? // 불상사가 없는가 ?
POSCAT Seminar 1-77
9 July 2014
yougatup
79. Stable Matching
Correctness
− Is it terminate ? // 언젠간 종료하는가 ?
각 남성은 많아야 n명에게 프로포즈를 하고, 같은 사람에게 두 번 하지 않는다.
따라서 이 과정은 언젠간 종료된다.
POSCAT Seminar 1-79
9 July 2014
yougatup
80. Stable Matching
Correctness
− Is there any lonely man or woman ? // 짝 없는 사람이 존재하는가 ?
POSCAT Seminar 1-80
9 July 2014
yougatup
81. Stable Matching
Correctness
− Is there any lonely man or woman ? // 짝 없는 사람이 존재하는가 ?
여성이 짝이 없다고 가정하자. 그렇다면 한 명도 프로포즈한 남성이 없다.
그러면 모든 남성이 n-1명의 여성과 짝을 이룬다는 것이므로 모순.
남성이 짝이 없다고 가정하자. 그렇다면 모두 퇴짜를 맞았다는 것이다.
그러면 모든 여성이 n-1명의 남성과 짝을 이룬다는 것이므로 모순.
POSCAT Seminar 1-81
9 July 2014
yougatup
83. Stable Matching
Correctness
− Is it stable ? // 불상사가 없는가 ?
불상사가 생긴 남성과 여성이 존재한다고 가정하자.
편의상 현재 파트너를 X, 불상사가 생기는 파트너를 Y 이라고 하자.
남성은 Y를 X보다 더 좋아한다. 그러면 X보다 Y에게 더 먼저 프로포즈 했을 것.
여성은 현재 이 남성과 파트너가 아니므로 퇴짜를 놓았다는 뜻이다.
하지만 여성 역시 현재 자신의 파트너보다 이 남성이 더 좋은 상황이다.
더 좋은 사람을 퇴짜 놓은 상황이므로 모순.
POSCAT Seminar 1-83
9 July 2014
yougatup
84. Question ?
To-do List
− 코딩 합시다
POSCAT Seminar 1-84
9 July 2014
yougatup