Number Conversion. Roland Backhouse March 5, 2001

Similar documents
Summary: Congruences. j=1. 1 Here we use the Mathematica syntax for the function. In Maple worksheets, the function

Lesson 10: Limits and Continuity

RADICAL EXPRESSION. If a and x are real numbers and n is a positive integer, then x is an. n th root theorems: Example 1 Simplify

Section 4.1. Properties of Exponents

6 Integers Modulo n. integer k can be written as k = qn + r, with q,r, 0 r b. So any integer.

6.3 Testing Series With Positive Terms

P.3 Polynomials and Special products

Math 140A Elementary Analysis Homework Questions 1

62. Power series Definition 16. (Power series) Given a sequence {c n }, the series. c n x n = c 0 + c 1 x + c 2 x 2 + c 3 x 3 +

11. FINITE FIELDS. Example 1: The following tables define addition and multiplication for a field of order 4.

If a subset E of R contains no open interval, is it of zero measure? For instance, is the set of irrationals in [0, 1] is of measure zero?

n m CHAPTER 3 RATIONAL EXPONENTS AND RADICAL FUNCTIONS 3-1 Evaluate n th Roots and Use Rational Exponents Real nth Roots of a n th Root of a

University of Manitoba, Mathletics 2009

WORKING WITH NUMBERS

Properties and Tests of Zeros of Polynomial Functions

Exponents. Learning Objectives. Pre-Activity

September 2012 C1 Note. C1 Notes (Edexcel) Copyright - For AS, A2 notes and IGCSE / GCSE worksheets 1

2.4 - Sequences and Series

Math 299 Supplement: Real Analysis Nov 2013

We are mainly going to be concerned with power series in x, such as. (x)} converges - that is, lims N n

Ch3. Asymptotic Notation

APPENDIX F Complex Numbers

Essential Question How can you use properties of exponents to simplify products and quotients of radicals?

Topic 1 2: Sequences and Series. A sequence is an ordered list of numbers, e.g. 1, 2, 4, 8, 16, or

1 Approximating Integrals using Taylor Polynomials

Mini Lecture 10.1 Radical Expressions and Functions. 81x d. x 4x 4

Bertrand s Postulate

C. Complex Numbers. x 6x + 2 = 0. This equation was known to have three real roots, given by simple combinations of the expressions

1. By using truth tables prove that, for all statements P and Q, the statement

Advanced Course of Algorithm Design and Analysis

Lecture 10: Mathematical Preliminaries

NICK DUFRESNE. 1 1 p(x). To determine some formulas for the generating function of the Schröder numbers, r(x) = a(x) =

7 Sequences of real numbers

Proof of Goldbach s Conjecture. Reza Javaherdashti

Ma 530 Introduction to Power Series

MEI Casio Tasks for Further Pure

Once we have a sequence of numbers, the next thing to do is to sum them up. Given a sequence (a n ) n=1

Complex Numbers Primer

Complex Numbers Primer

The natural exponential function

Addition: Property Name Property Description Examples. a+b = b+a. a+(b+c) = (a+b)+c

TEACHER CERTIFICATION STUDY GUIDE

Appendix F: Complex Numbers

18.440, March 9, Stirling s formula

3 Gauss map and continued fractions

Section 1 of Unit 03 (Pure Mathematics 3) Algebra

CHAPTER I: Vector Spaces

Sequences. Notation. Convergence of a Sequence

Math 155 (Lecture 3)

Math 257: Finite difference methods

Proofs. Indirect Proofs

SEQUENCES AND SERIES

Algebra II Notes Unit Seven: Powers, Roots, and Radicals

[ 11 ] z of degree 2 as both degree 2 each. The degree of a polynomial in n variables is the maximum of the degrees of its terms.

3. Z Transform. Recall that the Fourier transform (FT) of a DT signal xn [ ] is ( ) [ ] = In order for the FT to exist in the finite magnitude sense,

PUTNAM TRAINING INEQUALITIES

Complex Numbers Solutions

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs

MATH 112: HOMEWORK 6 SOLUTIONS. Problem 1: Rudin, Chapter 3, Problem s k < s k < 2 + s k+1

