(define (make-rat n d) (if (and (number? n) (number? d) (not (= d 0))) (cons n d) (error "cannot make a rat with denominator 0"))) (define (numer r) (head.

Slides:



Advertisements
Similar presentations
Fractions V Mixed Numbers
Advertisements

Conflict resolution. Background Input: set of « fireable instances » –Instance = (, substitution) –Substitution = {(c i /?x i )} for all ?x i in Var(rule)
Simplify Warm-up. Compare and Contrast Notes - Adding and Subtracting with LIKE Denominators When you are adding or subtracting rational expressions….
Mechanisms II.
Fractions. ADDING FRACTIONS  Build each fraction so that the denominators are the same  ADD the numerators  Place the sum of the two numerators on.
CH4 EXERCISES 4.2. Given two relations R1 and R2, where R1 contains N1 tuples, R2 contains N2 tuples, and N2 > N1 > 0, give the min and max possible sizes.
 Ammar Abh-Hhdrohss Islamic University -Gaza 1 Chapter 2 Concatenated codes.
Adding and Subtracting Fractions with Like Denominators.
Fractions – Adding Fractions
6.4 Adding and Subtracting Rational Expressions. Objective 1 Add rational expressions having the same denominator. Slide
Chapter 6 Section 4 Objectives 1 Copyright © 2012, 2008, 2004 Pearson Education, Inc. Adding and Subtracting Rational Expressions Add rational expressions.
Goal: Add and subtract rational expressions. Eligible Content: A ADDING AND SUBTRACTING RATIONAL EXPRESSIONS.
Operations with Fractions. Adding and Subtracting Fractions.
By: Daviana Soberanis. Step 1 Step 1: Decide what your fraction is. Put down the numerator. Press the division sign. Put down the denominator. Press enter.
7.8 Partial Fractions. If we wanted to add something like this: We would need to find a common denominator! Now, we want to REVERSE the process! Go from.
Mixed Numbers to Improper Fractions. Lets say you have a mixed number of 1 and 5/8 You can change this into the number 13/8. For converting mixed numbers.
Warm-up: Here is an example to help you do this warm-up.
Add & Subtract Rationals – Common Denominator To add or subtract rational expressions with common denominators: 1) Add or subtract the numerators 2) Write.
SECTION 1.4 EXPONENTS. PRODUCT OF POWERS When you multiply two factors having the same base, keep the common base and add the exponents.
Addition and Subtraction of Fractions
Adding Fractions - N. Perez Adding Fractions Positive Fractions.
Unit 2: Integers Unit Review. Multiplying Integers The product of two integers with the same sign is a positive. Eg: (+6) x (+4) = +24; (-18) x (-3) =
Warm Up Add or subtract x ≠ x ≠ –1, x ≠ 1 Simplify. Identify any x-values for which the expression is undefined –
Absolute Value and turning mixed numbers to improper fractions.
Complex Numbers warm up 4 Solve the following Complex Numbers Any number in form a+bi, where a and b are real numbers and i is imaginary. What is an.
10.4 Addition and Subtraction: Like Denominators.
Part of a set or part of a whole. 3 4 =Numerator the number of parts = Denominator the number that equals the whole.
Turn in your homework You need a pencil, paper, and the notes.
Section 6.3 Addition, Subtraction, and Least Common Denominator.
6.1 Properties of Exponents Use properties of exponents Use negative and zero as an exponent EQ: What are the general rules involving properties of exponents?
Fractions Just the basics. Fractions This is the easiest operation! 1. Multiply the numerators. 2. Multiply the denominators. 3. Simplify if necessary.
Abstraction A way of managing complexity for large programs A means of separating details of computation from use of computation Types of Abstraction Data.
Unit 7 - Exponents.
Multiplication and Division of Powers
Adding Fractions.
Adding and Subtracting Rational Expressions
Adding and Subtracting Fractions
Simplifying Rational Expressions
8.1 Fitting Integration Rules
Fractions: Adding and Subtracting Like Denominators
Add & Subtract Rationals – Common Denominator
كيــف تكتـب خطـة بحـث سيئـة ؟؟
الدكتـور/ عبدالناصـر محمـد عبدالحميـد
I can separate a fraction in more than one way by using an equation
كار همراه با آسودگي و امنيت
Lecture #6 מבוא מורחב.
10:00.
Fractions: Adding and Subtracting Like Denominators
Percents, Fractions, and Decimals
Subtracting Like and Unlike Fractions
Math Jeopardy (Exponents)
Fractions and Mixed Numbers
Percents, Fractions, and Decimals
Subtracting Like and Unlike Fractions
Lecture #6 section pages pages72-77
Fractions VI Adding Like Denominators
Homework Help.
Lecture #7 מבוא מורחב.
10.4 Addition and Subtraction: Like Denominators
Adding fractions with like Denominators
Fractions VII Adding Like Denominators
Percents, Fractions, and Decimals
29. Add and Subtract Rational Expressions
Fractions, Decimals, Percents
EQ: What other functions can be made from
Number Systems-Part 8.
Multiplying fraction- Cross multiplication method
Chapter 11 Classes.
Types of Errors And Error Analysis.
Presentation transcript:

