BN.com Gift Guide

Art of Computer Programming, Volume 4, Fascicle 2: Generating All Tuples and Permutations

Hardcover (Print)
Buy Used
Buy Used from BN.com
$13.49
Used and New from Other Sellers
Used and New from Other Sellers
from $4.25
Usually ships in 1-2 business days
(Save 78%)
Other sellers (Hardcover)
  • All (15) from $4.25   
  • New (7) from $9.16   
  • Used (8) from $4.25   

Overview

Finally, after a wait of more than thirty-five years, the first part of Volume 4 is at last ready for publication. Check out the boxed set that brings together Volumes 1 - 4A in one elegant case, and offers the purchaser a $50 discount off the price of buying the four volumes individually.

The Art of Computer Programming, Volumes 1-4A Boxed Set, 3/e

ISBN: 0321751043

Art of Computer Programming, Volume 4, Fascicle 2, The: Generating All Tuples and Permutations: Generating All Tuples and Permutations

This multivolume work on the analysis of algorithms has long been recognized as the definitive description of classical computer science. The three complete volumes published to date already comprise a unique and invaluable resource in programming theory and practice. Countless readers have spoken about the profound personal influence of Knuth's writings. Scientists have marveled at the beauty and elegance of his analysis, while practicing programmers have successfully applied his "cookbook" solutions to their day-to-day problems. All have admired Knuth for the breadth, clarity, accuracy, and good humor found in his books.

To begin the fourth and later volumes of the set, and to update parts of the existing three, Knuth has created a series of small books called fascicles, which will be published t regular intervals. Each fascicle will encompass a section or more of wholly new or evised material. Ultimately, the content of these fascicles will be rolled up into the comprehensive, final versions of each volume, and the enormous undertaking that began in 1962 will be complete.

Volume 4, Fascicle 2

This fascicle inaugurates the eagerly awaited publication of Knuth's The Art of Computer Programming, Volume 4: Combinatorial Algorithms. Part of what will be a long chapter on combinatorial searching, the fascicle begins his treatment of how to generate all possibilities. Specifically, it discusses the generation of all n-tuples, then extends those ideas to all permutations. Such algorithms provide a natural motivation by means of which many of the key ideas of combinatorial mathematics can be introduced and explored. In this and other fascicles of Volume 4, Knuth illuminates important theories by discussing related games and puzzles. Even serious programming can be fun.

Read More Show Less

Product Details

  • ISBN-13: 9780201853933
  • Publisher: Addison-Wesley
  • Publication date: 2/15/2005
  • Edition description: New Edition
  • Pages: 144
  • Product dimensions: 6.40 (w) x 9.50 (h) x 0.36 (d)

Meet the Author

Donald E. Knuth is known throughout the world for his pioneering work on algorithms and programming techniques, for his invention of the Tex and Metafont systems for computer typesetting, and for his prolific and influential writing. Professor Emeritus of The Art of Computer Programming at Stanford University, he currently devotes full time to the completion of these fascicles and the seven volumes to which they belong.

Read More Show Less

Read an Excerpt

I am grateful to all my friends, and record here and now my most especial appreciation to those friends who, after a decent interval, stopped asking me, "How's the book coming?"

—Peter J. Gomes, The Good Book (1996)

This booklet is Fascicle 2 of The Art of Computer Programming, Volume 4: Combinatorial Algorithms. As explained in the preface to Fascicle 1 of Volume 1, I'm circulating the material in this preliminary form because I know that the task of completing Volume 4 will take many years; I can't wait for people to begin reading what I've written so far and to provide valuable feedback.

There will also be a Fascicle 1 for Volume 4. But I've written Fascicle 2 first. Experienced programmers will understand that the initialization of a program usually can't be written properly until after the main body has been fleshed out.

To put the material in context, this fascicle contains Sections 7.2.1.1 and 7.2.1.2 of a long, long chapter on combinatorial searching. Chapter 7 will eventually fill three volumes (namely Volumes 4A, 4B, and 4C), assuming that I'm able to remain healthy. It will begin with a short review of graph theory, with emphasis on some highlights of significant graphs in The Stanford GraphBase, from which I will be drawing many examples. Then comes Section 7.1, which deals with bitwise manipulation and with algorithms relating to Boolean functions. Section 7.2 is about generating all possibilities, and it begins with Section 7.2.1: Generating Basic Combinatorial Patterns. That sets the stage for the main contents of the present booklet, namely Section 7.2.1.1 (where I get the ball rolling by dealing with the generation ofn-tuples) and Section 7.2.1.2 (which extends the ideas to permutations). Then will come Section 7.2.1.3 (about combinations), Section 7.2.1.4 (about integer partitions), and Section 7.2.1.5 (about set partitions), all in Fascicle 3. Section 7.2.1.6 (about trees) and Section 7.2.1.7 (about the history of combinatorial generation) will comprise Fascicle 4. Section 7.2.2 will deal with backtracking in general. And so it will go on, if all goes well; an outline of the entire Chapter 7 as currently envisaged appears on the taocp webpage that is cited on page ii.

