Fundamentals of the Average Case Analysis of Particular Algorithms



Similar documents
Mathematical Modeling and Methods of Option Pricing

International Marketing Research

The Practice Nurse. Theory and practice. Pauline] effree SPRINGER-SCIENCE+BUSINESS MEDIA. B.V.

Strategic Asset Allocation in Fixed-Income Markets

Switching and Finite Automata Theory

How To Create A Virtual World From A Computer World

LOOKING FOR A GOOD TIME TO BET

Frank Peter Helmus. Process Plant Design. Project Management from Inquiry to Acceptance. Translated by Christine Ahner

Gendering the International Asylum and Refugee Debate

How To Understand The Differences Between The 2005 And 2011 Editions Of Itil 20000

Workers' Compensation Insurance Pricing. Current Programs and Proposed Reforms

Mathematics for Algorithm and System Analysis

STATISTICAL APPLICATIONS for. HEALTH INFORMATION MANAGEMENT Second Edition

Applying Comparative Effectiveness Data to Medical Decision Making

INTELLIGENT SYSTEMS, CONTROL, AND AUTOMATION: SCIENCE AND ENGINEERING

Marketing in Context

D-optimal plans in observational studies

INVENTORY MANAGEMENT: Principles, Concepts and Techniques

Computing Concepts with Java Essentials

Introduction. Appendix D Mathematical Induction D1

AN INTRODUCTION TO OPTIONS TRADING. Frans de Weert

PROCEEDINGS OF SYMPOSIA IN APPLIED MATHEMATICS Volume XXIII MODERN STATISTICS: METHODS AND APPLICATIONS

Introduction to the ISO/IEC Series

Property Investment Appraisal UNCORRECTED PROOF

superseries FIFTH EDITION

This page intentionally left blank

Guide to Assessment Scales in Parkinson s Disease

Understanding the New ISO Management System Requirements

Energy-Efficient Electric Motors and Their Applications. Second Edition

Statistics for Biology and Health

STEWARDSHIP ETHICS IN DEBT MANAGEMENT

TEUBNER-TEXTE zur Mathematik Band 137. V. I. Burenkov. Sobolev Spaces on Domains

THE DYING FIBONACCI TREE. 1. Introduction. Consider a tree with two types of nodes, say A and B, and the following properties:

CSI 333 Lecture 1 Number Systems

ML for the Working Programmer

Computer Security Within Organizations

CATHOLIC SCHOOLS PRIVATE AND SOCIAL EFFECTS

Baillière s Study Skills for Nurses and Midwives

Robust Geometric Programming is co-np hard

Introduction to Algorithms March 10, 2004 Massachusetts Institute of Technology Professors Erik Demaine and Shafi Goldwasser Quiz 1.

Lecture Notes in Mathematics

SpringerBriefs in Criminology

A Note for Students: How to Use This Book

Enumerating possible Sudoku grids

Paul M. Diffenderfer Samir El-Assal. Microsoft Dynamics NAV

Ukulele In A Day. by Alistair Wood FOR. A John Wiley and Sons, Ltd, Publication

Lasers in Restorative Dentistry

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition

Master of Arts in Mathematics

Guidance Note on Recognition of Certification Authorities and Certificates under the Electronic Transactions Ordinance (Cap. 553)

This page has been left blank intentionally

Analysis of Financial Time Series

The four [10,5,4] binary codes

Thorsten Bonato. Contraction-based Separation and Lifting for Solving the Max-Cut Problem

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

Bariatric Surgery. Obesity. Care and. Obesity Care and Bariatric Surgery Downloaded from

Scott (social)-3317-prelims.qxd 10/19/2005 5:27 PM Page i. Social Theory: Central Issues in Sociology

Automated Firewall Analytics

The History of Human Resource Development

Neuromuscular Rehabilitation in Manual and Physical Therapies

Object-Oriented Modeling and Design

Kolmogorov Complexity and the Incompressibility Method

Java and the Java Virtual Machine

Lecture 7: NP-Complete Problems