The Boolean Ring of Intervals

(A sequence also can be thought of as the list of function values attained for a function f :ℵ X, where f (n) = x n for n 1.) x 1 x N +k x N +4 x 3

, then cv V. Differential Equations Elements of Lineaer Algebra Name: Consider the differential equation. and y2 cos( kx)

2 Geometric interpretation of complex numbers

Revision Topic 1: Number and algebra

Infinite Sequences and Series

MIXED REVIEW of Problem Solving

4.3 Growth Rates of Solutions to Recurrences

The log-behavior of n p(n) and n p(n)/n

Math 4400/6400 Homework #7 solutions

A FIBONACCI MATRIX AND THE PERMANENT FUNCTION

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018

Lyman Memorial High School. Honors Pre-Calculus Prerequisite Packet. Name:

Math 220A Fall 2007 Homework #2. Will Garner A

Wrap of Number Theory & Midterm Review. Recall: Fundamental Theorem of Arithmetic

The picture in figure 1.1 helps us to see that the area represents the distance traveled. Figure 1: Area represents distance travelled

Complex Numbers. Brief Notes. z = a + bi

Math 61CM - Solutions to homework 3

6.046 Recitation 5: Binary Search Trees Bill Thies, Fall 2004 Outline

Chapter 6 Infinite Series

MA131 - Analysis 1. Workbook 9 Series III

Joe Holbrook Memorial Math Competition

(b) What is the probability that a particle reaches the upper boundary n before the lower boundary m?

Exercises 1 Sets and functions

Polynomial Functions and Their Graphs

NAME: ALGEBRA 350 BLOCK 7. Simplifying Radicals Packet PART 1: ROOTS

Problem 4: Evaluate ( k ) by negating (actually un-negating) its upper index. Binomial coefficient

a 3, a 4, ... are the terms of the sequence. The number a n is the nth term of the sequence, and the entire sequence is denoted by a n

Optimally Sparse SVMs

Subject: Differential Equations & Mathematical Modeling-III

14.1 Understanding Rational Exponents and Radicals

Sail into Summer with Math!

INTEGRATION BY PARTS (TABLE METHOD)

12.1 Sequences. Write the First Several Terms of a Sequence. PREPARING FOR THIS SECTION Before g etting started, review the following concept: ( )

Assignment 5: Solutions

Real Variables II Homework Set #5

( ) 2 + k The vertex is ( h, k) ( )( x q) The x-intercepts are x = p and x = q.

In number theory we will generally be working with integers, though occasionally fractions and irrationals will come into play.

Test One (Answer Key)

Principle Of Superposition

page Suppose that S 0, 1 1, 2.

Transcription:

1 Number Coversio Rolad Backhouse March 5, 2001

Outlie 2 We discuss the mathematical properties of covertig real umbers to itegers. I particular, we show how to implemet roudig up (of ratioal umbers) i terms of roudig dow. This provides a mechaism for implemetig roudig up i Java (which defies iteger divisio as roudig towards zero). The discussio illustrates the use of equivaleces i defiig importat mathematical otios.

Castig 3 Castig is the ame give i laguages like C ad Java for the operatio of covertig a value of oe type to aother. The cast from real umbers to itegers occurs whe evaluatig a iteger divisio. The text 1/2 (for example) meas a iteger divisio ad evaluates to zero. So, if the real value is iteded, oe has to write, say, 1.0/2.0. Addig decimal poits does t help, however, whe the values beig divided are expressios. So if, for example, m ad have bee declared to be itegers the we have to write somethig like (real)m/(real) to force the compiler to compute the real value of m/.

The Floor Fuctio 4 Defiitio: For all real x, x is a iteger such that, for all itegers, x x.

The Floor Fuctio 5 Defiitio: For all real x, x is a iteger such that, for all itegers, x x. O the right side of the equivalece, the at-most relatio ( ) is betwee reals whereas o the left side it is betwee itegers. Makig all coversios explicit, temporarily adoptig a Java-like otatio, is illumiatig. Doig so the defiitio becomes that, for all real x, (floor)x is a iteger such that for all itegers, (floor)x (real) x. So the floor of x is defied by coectig it to the coversio from itegers to reals i a simple equivalece.