(define (make-rat n d) (if (and (number? n) (number? d) (not (= d 0))) (cons n d) (error "cannot make a rat with denominator 0"))) (define (numer r) (head r)) (define (denom r) (tail r))

(define (rat-add r1 r2) (let ((n1 (numer r1)) (d1 (denom r1)) (n2 (numer r2)) (d2 (denom r2))) (make-rat (+ (* n1 d2) (* n2 d1)) (* d1 d2)))) (define (rat-mul r1 r2) (let ((n1 (numer r1)) (d1 (denom r1)) (n2 (numer r2)) (d2 (denom r2))) (make-rat (* n1 n2) (* d1 d2))))

(define (rat-eq r1 r2) (let ((n1 (numer r1)) (d1 (denom r1)) (n2 (numer r2)) (d2 (denom r2))) (= (* n1 d2) (* n2 d1)))) (define (rat-leq r1 r2) (let ((n1 (numer r1)) (d1 (denom r1)) (n2 (numer r2)) (d2 (denom r2))) (if (>= (* d1 d2) 0) ;;if d1 and d2 have the same sign ( = (* n1 d2) (* n2 d1)))))

(define (make-rat n d) (if (and (number? n) (number? d) (not (= d 0))) (let ((g (gcd n d))) (cons (/ n g) (/ d g))) (error "..."))) (define (rat-eq r1 r2) (and (= (numer r1) (numer r2)) (= (denom r1) (denom r2))))

(define (make-rat n d) (if (and (number? n) (number? d) (not (= d 0))) (let* ((n2 (if (> d 0) n (- n))) (d2 (if (> d 0) d (- d))) (g (gcd n2 d2))) (cons (/ n2 g) (/ d2 g))) (error "..."))) (define (rat-leq r1 r2) (let ((n1 (numer r1)) (d1 (denom r1)) (n2 (numer r2)) (d2 (denom r2))) (<= (* n1 d2) (* n2 d1))))

(defstruct (n ) (d )) (define (numer (r )) (get-rat-n r)) (define (denom (r )) (get-rat-d r)) (define (new-rat (n ) (d )) (if (not (zero? d)) (let ((g (gcd n d))) (make-rat (/ n g) (/ d g))) (error "...")))

(define (rat-add (r1 ) (r2 )) (let ((n1 (numer r1)) (d1 (denom r1)) (n2 (numer r2)) (d2 (denom r2))) (new-rat (+ (* n1 d2) (* n2 d1)) (* d1 d2)))) (define (rat-mul (r1 ) (r2 )) (let ((n1 (numer r1)) (d1 (denom r1)) (n2 (numer r2)) (d2 (denom r2))) (new-rat (* n1 n2) (* d1 d2))))

(define (rat-eq (r1 ) (r2 )) (let ((n1 (numer r1)) (d1 (denom r1)) (n2 (numer r2)) (d2 (denom r2))) (= (* n1 d2) (* n2 d1)))) (define (rat-leq (r1 ) (r2 )) (let ((n1 (numer r1)) (d1 (denom r1)) (n2 (numer r2)) (d2 (denom r2))) (if (>= (* d1 d2) 0) ;;if d1 and d2 have the same sign ( = (* n1 d2) (* n2 d1)))))

(define (new-rat (n ) (d )) (if (not (= d 0)) (let ((g (gcd n d))) (make-rat (/ n g) (/ d g))) (error "..."))) (define (rat-eq (r1 ) (r2 )) (and (= (numer r1) (numer r2)) (= (denom r1) (denom r2))))

(define (new-rat (n ) (d )) (if (not (= d 0)) (let* ((n2 (if (> d 0) n (- n))) (d2 (if (> d 0) d (- d))) (g (gcd n2 d2))) (make-rat (/ n2 g) (/ d2 g))) (error "..."))) (define rat-leq (r1 ) (r2 )) (let ((n1 (numer r1)) (d1 (denom r1)) (n2 (numer r2)) (d2 (denom r2))) (<= (* n1 d2) (* n2 d1))))