AN INTRODUCTION TO NUMERICAL METHODS AND ANALYSIS

Springer-Verlag Berlin Heidelberg GmbH

eifl-ip Handbook on Copyright and Related Issues for Libraries LEGAL DEPOSIT

Integrated Reservoir Asset Management

Global Trade Law. von Ulrich Magnus. 1. Auflage. Global Trade Law Magnus schnell und portofrei erhältlich bei beck-shop.de DIE FACHBUCHHANDLUNG

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Discuss the size of the instance for the minimum spanning tree problem.

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Analysis of Algorithms I: Optimal Binary Search Trees

Universität des Saarlandes. Fachrichtung 6.1 Mathematik

Life Insurance Theory

4.2 Euclid s Classification of Pythagorean Triples

MATHEMATICAL LOGIC FOR COMPUTER SCIENCE

The Clinical Nurse Specialist: Issues in Practice

Capability maturity model for maintenance management

Lecture 18: Applications of Dynamic Programming Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

OCAML FROM THE VERY BEGINNING

Prof. Karl H Hofmann Analysis I for MCS Mathematics with Computer Science Memo 0

CSC148 Lecture 8. Algorithm Analysis Binary Search Sorting

This is a sample chapter from A Manager's Guide to Service Management. To read more and buy, visit BSI British

Computer science information resource guide

Kuali OLE Activities in Germany

Digital Memory and Storage

Guideline for Writing Bachelor thesis

ON DEGREES IN THE HASSE DIAGRAM OF THE STRONG BRUHAT ORDER

Supplement to Call Centers with Delay Information: Models and Insights

Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

MATH BOOK OF PROBLEMS SERIES. New from Pearson Custom Publishing!

Welcome to the course Algorithm Design

International Cash Pooling

Young Shakespeare s Young Hamlet

Binary Search Trees CMPSC 122

The Translation Service Provider s Guide to BS EN 15038

Transcription:

Fundamentals of the Average Case Analysis of Particular Algorithms

Wiley-Teubner Series in Computer Science Editorial Board Günter Hotz Universität des Saarlandes. Fachbereich Angewandte Mathematik und Informatik. Saarbrücken. Germanv Michael J. Fischer Department of Computer Science. New Haven, Connecticut. USA Maurice Nivat U.E.R. de Mathematique et lnformatique. Universite Paris VII. Paris. France David W. Barron Department of Computer Science. Universitv of Southampton. UK Kemp: Fundamentals of the Average Case Analysis of Particular Algorithms Loeckx/Sieber/Stansifer: The Foundations of Program Verification

Fundamentals of the Average Case Analysis of Particular Algorithms Rainer Kemp Fachbereich Informatik Universität Frankfurt Germany Springer Fachmedien Wiesbaden GmbH

Copyright 1984 by Springer Fachmedien Wiesbaden Originally published by B.G. Teubner, Stuttgart in 1984 Ali rights reserved. No part of this book may be reproduced by any means, nor transmitted, nor translated into a machine language without the written permission of the publisher. Library of Congress Cataloging in Publication Data: Kemp, Rainer. Fundamentals of the average case analysis of particular algorithms. (Wiley-Teubner series in computer science) lncludes bibliographical references and index. 1. Electronic digital computers-programming. 2. Algorithms. 1. Title. 11. Series. QA76.6.K53 1984 519.4 83-16663 ISBN 978-3-519-02100-1 ISBN 978-3-663-12191-6 (ebook) DOI 10.1007/978-3-663-12191-6 British Library Cataloguing in Publication Data: Kemp, Rainer. Fundamentals of the average case analysis of particular algorithms.-(wiley-teubner series in computer science) 1. Algorithms. 1. Title. 511 '.6 QA9.58 ISBN 978-3-519-02100-1 CIP-Kurztitelaufnahme der Deutschen Bibliothek: Kemp, Rainer. Fundamentals of the average case analysis of particular algorithms/ Rai ner Kemp. (Wiley-Teubner series in computer science) ISBN 978-3-519-02100-1 Typeset by Mid-County Press, London, SW15.