Properties of Floor 6 Defiitio: For all real x, x is a iteger such that, for all itegers, x x. NB. x ca be istatiated to a iteger, but caot be istatiated to a real.

Properties of Floor 7 Defiitio: For all real x, x is a iteger such that, for all itegers, x x. NB. x ca be istatiated to a iteger, but caot be istatiated to a real. 1. x is by defiitio a iteger. So we ca istatiate to x. We get x x x x. Simplifyig, x x.

Properties of Floor 8 Defiitio: For all real x, x is a iteger such that, for all itegers, x x. NB. x ca be istatiated to a iteger, but caot be istatiated to a real. 1. x is by defiitio a iteger. So we ca istatiate to x. We get x x x x. Simplifyig, x x. 2. Istatiate x to.we get. Simplifyig,.

Properties of Floor 9 Defiitio: For all real x, x is a iteger such that, for all itegers, x x. NB. x ca be istatiated to a iteger, but caot be istatiated to a real. 1. x is by defiitio a iteger. So we ca istatiate to x. We get x x x x. Simplifyig, x x. 2. Istatiate x to.we get. Simplifyig,.

3. Istatiate x i 1. to. We get 10. 4. Combiig 2. ad 3., for all itegers =.

Properties of Floor Summary 11 For all reals x, For all itegers, x x. =.

Properties of Floor (Cotiued) 12 Recall the rule of cotrapositio: p q p q. The cotrapositive of the defiitio of the floor fuctio is, for all itegers ad real x, But ( m) m <. So ( x ) ( x). x < x <.

Properties of Floor (Cotiued) 13 Recall the rule of cotrapositio: p q p q. The cotrapositive of the defiitio of the floor fuctio is, for all itegers ad real x, But ( m) m <. So ( x ) ( x). x < x <. Istatiatig with x +1 ad simplifyig we deduce: x < x +1. Recallig that x x, we have established x x < x +1.

Idirect Equality 14 More complex properties use the rule of idirect equality: x = y z : z x z y. Example: x +m = { arithmetic } m x = { defiitio of floor } m x = { arithmetic } x+m = { defiitio of floor } Hece, x+m. x +m = x+m.

Roudig Off 15 Ceilig Fuctio Defiitio: For all real x, x is a iteger such that, for all itegers, x x. Exercise: derive properties of the ceilig fuctio dual to the properties of the floor fuctio.

The Problem 16 Roudig dow a iteger divisio of positive umbers m ad is expressed by m where m is the real divisio of m ad. Dually, roudig up is expressed by. Implemetig roudig up give a implemetatio of roudig dow amouts to fidig suitable values p ad q so that p =. q The values p ad q should be expressed as arithmetic fuctios of m ad (that is, fuctios ivolvig additio ad multiplicatio, but ot ivolvig the floor or ceilig fuctios).

The Strategy 17 We ca derive suitable expressios for p ad q usig the rule of idirect equality. For arbitrary iteger k, we aim to elimiate the ceilig fuctio from the iequality k obtaiig a iequality of the form k e where e is a arithmetic expressio i m ad. We may the coclude that e =.

The Solutio k 18

The Solutio k 19 = { iteger arithmetic } k 1 < = { cotrapositive of defiitio of ceilig } k 1 < m

The Solutio k 20 = { iteger arithmetic } k 1 < = { cotrapositive of defiitio of ceilig } k 1 < m = { arithmetic, > 0 } (k 1) < m = { iteger iequalities } (k 1) + 1 m = { arithmetic, > 0 } k m+ 1

The Solutio k 21 = { iteger arithmetic } k 1 < = { cotrapositive of defiitio of ceilig } k 1 < m = { arithmetic, > 0 } (k 1) < m = { iteger iequalities } (k 1) + 1 m = { arithmetic, > 0 } k m+ 1 = { defiitio of floor fuctio } m+ 1 k.

We have derived: k k m+ 1 Here k is arbitrary. So, by idirect equality, we get m+ 1 =. I Java, therefore, if it is required to roud up the result of dividig m by oe should compute (m+-1)/.. 22