Recursive functions ACSL. A definition that defines an object in terms of itself is said to be recursive Many expressions may be defined recursively in.

Slides:



Advertisements
Similar presentations
Special Equations - Absolute Value and Interval Notation
Advertisements

New Mexico Computer Science For All
Unit 14 SIMPLE EQUATIONS.
EXAMPLE 2 Use a ratio to find a dimension SOLUTION Painting You are planning to paint a mural on a rectangular wall. You know that the perimeter of the.
Intro to Algebra/Geometry Solving Equations by Adding or Subtracting.
EXAMPLE 1 Solve a simple absolute value equation Solve |x – 5| = 7. Graph the solution. SOLUTION | x – 5 | = 7 x – 5 = – 7 or x – 5 = 7 x = 5 – 7 or x.
Solving Multiplication and Division Equations
7.8 Equations Involving Radicals. Solving Equations Involving Radicals :  1. the term with a variable in the radicand on one side of the sign.  2. Raise.
Algebra 1: Solving Equations with variables on BOTH sides.
Functions (Notation and Evaluating). Definitions RelationA relationship between sets of information. Typically between inputs and outputs. FunctionA relation.
© 2007 by S - Squared, Inc. All Rights Reserved.
A radical equation is an equation that contains a radical.
Explicit, Summative, and Recursive
Function Notation Evaluating a function means figuring out the value of a function’s output from a particular value of the input. Example. Let the function.
Solving equations Section 1.4.
Variables and Equations Pre-Algebra. Learning Objective I can solve equations with variables.
Functions, Function Notation, and Composition of Functions.
Algebra! The area of mathematics that generalizes the concepts and rules of arithmetic using symbols to represent numbers.
Compound Absolute Values Equalities and Inequalities More than one absolute value in the equation.
Quarterly Assessment 3 Warm Up # 3 Work on your Make up QA.
Equation y + 5 y + 5 = 20 Expressions
Zero Product Property. Zero Product Property If ab = 0, then ??? If ab = 0 then either a = 0 or b = 0 (or both). If the product 0f two numbers is 0, then.
Introduction to Variables, Algebraic Expressions, and Equations You Need Your Comp Book.
EXAMPLE 2 Use a ratio to find a dimension SOLUTION Painting You are planning to paint a mural on a rectangular wall. You know that the perimeter of the.
Review of Topic Equations Changing subject of formulae Inequalities.
Math 1111 Review for Test #1 Sections 1.2 – 2.1. Function or Not a Function? {(4, -5), (3, 4), (-2, 5)} A. Function B. Not a Function.
Example 1 Solving Two-Step Equations SOLUTION a. 12x2x + 5 = Write original equation. 112x2x + – = 15 – Subtract 1 from each side. (Subtraction property.
Solving Linear Equations Substitution. Find the common solution for the system y = 3x + 1 y = x + 5 There are 4 steps to this process Step 1:Substitute.
Holt Algebra Solving Quadratic Equations by Using Square Roots 9-7 Solving Quadratic Equations by Using Square Roots Holt Algebra 1 Warm Up Warm.
Prerequisite Skills VOCABULARY CHECK Copy and complete the statement. ANSWER –9, 9 1. The square roots of 81 are ? and ?. 2. In the expression 2 5, the.
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Learning Objectives for Section 5.1 Inequalities in Two Variables The student will be able to graph linear.
Sequences and Series Explicit, Summative, and Recursive.
Chapter 3 Polynomial and Rational Functions Copyright © 2014, 2010, 2007 Pearson Education, Inc Polynomial and Rational Inequalities.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 1 Whole Numbers.
Bell Work: Simplify 4/5 + 1/2. Answer: 4/5 + ½ = 13/10 or 1 3/10.
11.3 Solving Radical Equations Definitions & Rules Simplifying Radicals Practice Problems.
Algebra 2 Section 3.1.  Square Root:  Cube Root:  4 th root:  5 th root:  6 th root:  111 th root:
Solving Equations. An equation links an algebraic expression and a number, or two algebraic expressions with an equals sign. For example: x + 7 = 13 is.
Solving Polynomials Review of Previous Methods Factoring Cubic Expressions.
Jeopardy Q $100 Q $100 Q $100 Q $100 Q $100 Q $200 Q $200 Q $200
October 29, 2013 Welcome! We will begin shortly..
Substitution Method: Solve the linear system. Y = 3x + 2 Equation 1 x + 2y=11 Equation 2.
Lesson 13 ONE STEP EQUATIONS A.4e.
Solving the Quadratic Equation by Completing the Square
Functions (Notation and Evaluating)
Chapter 7 Objectives Define basic terms in algebra: integer, number statement, expression, and coefficient Learn the relationships between positive and.
One-Step Equations with Subtraction
Solving Radical Equations
What is an equation? An equation is a mathematical statement that two expressions are equal. For example, = 7 is an equation. Note: An equation.
Use Inverse Functions Lesson 3.4
1.3 Solving Linear Equations
Solving Radical Equations
Evaluate the expression if w = -4, x = 2, y = ½, and z = |6 + z| - |7| Original problem. |6 + (-6)| - |7| Substitute values for the variables.
Functions (Notation and Evaluating)
Notes Over 9.1 Finding Square Roots of Numbers
Objective Solve quadratic equations by using square roots.
a + 2 = 6 What does this represent? 2 a
13.9 Day 2 Least Squares Regression
Solving Logarithmic Equations and Inequalities
Solving the Quadratic Equation by Completing the Square
Solving One-Step Equations
N4 Powers and Roots Contents N4.1 Square and triangular numbers
Solving Polynomials 1 Review of Previous Methods 2 Grouping.
Solving Absolute Value Equations and Inequalities
Substitution 1. Calculate a + b – c If a = 10 b = 8 and c = 12
Solving Equations by 2-1 Adding or Subtracting Warm Up
One-Step Equations with Addition and Subtraction
Solving Equations With One Variable
Completing the Square pages 544–546 Exercises , – , –2
Skill Check Lesson Presentation Lesson Quiz.
Presentation transcript:

Recursive functions ACSL

A definition that defines an object in terms of itself is said to be recursive Many expressions may be defined recursively in a very simple and elegant manner. The art of recursive thinking is an important skill. Applications of recursion appear in many areas of mathematics (factorials, compound interest, difference equations, etc.) In this round recursive relationships will be shown not in the context of a programming language but usually in functional notation from mathematics or in an algorithmic description.

Sample Problem 1 Consider the following recursive algorithm for painting a square: 1. Given a square. 2. If the length of a side is less than 2 feet, then stop. 3. Divide the square into 4 equal size squares (i.e., draw a “plus” sign inside the square). 4. Paint one of these 4 small squares. 5. Repeat this procedure (start at step 1) for each of the 3 unpainted squares. If this algorithm is applied to a square with a side of 16 feet (having a total area of 256 sq. feet), how many square feet will be painted?

Sample Problem 1 Solution In the first pass, we get four squares of side 8. One is painted; three are unpainted. Next, we have 3*4 squares of side 4: three are painted (area=3*4 2 ), nine are not. Next, we have 9*4 squares of side 2: nine are painted (area = 9*2 2 ), 27 are not. Finally, we have 27*4 squares of side 1: twenty-seven are painted. Therefore, the total painted is 1* * * *1 2 = 175.

Sample Problem 2 Evaluate f(12, 6), given: f(x,y) =  f(x-y,y-1) +2 when x>y x+y otherwise Evaluate the function as follows: f(12, 6) = f(6, 5)+2 = (f (1, 4)+2)+2 = f(1, 4)+4 = (1+4)+4 = 9

Sample Problem 3 Find f(6), given: f(x) = f (f (x-2))+1 when x>1 2 when x=1 1 when x=0  Working backwards, we get f(0)= 1 f(1) = 2 f(2) = f(f(0))+1 = f(1)+1 = 2+1 = 3 f(3) = f(f(1))+1 = f(2)+1 = 3+1 = 4 f(4) = f(f(2))+1 = f(3)+1 = 4+1 = 5 f(5) = f(f(3))+1 = f(4)+1 = 5+1 = 6 f(6) = f(f(4))+1 = f(5)+1 = 6+1 = 7

Sample Problem 4 One of the best known recursive functions, Ackerman’s Function, is defined below. Evaluate A(2, 3). A(M,N) = { N+1 if M=0 A(M-1, 1) if M  0, N=0 A(M-1, A(M, N-1)) if M  0, N  0

Sample Problem 4 Solution By evaluating A(1,0), A(1,1), A(1,2) and A(1,3), we see that in general, A(1, x)=2+x. If we evaluate A(2,0), A(2,1), …, we see that in general, A(2,x)=2x+3. To solve our problem, we substitute x=3 and we get an answer of 9.