I had great pleasure writing this material, akin to the thrill of excitement that I felt when writing Volume 2 many years ago. As in Volume 2, where I found to my delight that the basic principles of elementary probability theory and number theory arose naturally in the study of algorithms for random number generation and arithmetic, I learned while preparing Section 7.2.1 that the basic principles of elementary combinatorics arise naturally and in a highly motivated way when we study algorithms for combinatorial generation. Thus, I found once again that a beautiful story was "out there" waiting to be told.

My original intention was to devote far less space to this topic. But when I saw how fundamental the ideas were for combinatorial studies in general, I knew that I could never be happy unless I covered the basics quite thoroughly. Therefore I've done my best to build a solid foundation of theoretical and practical ideas that will support many kinds of reliable superstructures.

The topic of combinatorial generation has not only given me a chance to discuss important mathematical theories, it also has led to other kinds of fun, because of its many connections to amusing games and puzzles. Good puzzles are great aids to education, and I intend to continue focusing on recreational topics throughout Volume 4.

The average boy who abhors square root or algebra finds delight in working puzzles which involve similar principles, and may be led into a course of study which would develop the mathematical and inventive bumps in a way to astonish the family phrenologist.

—Sam Loyd, The World of Puzzledom (1896)

I shall happily pay a finder's fee of $2.56 for each error in this fascicle when it is first reported to me, whether that error be typographical, technical, or historical. The same reward holds for items that I forgot to put in the index. And valuable suggestions for improvements to the text are worth 32 cents each. (Furthermore, if you find a better solution to an exercise, I'll actually reward you with immortal glory instead of mere money, by publishing your name in the eventual book:-)

I wish to thank Yoichi Hariguchi for helping me to build and rebuild the computer on which this booklet was written. And I also want to thank Frank Ruskey for bravely foisting an early draft of this material on college students and for telling me about his classroom experiences.

Notations that are used here and not otherwise explained can be found in the Index to Notations at the end of Volumes 1, 2, or 3. Those indices point to the places where further information is available. Of course Volume 4 will some day contain its own Index to Notations.

Machine-language examples in all future editions of The Art of Computer Programming will be based on the MMIX computer, which is defined in Section 1.3.1' of Volume 1, Fascicle 1. Cross-references to Sections 1.3.1', 1.3.2', 1.4.1', 1.4.2', and 1.4.3' in the present booklet refer to that fascicle.Cross references to yet-unwritten material sometimes appear as '00' in the following pages; this impossible value is a placeholder for the actual numbers to be supplied later.

Happy reading!

D. E. K.

Stanford, California

December 2004

Read More Show Less

Table of Contents

Chapter 7: Combinatorial Searching

7.2. Generating All Possibilities 1

7.2.1. Generating Basic Combinatorial Patterns 1

7.2.1.1. Generating all n-tuples 1

7.2.1.2. Generating all permutations 39

Answers to Exercises 76

Index and Glossary 122

Read More Show Less

Preface

I am grateful to all my friends, and record here and now my most especial appreciation to those friends who, after a decent interval, stopped asking me, "How's the book coming?"

--Peter J. Gomes, The Good Book (1996)

This booklet is Fascicle 2 of The Art of Computer Programming, Volume 4: Combinatorial Algorithms. As explained in the preface to Fascicle 1 of Volume 1, I'm circulating the material in this preliminary form because I know that the task of completing Volume 4 will take many years; I can't wait for people to begin reading what I've written so far and to provide valuable feedback.

There will also be a Fascicle 1 for Volume 4. But I've written Fascicle 2 first. Experienced programmers will understand that the initialization of a program usually can't be written properly until after the main body has been fleshed out.

