7-Dec-15 Super Chicken A little puzzle. Pecking order Assumptions: Chickens have a pecking order: Given any two chickens A and B, either A pecks B or.

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

11-3: Subtracting Integers
Subtracting Integers with Tiles
ALGEBRA TILES.
The Intersection of Lines. ( Notice that different parameters are used. ) and Solution: e.g. Determine whether the lines given below intersect. If they.
Ordered pairs ( x , y ) as solutions to Linear Equations
Warmup. 1) Solve. 3x + 2 = 4x - 1 You need to get the variables on one side of the equation. It does not matter which variable you move. Try to move the.
Local Search Algorithms Chapter 4. Outline Hill-climbing search Simulated annealing search Local beam search Genetic algorithms Ant Colony Optimization.
CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1.
8.3 Representing Relations Connection Matrices Let R be a relation from A = {a 1, a 2,..., a m } to B = {b 1, b 2,..., b n }. Definition: A n m  n connection.
1 Section 7.3 Representing relations (part 1: matrices)
Special Factoring Forms Solving Polynomial Equations
CS 61B Data Structures and Programming Methodology July 31, 2008 David Sun.
Backtracking COP Backtracking  Backtracking is a technique used to solve problems with a large search space, by systematically trying and eliminating.
1 Introduction to Computability Theory Lecture15: Reductions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Tirgul 9 Amortized analysis Graph representation.
CS420 lecture ten BACKTRACK. Solution vectors In optimization problems, or more general in search problems, a set of choices are to be made to arrive.
Estimating Areas The art of Math. Exact Answers? Not Exactly… You can’t always get an exact answer But sometimes you still need to get very close to the.
Chapter 1 Systems of Linear Equations
Mr Barton’s Maths Notes
Today’s quiz on 8.2 A Graphing Worksheet 1 will be given at the end of class. You will have 12 minutes to complete this quiz, which will consist of one.
Intro to Matrices Don’t be scared….
Created by L. Henderson. 3 x 4 = 12 factor factor product.
Warm Up #4 1. Evaluate –3x – 5y for x = –3 and y = 4. –11 ANSWER
Graphs of Equations in Two Variables Including Graphs of Functions (2.1, 2.2)
Solving Linear Systems Substitution Method Lisa Biesinger Coronado High School Henderson,Nevada.
Solving Systems of Equations by matrices
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall.
Chapter 6.7 Determinants. In this chapter all matrices are square; for example: 1x1 (what is a 1x1 matrix, in fact?), 2x2, 3x3 Our goal is to introduce.
Short Division.
F UNDAMENTALS OF E NGINEERING A NALYSIS Eng. Hassan S. Migdadi Inverse of Matrix. Gauss-Jordan Elimination Part 1.
Lesson 13-1: Matrices & Systems Objective: Students will: State the dimensions of a matrix Solve systems using matrices.
Targil 6 Notes This week: –Linear time Sort – continue: Radix Sort Some Cormen Questions –Sparse Matrix representation & usage. Bucket sort Counting sort.
Solving Linear Equations To Solve an Equation means... To isolate the variable having a coefficient of 1 on one side of the equation. Examples x = 5.
MA10209 – Week 5 Tutorial B3/B4, Andrew Kennedy. people.bath.ac.uk/aik22/ma10209 Top Tips (response to sheet 4)  Try to think about whether answers make.
MAT 2401 Linear Algebra 1.1, 1.2 Part I Gauss- Jordan Elimination
1. Put in slope-intercept form: 3x – 4y = Graph the line: y = -1/2 x + 3.
Linear Equations in Two Variables A Linear Equation in Two Variables is any equation that can be written in the form where A and B are not both zero.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
Linear Equations, Inequalities, and Absolute Value - Graphing Solution Sets On a Number Line As we saw with the absolute value equations, we could get.
Solving Systems of Equations Algebraically Elimination.
Prime and composite numbers are all about multiplication
4.5 Matrices, Determinants, Inverseres -Identity matrices -Inverse matrix (intro) -An application -Finding inverse matrices (by hand) -Finding inverse.
SOLVING LINEAR SYSTEMS WITH SUBSTITUTION by Sam Callahan.
AS91587 Simultaneous Equations. In mathematics, a system of linear equations (or linear system) is a collection of linear equations involving the same.
Solving Linear Systems of Equations - Concept Consider the following set of equations: Such a set is called a Linear System of Equations in two variables.
Chapter 1 Systems of Linear Equations Linear Algebra.
Lesson 7.1 Solving Systems of Equations by Graphing.
Solve for the variable 1. 5x – 4 = 2x (x + 2) + 3x = 2.
Systems of Linear Equations A system of linear equations consists of two or more linear equations. We will focus on only two equations at a time. The solution.
Systems of Equations By Substitution and Elimination.
Prerequisite Skills Review 1.) Simplify: 8r + (-64r) 2.) Solve: 3x + 7(x – 1) = 23 3.) Decide whether the ordered pair (3, -7) is a solution of the equation.
Lesson 5-4 Example Example 1 Draw an array to model and find 21 ÷ 3. 1.Write the answer if you know it. Otherwise, draw an array.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Paths and circuits.
Introduction Types of Matrices Operations
4.4 Factoring Quadratic Expressions Learning Target: I can find common binomial factors of quadratic expressions. Success Criteria: I can find the factors.
Mr Barton’s Maths Notes
Algebra 6. Factorising Quadratics
Warm Up Use scalar multiplication to evaluate the following:
The Art of Taking Tests:
Objective Graph and solve systems of linear inequalities in two variables.

Math 1201-Unit:7 Systems of Linear equations
Objectives Identify solutions of linear equations in two variables.
Mr Barton’s Maths Notes
Lecture 20 State minimization via row matching.
Chapter 3.1 Solving Linear Systems by Graphing
Implementation of Learning Systems
Presentation transcript:

7-Dec-15 Super Chicken A little puzzle

Pecking order Assumptions: Chickens have a pecking order: Given any two chickens A and B, either A pecks B or B pecks A (but not both) Pecking is not transitive: If chicken A pecks chicken B, and chicken B pecks chicken C, you don’t know whether chicken A pecks chicken C or chicken C pecks chicken A No chicken pecks itself Problem: Given a set of chickens and full information about who pecks whom, is there a super chicken—a chicken that pecks every other chicken (and is pecked on by none)? “There can be only one.”

Array representation We will use a 1 in [i][j] to show that chicken i pecks chicken j, and a 0 to show that it doesn’t The main diagonal ( i==j ) is all zeros, because no chicken pecks itself Except when i==j, the value in [i][j] is always different from the value in [j][i] I’ve colored a few [i][j], [j][i] pairs as examples An array with this form is called antisymmetric Notice that for n chickens, it requires n 2 time (and n 2 space) to create this array

Finding the super chicken A super chicken is one who is never pecked on Hence, the column for that chicken has all zeros (And the row has all ones, except for the cell on the main diagonal) It’s easy to come up with an n 2 algorithm to find the super chicken for each column c do for each row r do check if [r][c] is zero if not, try the next column You can’t do better than O(n 2 ) in creating the array There is an O(n) (linear time) algorithm for finding the super chicken Can you discover it?

About this puzzle This puzzle is not for credit, so don’t hand anything in When you find the answer, don’t give it away to your friends—make them work for it The answer is simple enough that, when you have found it, you will know you have found it If you aren’t sure, your solution is too complicated I think you will agree that finding the solution gives you a very satisfied feeling Analysis of algorithms is all about finding better solutions to problems

The End