Preface This book provides an introduction to the analysis of particular algorithms. lt has its origin in lecture courses given at the Universität des Saarlandes, Saarbrücken in 1980 and atthejohann Wolfgang Goethe-Universität, Frankfurt a.m. in 1982. The material can be covered in a one-semester course. ln preparing the notes for publication as a book, I have added a considerable amount of material additional to the lecture notes, with the intention of making the book more useful. My prime consideration has been to produce a textbook whose scope is selective; some of the omitted material is outlined in various exercises and should be useful in indicating possible approaches to certain problems. Moreover, problems are provided to furnish examples, to expand on the material or to indicate related results, and occasionally to guide the reader through the steps of lengthy proofs and derivations. I have referred, in various places, to those books and original papers which have been of particular assistance to me. I wish to take this opportunity to thank all those who have had apart in this work, and who have made this book possible. I am particularly indebted to Professor Dr. Günter Hotz for his encouragement in the writing of this textbook. Special thanks are due to Ute Schürfeld for careful reading of the text. Dr. P. Spuhler from Teubner Verlag provided co-operative and competent support in all editorial problems. Finally, I wish to thank Teubner-Verlag and John Wiley & Sons for very good and timely editorial work. Frankfurt a.m., West Germany December 1982 R. Kemp V

Contents Preface 1. lntroduction Exercises 2. A Simple Class of Algorithms 2.1 Definitior1 ot a Random Algorithm 2.2 Analysis of Random Algorithms Exercises 3. Permutationsand Their Applications 3.1 Motivation 3.2 Average Values of Characteristic Quantities of Permutations 3.2.1 AverageNumber of Cycles of a Permutation 3.2.2 Average Length of a Cycle 3.2.3 A General Approach 3.2.4 Average Number of Falls and Rises of a Permutation 3.2.5 Average Length of a Run 3.2.6 Average Length of the k-th Run 3.2.7 Average Number of Inversions of a Permutation Exercises 4. Random Walks, Trees, Lists 4.1 Random Walks 4.2 Enumeration of Random Walks 4.2.1 Uniform Random Walks 4.2.2 (d, e. u) -Random Walks 4.2.3 Non-negative Closed Random Walks 4.3 One-to-one Correspondences 4.3.1 Random Walks-Ordered Trees 4.3.2 Random Walks-Dynamic Data Structures V 1 10 12 12 15 19 21 21 26 28 29 30 34 37 41 42 45 50 50 52 52 60 72 81 81 84 vii

viii 4.4 Exact and Asymptotical Enumeration Results 92 4.4.1 Useful Techniques for Determining Asymptotics From Generating Functions 92 4.4.2 Ordered Trees 101 4.4.3 Derivation Trees of Context-free Grammars 111 4.4.4 Dynamic Data Structures 114 Exercises 121 5. Applications 130 5.1 Reduction of Binary Trees 130 5.1.1 The Reduction of Binary Trees by a Stack 132 5.1.2 The Reduction of Binary Trees by an Optimal Algorithm 150 5.1.3 The Reduction of Binary Trees by an lnput-restricted Deque 158 5.2 Two Algorithms for the Recognition of Dycklanguages 173 5.2.1 The Recognition by a Stack 174 5.2.2 The Recognition by a Two-Way-One-Counter Automaten 176 5.3 Batcher's Algorithm 183 5.3.1 Networks for Sorting 183 5.3.2 The Number of Exchanges in the Warst Case 188 5.3.3 The Number of Exchanges in the Average Case 190 Exercises 201 APPENDIX A 204 1. Basic Definitions of Probability Theory 204 2. Grammars-Formal Power Series 205 3. Generating Functions 206 4. Linear Recurrences 207 5. Dirichlet Series 207 6. Laurent Series-Residues-Cauchy Integral Formula 207 7. Euler's Summation Formula 208 APPENDIX B 209 1. Numbers in Combinatorial Analysis 209 2. Special Functions 214 References 221 Index of Notation 227