To put the material in context, this fascicle contains Sections 7.2.1.1 and 7.2.1.2 of a long, long chapter on combinatorial searching. Chapter 7 will eventually fill three volumes (namely Volumes 4A, 4B, and 4C), assuming that I'm able to remain healthy. It will begin with a short review of graph theory, with emphasis on some highlights of significant graphs in The Stanford GraphBase, from which I will be drawing many examples. Then comes Section 7.1, which deals with bitwise manipulation and with algorithms relating to Boolean functions. Section 7.2 is about generating all possibilities, and it begins with Section 7.2.1: Generating Basic Combinatorial Patterns. That sets the stage for the main contents of the present booklet, namely Section 7.2.1.1 (where I get the ball rolling by dealing with the generation of n-tuples) and Section 7.2.1.2 (which extends the ideas to permutations). Then will come Section 7.2.1.3 (about combinations), Section 7.2.1.4 (about integer partitions), and Section 7.2.1.5 (about set partitions), all in Fascicle 3. Section 7.2.1.6 (about trees) and Section 7.2.1.7 (about the history of combinatorial generation) will comprise Fascicle 4. Section 7.2.2 will deal with backtracking in general. And so it will go on, if all goes well; an outline of the entire Chapter 7 as currently envisaged appears on the taocp webpage that is cited on page ii.

I had great pleasure writing this material, akin to the thrill of excitement that I felt when writing Volume 2 many years ago. As in Volume 2, where I found to my delight that the basic principles of elementary probability theory and number theory arose naturally in the study of algorithms for random number generation and arithmetic, I learned while preparing Section 7.2.1 that the basic principles of elementary combinatorics arise naturally and in a highly motivated way when we study algorithms for combinatorial generation. Thus, I found once again that a beautiful story was "out there" waiting to be told.

My original intention was to devote far less space to this topic. But when I saw how fundamental the ideas were for combinatorial studies in general, I knew that I could never be happy unless I covered the basics quite thoroughly. Therefore I've done my best to build a solid foundation of theoretical and practical ideas that will support many kinds of reliable superstructures.

The topic of combinatorial generation has not only given me a chance to discuss important mathematical theories, it also has led to other kinds of fun, because of its many connections to amusing games and puzzles. Good puzzles are great aids to education, and I intend to continue focusing on recreational topics throughout Volume 4.

The average boy who abhors square root or algebra finds delight in working puzzles which involve similar principles, and may be led into a course of study which would develop the mathematical and inventive bumps in a way to astonish the family phrenologist.

--Sam Loyd, The World of Puzzledom (1896)

I shall happily pay a finder's fee of $2.56 for each error in this fascicle when it is first reported to me, whether that error be typographical, technical, or historical. The same reward holds for items that I forgot to put in the index. And valuable suggestions for improvements to the text are worth 32 cents each. (Furthermore, if you find a better solution to an exercise, I'll actually reward you with immortal glory instead of mere money, by publishing your name in the eventual book:-)

I wish to thank Yoichi Hariguchi for helping me to build and rebuild the computer on which this booklet was written. And I also want to thank Frank Ruskey for bravely foisting an early draft of this material on college students and for telling me about his classroom experiences.

Notations that are used here and not otherwise explained can be found in the Index to Notations at the end of Volumes 1, 2, or 3. Those indices point to the places where further information is available. Of course Volume 4 will some day contain its own Index to Notations.

Machine-language examples in all future editions of The Art of Computer Programming will be based on the MMIX computer, which is defined in Section 1.3.1' of Volume 1, Fascicle 1. Cross-references to Sections 1.3.1', 1.3.2', 1.4.1', 1.4.2', and 1.4.3' in the present booklet refer to that fascicle.Cross references to yet-unwritten material sometimes appear as '00' in the following pages; this impossible value is a placeholder for the actual numbers to be supplied later.

Happy reading!

D. E. K.

Stanford, California

December 2004

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted April 25, 2005

    a solid compendium of challenging problems

    This preliminary excerpt from Knuth's Volume 4 will please all the fans of his seminal first three volumes. The didactic style is the same. So too is the very distinctive Tex typeface. (You know that he invented Tex, don't you?) Of course, there are the problem sets. This little book has two sections. In each are 112 problems. Strewth! Knuth thoughtfully gives an estimate next to each of how long it will take you to solve it. Those estimates probably refer to someone of his calibre. I've attempted most of the problems in his earlier volumes and could typically only get within a factor of two of the time estimate. And this was only when I could actually solve a problem. The book addresses a gap in the literature of computer science. Research papers in journals or books of conference proceedings do not usually present you with problems. While introductory texts do, but those are simple. Very difficult to find a solid compendium of challenging problems. Such is the attraction of this book to me and perhaps to you. The potential readership is exclusive and self selecting. The only drawback is the wait for the rest of Volume 4.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)