Algorithm and Architecture for On-Line Decimal Powering Computation

Total Page:16

File Type:pdf, Size:1020Kb

Algorithm and Architecture for On-Line Decimal Powering Computation Algorithm and Architecture for on-line Decimal Powering Computation Mahmoud Y. Hassan∗, Tarek ElDeeb∗ and Hossam A. H. Fahmyy ∗SilMinds, Maadi, 11431, Helwan, Egypt Email: [email protected] yElectronics and Communications Department, Cairo university, Egypt Email: [email protected] Abstract—An architecture for the computation of a decimal scheme between subsequent operations. The final result is powering function is presented in this paper. The algorithm con- faithfully rounded, that is the result is one of the immediate sists of a sequence of overlapped operations: 1) digit recurrence floating point neighbors to the exact result. To the best of logarithm, 2) sequential multiplication, and 3) on-line antiloga- rithm. A correction scheme is introduced between the overlapped the authors knowledge, this is the first work to implement a operations to guarantee correct on-line calculations. Execution decimal floating point powering function on hardware. times are estimated for decimal64 and decimal128 formats of the The paper is organized as follows: section II introduces the IEEE 754-2008 standard for floating point arithmetic. decimal powering. Section III shortly presents the testing and implementation results while section IV gives the conclusions. I. INTRODUCTION II. ALGORITHM Interest in decimal arithmetic increased considerably in The algorithm is based on the mathematical identity: recent years. There are many commercial demands for Dec- imal Floating Point (DFP) arithmetic operations such as tax XY = 10Y log10X for X > 0 (1) calculations, currency conversion and phone billing. Power- For X < 0, invalid operation is signaled out for finite non- ing (XY ) is an important function in financial applications integer Y . A negative final result is obtained for X < 0 and such as interest rate calculations. Decimal Powering function an odd integer Y . For X < 0 and an even integer Y , the final pow(x,y)= xy where x 2 [−∞; +1] and y 2 [−∞; +1] result is positive. Both inputs X and Y are decimal floating is defined in the new IEEE 754-2008 standard [1] and is point operands and their absolute values are denoted M^ 10Ex implemented in this work. The standard also defines other x and M^ 10Ey respectively. Hence, functions such as: compound(x,n)= (1 + x)n, pown(x,n)= xn y y ^ Ey ^ Ex where n is an integer, powr(x,y)= x (derived by considering XY = 10My 10 log10(Mx10 ) (2) only exp(y × log(x)) where x 2 [0; +1] and y 2 [−∞; +1]. ^ Ey ^ = 10My 10 (log10(Mx)+Ex) Most elementary functions are implemented using software ^ ^ libraries due to the advantage of using large look up tables And when both Mx and My are normalized, then and providing more accurate results. However, software algo- Ey +L XY = 10My 10 (log10(Mx)+Ex+K) (3) rithms are not suitable for numerical intensive and real time applications due to their slow operation, 100 to 1000 slower Where L is the leading zero count of M^ y and K is the integer than what can be implemented in hardware [2]. Therefore, part of the logarithm’s result when normalizing M^ x and can new algorithms and hardware implementations for elemen- be calculated by subtracting leading zero count of M^ x from its tary decimal floating point arithmetic functions have been precision. Thus, to calculate the final result, three composite introduced recently [3] [4] [5]. The accurate computation of operations have to be performed consecutively, logarithm, the floating point powering function is difficult and requires multiplication and antilogarithm. Moreover, in order to reduce wider calculating precisions as explained by the Table Maker’s the latency of the powering function, the sub operations have Dilemma [6]. A composite iterative algorithm for the compu- to be computed on-line [7]. That is, every stage starts its tation of binary powering function is introduced in [7]. In this operation based on a calculated digit in the previous stage. paper, we give a detailed description of an iterative algorithm Special data NaN, Inf and 0 are handled according to the IEEE for the computation of the decimal powering function (XY ). standard’s specifications for floating point arithmetic [1]. Three overlapped operations: logarithm, multiplication and A. Logarithm (log ) antilogarithm are done iteratively combined with a correction 10 Logarithm is computed iteratively using the digit recurrence The project ”Promoting Egypt as the first decimal Arithmetic Intellectual algorithm with selection by rounding. Pineiro et al. [8] in- property cores provider for financial applications in the world” (grant number troduced an algorithm for the computation of logarithms for C2/S1/163) is funded by the RDI Programme through the EU-Egypt Innova- tion Fund (EEIF). The RDI Programme is a programme of the Ministry of binary floating point numbers. Chen et al. [3] adapted the same Higher Education and Scientific Research funded by the European Union. algorithm to decimal floating point numbers. TABLE I LOOK UP TABLE FOR e1 SELECTION 2) Error analysis: a) Inherent Error of Algorithm: This error results from Ranges of m e1 [0:96; 1:00) 0 the difference between the logarithm result obtained from finite [0:88; 0:95] 1 iterations and the exact result obtained from infinite iterations. [0:81; 0:87] 2 Since the decimal logarithmic result is achieved after nth [0:76; 0:80] 3 [0:70; 0:75] 4 iteration, "i can be defined as: [0:66; 0:69] 5 1 X [0:62; 0:65] 6 " = − log (1 + e 10−j) (11) [0:59; 0:61] 7 i 10 j [0:56; 0:58] 8 j=n [0:50; 0:55] 9 Since ej represents the error between two successive iterations and ej 2 [−9; 9] ,we choose the worst cases (ej = 9 or − 9) to analyze maximum "i 1) Algorithm: A logarithmic result log10(x) can be 1 X −j achieved according to [3] based on the mathematical identity: "i = − log10(1 ± 9 × 10 ) (12) Y X j=n log10(m) = log10(m fj) − log10(fj) (4) According to (12), maximum "i is in the range: 1 So log (m) = − P log (f ) if the first term converges −n −n 10 j=1 10 j −4:34 × 10 ≤ "i ≤ 4:34 × 10 (13) −j to zero. fj is defined as fj = 1 + ej10 , this form allows −j ej 10 the use of a shift-and-add implementation. The corresponding b) Approximation Error: The approximate value ln(10) −j th recurrences for computing the logarithm are: is used to estimate log(1 + ej10 ) from the k to the th −j n iteration. According to the series expansion of logarithm E(j + 1) = E[j](1 + ej10 ) (5) function in (10), Since the value of log(1 + x) is approximatd L(j + 1) = L(j) − log (1 + e 10−j) (6) x th −j 10 j by ln(10) after the k iteration. Putting x = ej10 , this produces an approximation error, "a: Where, E[1] = m and L[1] = 0. The digits ej are selected so n (e 10−j )2 (e 10−j )3 that E(j + 1) converges to 1. To have a selection function for X − j + j − · · · " = 2 3 (14) ej, a scaled remainder is defined as , a ln(10) j=k W [j] = 10j(1 − E[j]) (7) Since n (e 10−j )3 X j − · · · Substituting (7) in (5) yields, 3 10−n (15) ln(10) −j+1 j=k W [j + 1] = ejW [j]10 + 10(W [j] − ej) (8) So higher order terms can be neglected with respect to And e digits are selected by rounding W [j + 1] to the −j 2 j+1 − (ej 10 ) , integer part in every iteration. 2ln(10) n −j 2 X (ej10 ) " ≈ − (16) ej+1 = round(W [j + 1]) (9) a 2ln(10) j=k The logarithmic result is achieved through sequential additions Considering the worst cases (e = 9 or − 9) we obtain the according to (6), where the values of log(1 + e 10−j) are j j maximum " : stored in a look up table. The series expansion of the logarithm a " ≤ 1:78 × 10−(2k−1) (17) function : a 2 (x − x + ::: ) c) Quantization Error: Since only those intermediate log (1 + x) = 2 (10) 10 ln(10) values who have finite precisions are operated in the hardware- oriented algorithm, three quantization errors occur. First, the is used to reduce the size of this look up table. After iteration −j logarithm results are achieved by accumulating the n-digits j = k the values of log10(1+ej10 ) can be approximated by −j st −j rounding values of −log (1 + e 10 ) from the 1 to the ej 10 10 j k th ln(10) . The selection of the value depends on achieving the k iteration. In each iteration, the maximum rounding error 2 −2j ej 10 −n −j −n of −log10(1 + ej10 ) is 0:5 × 10 therefore the maximum constraint 2ln(10) < 10 , where n is the required accurate precision to be calculated. According to [3], the value of e1 "q1 is: is obtained by look up table (I), where the input is in the k X −n range 0:5 ≤ m < 1 and the number in the range 0:1 ≤ "q1 ≤ 0:5 × 10 m < 0:5 needs to be adjusted. The adjustment can be done by j=1 multiplying the input with (2, 3 or 5) and adding a value of ≤ 0:5k × 10−n (log(2), log(3) or log(5)) to the logarithm result. ej+1 values Second, the logarithm results are achieved by accumulating are selected by rounding the scaled remainder for iterations −j −ej 10 th j ≥ 2. the n−digit rounded values of ln(10) from the k to the W [j] −ej 0 th ej e1 M n iteration.
Recommended publications
  • From Al-Khwarizmi to Algorithm (71-74)
    Olympiads in Informatics, 2017, Vol. 11, Special Issue, 71–74 71 © 2017 IOI, Vilnius University DOI: 10.15388/ioi.2017.special.11 From Al-Khwarizmi to Algorithm Bahman MEHRI Sharif University of Technology, Iran e-mail: [email protected] Mohammad ibn Musa al-Khwarizmi (780–850), Latinized as Algoritmi, was a Persian mathematician, astronomer, and geographer during the Abbasid Caliphate, a scholar in the House of Wisdom in Baghdad. In the 12th century, Latin translations of his work on the Indian numerals introduced the decimal number system to the Western world. Al-Khwarizmi’s The Compendious Book on Calculation by Completion and Balancing resented the first systematic solu- tion of linear and quadratic equations in Arabic. He is often considered one of the fathers of algebra. Some words reflect the importance of al-Khwarizmi’s contributions to mathematics. “Algebra” (Fig. 1) is derived from al-jabr, one of the two operations he used to solve quadratic equations. Algorism and algorithm stem from Algoritmi, the Latin form of his name. Fig. 1. A page from al-Khwarizmi “Algebra”. 72 B. Mehri Few details of al-Khwarizmi’s life are known with certainty. He was born in a Per- sian family and Ibn al-Nadim gives his birthplace as Khwarazm in Greater Khorasan. Ibn al-Nadim’s Kitāb al-Fihrist includes a short biography on al-Khwarizmi together with a list of the books he wrote. Al-Khwārizmī accomplished most of his work in the period between 813 and 833 at the House of Wisdom in Baghdad. Al-Khwarizmi contributions to mathematics, geography, astronomy, and cartogra- phy established the basis for innovation in algebra and trigonometry.
    [Show full text]
  • The "Greatest European Mathematician of the Middle Ages"
    Who was Fibonacci? The "greatest European mathematician of the middle ages", his full name was Leonardo of Pisa, or Leonardo Pisano in Italian since he was born in Pisa (Italy), the city with the famous Leaning Tower, about 1175 AD. Pisa was an important commercial town in its day and had links with many Mediterranean ports. Leonardo's father, Guglielmo Bonacci, was a kind of customs officer in the North African town of Bugia now called Bougie where wax candles were exported to France. They are still called "bougies" in French, but the town is a ruin today says D E Smith (see below). So Leonardo grew up with a North African education under the Moors and later travelled extensively around the Mediterranean coast. He would have met with many merchants and learned of their systems of doing arithmetic. He soon realised the many advantages of the "Hindu-Arabic" system over all the others. D E Smith points out that another famous Italian - St Francis of Assisi (a nearby Italian town) - was also alive at the same time as Fibonacci: St Francis was born about 1182 (after Fibonacci's around 1175) and died in 1226 (before Fibonacci's death commonly assumed to be around 1250). By the way, don't confuse Leonardo of Pisa with Leonardo da Vinci! Vinci was just a few miles from Pisa on the way to Florence, but Leonardo da Vinci was born in Vinci in 1452, about 200 years after the death of Leonardo of Pisa (Fibonacci). His names Fibonacci Leonardo of Pisa is now known as Fibonacci [pronounced fib-on-arch-ee] short for filius Bonacci.
    [Show full text]
  • The Fascinating Story Behind Our Mathematics
    The Fascinating Story Behind Our Mathematics Jimmie Lawson Louisiana State University Story of Mathematics – p. 1 Math was needed for everyday life: commercial transactions and accounting, government taxes and records, measurement, inheritance. Math was needed in developing branches of knowledge: astronomy, timekeeping, calendars, construction, surveying, navigation Math was interesting: In many ancient cultures (Egypt, Mesopotamia, India, China) mathematics became an independent subject, practiced by scribes and others. Introduction In every civilization that has developed writing we also find evidence for some level of mathematical knowledge. Story of Mathematics – p. 2 Math was needed in developing branches of knowledge: astronomy, timekeeping, calendars, construction, surveying, navigation Math was interesting: In many ancient cultures (Egypt, Mesopotamia, India, China) mathematics became an independent subject, practiced by scribes and others. Introduction In every civilization that has developed writing we also find evidence for some level of mathematical knowledge. Math was needed for everyday life: commercial transactions and accounting, government taxes and records, measurement, inheritance. Story of Mathematics – p. 2 Math was interesting: In many ancient cultures (Egypt, Mesopotamia, India, China) mathematics became an independent subject, practiced by scribes and others. Introduction In every civilization that has developed writing we also find evidence for some level of mathematical knowledge. Math was needed for everyday life: commercial transactions and accounting, government taxes and records, measurement, inheritance. Math was needed in developing branches of knowledge: astronomy, timekeeping, calendars, construction, surveying, navigation Story of Mathematics – p. 2 Introduction In every civilization that has developed writing we also find evidence for some level of mathematical knowledge. Math was needed for everyday life: commercial transactions and accounting, government taxes and records, measurement, inheritance.
    [Show full text]
  • A Combined Decimal and Binary Floating-Point Divider
    A Combined Decimal and Binary Floating-point Divider Sonia Gonz´alez-Navarro Alberto Nannarelli Michael Schulte Charles Tsen University of M´alaga Technical University of Denmark University of Wisconsin-Madison Nvidia Corporation [email protected] [email protected] [email protected] [email protected] Abstract—In this paper, we present the hardware design of proposed for multiplication [6]. Combined binary and BCD a combined decimal and binary floating-point divider, based units have been proposed for addition [7], multiplication [8], on specifications in the IEEE 754-2008 Standard for Floating- [9] and division [10]. point Arithmetic. In contrast to most recent decimal divider designs, which are based on the Binary Coded Decimal (BCD) The combined unit we propose operates on either 64-bit encoding, our divider operates on either 64-bit binary encoded BID-encoded DFP numbers or 64-bit BFP numbers and it is decimal floating-point (DFP) numbers or 64-bit binary floating- based on the radix-10 division unit presented in [11]. This unit point (BFP) numbers. The division approach implemented in is implemented using the digit-recurrence approach [12] and our design is based on a digit-recurrence algorithm. We describe it has been modified to also support 64-bit BFP numbers. The the hardware resources shared between the two floating-point datatypes and demonstrate that hardware sharing is advanta- BFP division is implemented with a retimed radix-16 (two geous. Compared to a standalone DFP divider, the combined overlapped radix-4 stages) digit-recurrence unit with selection divider has the same worst case delay and 17% more area.
    [Show full text]
  • The Project Gutenberg Ebook #31061: a History of Mathematics
    The Project Gutenberg EBook of A History of Mathematics, by Florian Cajori This eBook is for the use of anyone anywhere at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.org Title: A History of Mathematics Author: Florian Cajori Release Date: January 24, 2010 [EBook #31061] Language: English Character set encoding: ISO-8859-1 *** START OF THIS PROJECT GUTENBERG EBOOK A HISTORY OF MATHEMATICS *** Produced by Andrew D. Hwang, Peter Vachuska, Carl Hudkins and the Online Distributed Proofreading Team at http://www.pgdp.net transcriber's note Figures may have been moved with respect to the surrounding text. Minor typographical corrections and presentational changes have been made without comment. This PDF file is formatted for screen viewing, but may be easily formatted for printing. Please consult the preamble of the LATEX source file for instructions. A HISTORY OF MATHEMATICS A HISTORY OF MATHEMATICS BY FLORIAN CAJORI, Ph.D. Formerly Professor of Applied Mathematics in the Tulane University of Louisiana; now Professor of Physics in Colorado College \I am sure that no subject loses more than mathematics by any attempt to dissociate it from its history."|J. W. L. Glaisher New York THE MACMILLAN COMPANY LONDON: MACMILLAN & CO., Ltd. 1909 All rights reserved Copyright, 1893, By MACMILLAN AND CO. Set up and electrotyped January, 1894. Reprinted March, 1895; October, 1897; November, 1901; January, 1906; July, 1909. Norwood Pre&: J. S. Cushing & Co.|Berwick & Smith.
    [Show full text]
  • History of Expression
    History of Expression Ryan Stansifer Computer Sciences Florida Institute of Technology Melbourne, Florida USA 32901 http://www.cs.fit.edu/˜ryan/ August 21, 2019 History of Expression We focus on the history of expression in linear, written media or language. Some of the important intellectual milestones are: I Alphabet — page ?? I Algorithms and Number – page ?? I Notation and Logic — ?? Development of the Alphabet I token — a miniature of object, bullae I pictograph — picture of object I cuneiform — wedge-shaped stylus, tomb of Darius the Great I hieroglyphics — hieratic (sacred), demotic (simplified), Rosetta stone (1799) I ideograph — symbol for idea or object I logogram — symbol for word or phrase I syllabary — symbols for syllables of language Otl Aicher pictograms for the 1972 Munich Olympics. A pictogram, though simplified, depicts an object (or activity) in such as way that it can be identified without prior agreement, or common education. Rebus principle In linguistics, the rebus principle is the use of existing symbols, such as pictograms, purely for their sounds regardless of their meaning, to represent new words. Many ancient writing systems used the rebus principle to represent abstract words, which otherwise would be hard to be represented by pictograms. An example that illustrates the Rebus principle is the representation of the sentence ”I can see you” by using the pictographs of ”eye–can–sea–ewe.” Acrophonic principle [Greek akro- ‘tip’ + fwnia ‘voice’, ‘the initial sound’] In the history of writing this principle refers to the use of a written sign which originally took the form of a pictorial or logographic symbol of an object to represent the initial syllable or phoneme of the name of that object.
    [Show full text]
  • New Directions in Floating-Point Arithmetic
    New directions in floating-point arithmetic Nelson H. F. Beebe University of Utah Department of Mathematics, 110 LCB 155 S 1400 E RM 233 Salt Lake City, UT 84112-0090 USA Abstract. This article briefly describes the history of floating-point arithmetic, the development and features of IEEE standards for such arithmetic, desirable features of new implementations of floating-point hardware, and discusses work- in-progress aimed at making decimal floating-point arithmetic widely available across many architectures, operating systems, and programming languages. Keywords: binary arithmetic; decimal arithmetic; elementary functions; fixed-point arithmetic; floating-point arithmetic; interval arithmetic; mathcw library; range arithmetic; special functions; validated numerics PACS: 02.30.Gp Special functions DEDICATION This article is dedicated to N. Yngve Öhrn, my mentor, thesis co-advisor, and long-time friend, on the occasion of his retirement from academia. It is also dedicated to William Kahan, Michael Cowlishaw, and the late James Wilkinson, with much thanks for inspiration. WHAT IS FLOATING-POINT ARITHMETIC? Floating-point arithmetic is a technique for storing and operating on numbers in a computer where the base, range, and precision of the number system are usually fixed by the computer design. Conceptually, a floating-point number has a sign,anexponent,andasignificand (the older term mantissa is now deprecated), allowing a representation of the form .1/sign significand baseexponent.Thebase point in the significand may be at the left, or after the first digit, or at the right. The point and the base are implicit in the representation: neither is stored. The sign can be compactly represented by a single bit, and the exponent is most commonly a biased unsigned bitfield, although some historical architectures used a separate exponent sign and an unbiased exponent.
    [Show full text]
  • Aestimatio: Critical Reviews in the History of Science
    Numerals and Arithmetic in the Middle Ages by Charles Burnett Variorum Collected Studies Series 967. Farnham, UK/Burlington, VT: Ashgate, 2010. Pp. ISBN 978–1–4094–0368–5. Cloth $180.00 x + 370 Reviewed by Jens Høyrup Roskilde University [email protected] After Arabic into Latin in the Middle Ages:The Translators and Their Intellectual and Social Context and Magic and Divination in the Mid- dle Ages:Two Texts and Techniques in the Islamic and Christian Worlds, this third Variorum volume from Charles Burnett’s hand collects papers dealing with the period and process of adoption of the Hindu-Arabic numerals.The collection shows us the intricacies of this process, a process which was probably the ‘most momentous develop- ment in the history of pre-modern mathematics’ [IX.15]. Intricacies are certainly not unexpected in a process of this kind; but their pre- cise portrayal can only be painted by someone as familiar as Burnett with the original documents, their languages, their style and context. Burnett combines this technical expertise with a keen eye for the broader questions to which it can be applied (without which the answers provided by even the best technical expertise can appear naive). It must be said, however, that technical matters and details take up most of the space in the majority of the articles in the volume.The reader with paleographic proficiency will enjoy the many reproductions of manuscript pages. The volume contains 11 articles of varying length: (I) ‘The Abacus at Echternach in ca. 1000 A.D’. 14 pp. text, 4 pp. reproductions.
    [Show full text]
  • Computable Mathematics November 8, 2014
    MAA Meeting Computable Mathematics November 8, 2014 Valentina Harizanov Department of Mathematics, GWU [email protected] http://home.gwu.edu/~harizanv/ Al-Khwarizmi • Muhammad bin Musa al- Khwarizmi (early 9th century) from Khwarizm (Khiva) • Further developed the concept of a mechanical procedure • Systematic approach to soving linear and quadratic equations: “Hisab al-jabr w’al- muqabala” An algorism/algorithm • An algorism refers to the well-defined step-by-step rules performing arithmetic using Arabic numerals (positional notation). • By the 18th century evolves into an algorithm—any finite systematic well- defined procedure for solving many instances of a general problem. Charles Babbage (1791– 1871) Implementing algorithms • The idea of a programmable computer • Difference engine, 1822 (computing tables in math and astronomy) • Construction not completed Analytical engine • Babbage: analytical engine, 1833–1842 (arbitrary calculation) • Ada Byron, Lady Lovelace (1815– 1852), wrote several programs for the analytical engine • Construction not completed (programs never executed) Mathematical rigor missing • Lack of the mathematical rigor in the definition of an algorithm (finite process, effective procedure), even in the 20th century. • A. Church: “The notion of an effective process occurs frequently in connection with mathematical problems, where it is apparently taken to have a clear meaning, but this meaning is commonly taken for granted without explanation.” Mathematical Problems of David Hilbert (1862–1943) • Lecture at the International Congress of Mathematricians in Paris in 1900 • “What new methods and new facts in the wide and rich field of mathematical thought will the new century disclose?” Hilbert’s problem on Diophantine equations • Determination of solvability of a Diophantine equation • Diophantine equations are polynomials (involve only addition and multiplication) with integer coefficients.
    [Show full text]
  • Session II – Unit I – Fundamentals
    Tutor:- Prof. Avadhoot S. Joshi Subject:- Design & Analysis of Algorithms Session II Unit I - Fundamentals • Algorithm Design – II • Algorithm as a Technology • What kinds of problems are solved by algorithms? • Evolution of Algorithms • Timeline of Algorithms Algorithm Design – II Algorithm Design (Cntd.) Figure briefly shows a sequence of steps one typically goes through in designing and analyzing an algorithm. Figure: Algorithm design and analysis process. Algorithm Design (Cntd.) Understand the problem: Before designing an algorithm is to understand completely the problem given. Read the problem’s description carefully and ask questions if you have any doubts about the problem, do a few small examples by hand, think about special cases, and ask questions again if needed. There are a few types of problems that arise in computing applications quite often. If the problem in question is one of them, you might be able to use a known algorithm for solving it. If you have to choose among several available algorithms, it helps to understand how such an algorithm works and to know its strengths and weaknesses. But often you will not find a readily available algorithm and will have to design your own. An input to an algorithm specifies an instance of the problem the algorithm solves. It is very important to specify exactly the set of instances the algorithm needs to handle. Algorithm Design (Cntd.) Ascertaining the Capabilities of the Computational Device: After understanding the problem you need to ascertain the capabilities of the computational device the algorithm is intended for. The vast majority of algorithms in use today are still destined to be programmed for a computer closely resembling the von Neumann machine—a computer architecture outlined by the prominent Hungarian-American mathematician John von Neumann (1903–1957), in collaboration with A.
    [Show full text]
  • Algorithmics: Theory and Practice
    I [P www.JobsCare.info GILLES BRASSARD PAUL BRATLEY ALGORITHMICS www.JobsCare.info www.JobsCare.info ALGORITHMICS Theory and Practice Gilles Brassard and Paul Bratley Departement d'informatique et de recherche operationnelle Universitd de Montreal www.JobsCare.info PRENTICE HALL, Englewood Cliffs, New Jersey 07632 Library of Congress Cataloging-in-Publication Data Brassard, Gilles Algorithmics : theory and practice. 1. Recursion theory. 2. Algorithms. I. Bratley, Paul. II. Title. QA9.6.B73 1987 51 I'.3 88-2326 ISBN 0-13-023243-2 Editorial/production supervision: Editing, Design & Production, Inc. Cover design: Lundgren Graphics, Ltd. Manufacturing buyer: Cindy Grant © 1988 by Prentice-Hall, Inc. A division of Simon & Schuster Englewood Cliffs, New Jersey 07632 All rights reserved. No part of this book may be reproduced, in any form or by any means, without permission in writing from the publisher. Printed in the United States of America 10 9 8 7 6 5 4 3 2 1 ISBN 0-13-023243-2 PRENTICE-HALL INTERNATIONAL (UK) LIMITED. London PRENTICE-HALL OF AUSTRALIA PTY. LIMITED, Sydney PRENTICE-HALL CANADA INC., Toronto PRENTICE-HALLwww.JobsCare.info HISPANOAMERICANA, S.A., Mexico PRENTICE-HALL OF INDIA PRIVATE LIMITED, New Delhi PRENTICE-HALL OF JAPAN, INC., Tokyo SIMON & SCHUSTER ASIA PTE. LTD., Singapore EDITORA PRENTICE-HALL DO BRASIL, LTDA., Rio de Janeiro for Isabelle and Pat www.JobsCare.info www.JobsCare.info Contents Preface Xiii 1 Preliminaries 1 1.1. What Is an Algorithm? 1 1.2. Problems and Instances 4 1.3. The Efficiency of Algorithms 5 1.4. Average and Worst-Case Analysis 7 1.5.
    [Show full text]
  • The History of Mathematics: Alternative Perspectives
    Copyrighted Material Chapter One The History of Mathematics: Alternative Perspectives A Justification for This Book An interest in history marks us for life. How we see ourselves and others is shaped by the history we absorb, not only in the classroom but also from the Internet, films, newspapers, television programs, novels, and even strip cartoons. From the time we first become aware of the past, it can fire our imagination and excite our curiosity: we ask questions and then seek an- swers from history. As our knowledge develops, differences in historical perspectives emerge. And, to the extent that different views of the past affect our perception of ourselves and of the outside world, history becomes an important point of reference in understanding the clash of cultures and of ideas. Not surprisingly, rulers throughout history have recognized that to control the past is to master the present and thereby consolidate their power. During the last four hundred years, Europe and its cultural dependen- cies1 have played a dominant role in world affairs. This is all too often reflected in the character of some of the historical writing produced by Eu- ropeans in the past. Where other people appear, they do so in a transitory fashion whenever Europe has chanced in their direction. Thus the history of the Africans or the indigenous peoples of the Americas often appears to begin only after their encounter with Europe. An important aspect of this Eurocentric approach to history is the man- ner in which the history and potentialities of non-European societies were represented, particularly with respect to their creation and development of science and technology.
    [Show full text]