Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

Introduction to Artificial Intelligence

Undergraduate Topics in Computer


Science Wolfgang Ertel
Visit to download the full and correct content document:
https://textbookfull.com/product/introduction-to-artificial-intelligence-undergraduate-to
pics-in-computer-science-wolfgang-ertel/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Principles of Data Mining Undergraduate Topics in


Computer Science Max Bramer

https://textbookfull.com/product/principles-of-data-mining-
undergraduate-topics-in-computer-science-max-bramer/

Guide to Competitive Programming: Learning and


Improving Algorithms Through Contests (Undergraduate
Topics in Computer Science) Antti Laaksonen

https://textbookfull.com/product/guide-to-competitive-
programming-learning-and-improving-algorithms-through-contests-
undergraduate-topics-in-computer-science-antti-laaksonen/

Introduction to Artificial Intelligence for Security


Professionals 1st Edition The Cylance Data Science Team

https://textbookfull.com/product/introduction-to-artificial-
intelligence-for-security-professionals-1st-edition-the-cylance-
data-science-team/

The Computer Book From the Abacus to Artificial


Intelligence 250 Milestones in the History of Computer
Science Union Square Co Milestones Simson L Garfinkel

https://textbookfull.com/product/the-computer-book-from-the-
abacus-to-artificial-intelligence-250-milestones-in-the-history-
of-computer-science-union-square-co-milestones-simson-l-
Special Topics in Artificial Intelligence and Augmented
Reality: The Case of Spatial Intelligence Enhancement
(Cognitive Technologies) 1st Edition Christos
Papakostas
https://textbookfull.com/product/special-topics-in-artificial-
intelligence-and-augmented-reality-the-case-of-spatial-
intelligence-enhancement-cognitive-technologies-1st-edition-
christos-papakostas/

Artificial Intelligence Methods in Intelligent


Algorithms Proceedings of 8th Computer Science On line
Conference 2019 Vol 2 Radek Silhavy

https://textbookfull.com/product/artificial-intelligence-methods-
in-intelligent-algorithms-proceedings-of-8th-computer-science-on-
line-conference-2019-vol-2-radek-silhavy/

Introduction to Deep Learning From Logical Calculus to


Artificial Intelligence 1st Edition Sandro Skansi

https://textbookfull.com/product/introduction-to-deep-learning-
from-logical-calculus-to-artificial-intelligence-1st-edition-
sandro-skansi/

Artificial Intelligence With an Introduction to Machine


Learning 2nd Edition Richard E. Neapolitan

https://textbookfull.com/product/artificial-intelligence-with-an-
introduction-to-machine-learning-2nd-edition-richard-e-
neapolitan/

Python Programming An Introduction to Computer Science


John M. Zelle

https://textbookfull.com/product/python-programming-an-
introduction-to-computer-science-john-m-zelle/
Undergraduate Topics in Computer Science

Wolfgang Ertel

Introduction
to Artificial
Intelligence
Second Edition
Undergraduate Topics in Computer Science

Series editor
Ian Mackie

Advisory Board
Samson Abramsky, University of Oxford, Oxford, UK
Karin Breitman, Pontifical Catholic University of Rio de Janeiro, Rio de Janeiro, Brazil
Chris Hankin, Imperial College London, London, UK
Dexter Kozen, Cornell University, Ithaca, USA
Andrew Pitts, University of Cambridge, Cambridge, UK
Hanne Riis Nielson, Technical University of Denmark, Kongens Lyngby, Denmark
Steven Skiena, Stony Brook University, Stony Brook, USA
Iain Stewart, University of Durham, Durham, UK
Undergraduate Topics in Computer Science (UTiCS) delivers high-quality instruc-
tional content for undergraduates studying in all areas of computing and information
science. From core foundational and theoretical material to final-year topics and
applications, UTiCS books take a fresh, concise, and modern approach and are ideal
for self-study or for a one- or two-semester course. The texts are all authored by
established experts in their fields, reviewed by an international advisory board, and
contain numerous examples and problems. Many include fully worked solutions.

More information about this series at http://www.springer.com/series/7592


Wolfgang Ertel

Introduction to Artificial
Intelligence
Second Edition

Translated by Nathanael Black


With illustrations by Florian Mast

123
Wolfgang Ertel
Hochschule Ravensburg-Weingarten
Weingarten
Germany

ISSN 1863-7310 ISSN 2197-1781 (electronic)


Undergraduate Topics in Computer Science
ISBN 978-3-319-58486-7 ISBN 978-3-319-58487-4 (eBook)
DOI 10.1007/978-3-319-58487-4

Library of Congress Control Number: 2017943187

1st edition: © Springer-Verlag London Limited 2011


2nd edition: © Springer International Publishing AG 2017
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part
of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission
or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this
publication does not imply, even in the absence of a specific statement, that such names are exempt from
the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this
book are believed to be true and accurate at the date of publication. Neither the publisher nor the
authors or the editors give a warranty, express or implied, with respect to the material contained herein or
for any errors or omissions that may have been made. The publisher remains neutral with regard to
jurisdictional claims in published maps and institutional affiliations.

Printed on acid-free paper

This Springer imprint is published by Springer Nature


The registered company is Springer International Publishing AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface to the Second Edition

After 60 years, Artificial Intelligence (AI) has now reached industry and the con-
sciousness of the population. The impressive successes and new AI methods are
now so relevant that they should be taught even in a basic course. In about 30 new
pages, I report mainly on deep learning, a consistent further development of neural
networks, which finally enables image processing systems to recognize almost any
object in pixel images. Among other benefits, this lead to the first computer pro-
gram that could beat one of the world’s best Go players.
In the new section on Deep Learning, we must not leave out a short report about
the fascinating new subarea of creativity. For the first time neural networks can
creatively generate texts, music pieces, and even paintings in the style of the old
masters. These achievements are based on many years of research on neural net-
works and machine learning. Practical AI has developed into an engineering dis-
cipline in which programs are developed in large industrial teams by experts from
various specializations.
Self-driving cars, service robots, and smart homes—which are all applications of
AI—will greatly change our lives. However, in addition to great rays of hope, there
will be a dark side. Though we live in a time of rapid technological progress, we
have long since exceeded the limits of growth. We must therefore think about
sustainability when implementing each new invention. In Chap. 1, I would like to
give you some food for thought about this topic.
Other new additions to the book include a section on performance evaluation of
clustering algorithms and two practical examples explaining Bayes’ theorem and its
relevance in everyday life. Finally, in a section on search algorithms, we analyze the
cycle check, explain route planning for car navigation systems, and briefly intro-
duce Monte Carlo Tree Search.
All known errors have been corrected and updates have been made in many
places.
I would like to sincerely thank the readers who have given me feedback and all
those who contributed to this new edition through proofreading and suggestions.

v
vi Preface to the Second Edition

I would especially like to thank Adrian Batzill for the route planning measurements
and graphs, as well as Nate Black, Nicole Dathe, Markus Schneider, Robin Leh-
mann, Ankita Agrawal, Wenzel Massag, Lars Berge, Jonas Lang, and Richard
Cubek.

Ravensburg Wolfgang Ertel


March 2017
Preface to the First Edition

Artificial Intelligence (AI) has the definite goal of understanding intelligence and
building intelligent systems. However, the methods and formalisms used on the
way to this goal are not firmly set, which has resulted in AI consisting of a
multitude of subdisciplines today. The difficulty in an introductory AI course lies in
conveying as many branches as possible without losing too much depth and
precision.
Russell and Norvig’s book [RN10] is more or less the standard introduction into
AI. However, since this book has 1,152 pages, and since it is too extensive and
costly for most students, the requirements for writing this book were clear: it should
be an accessible introduction to modern AI for self-study or as the foundation of a
four-hour lecture, with at most 300 pages. The result is in front of you.
In the space of 300 pages, a field as extensive as AI cannot be fully covered. To
avoid turning the book into a table of contents, I have attempted to go into some
depth and to introduce concrete algorithms and applications in each of the following
branches: agents, logic, search, reasoning with uncertainty, machine learning, and
neural networks.
The fields of image processing, fuzzy logic, and natural language processing are
not covered in detail. The field of image processing, which is important for all of
computer science, is a stand-alone discipline with very good textbooks, such as
[GW08]. Natural language processing has a similar status. In recognizing and
generating text and spoken language, methods from logic, probabilistic reasoning,
and neural networks are applied. In this sense this field is part of AI. On the other
hand, computer linguistics is its own extensive branch of computer science and has
much in common with formal languages. In this book we will point to such
appropriate systems in several places, but not give a systematic introduction. For a
first introduction in this field, we refer to Chaps. 22 and 23 in [RN10]. Fuzzy logic,
or fuzzy set theory, has developed into a branch of control theory due to its primary
application in automation technology and is covered in the corresponding books
and lectures. Therefore we will forego an introduction here.
The dependencies between chapters of the book are coarsely sketched in the
graph shown below. To keep it simple, Chap. 1, with the fundamental introduction
for all further chapters, is left out. As an example, the thicker arrow from 2 to 3
means that propositional logic is a prerequisite for understanding predicate logic.

vii
viii Preface to the First Edition

The thin arrow from 9 to 10 means that neural networks are helpful for under-
standing reinforcement learning, but not absolutely necessary. Thin backward
arrows should make clear that later chapters can give more depth of understanding
to topics which have already been learned.

This book is applicable to students of computer science and other technical natural
sciences and, for the most part, requires high school level knowledge of mathe-
matics. In several places, knowledge from linear algebra and multidimensional
analysis is needed. For a deeper understanding of the contents, actively working on
the exercises is indispensable. This means that the solutions should only be con-
sulted after intensive work with each problem, and only to check one’s solutions,
true to Leonardo da Vinci’s motto “Study without devotion damages the brain”.
Somewhat more difficult problems are marked with ❄, and especially difficult ones
with ❄❄. Problems which require programming or special computer science
knowledge are labeled with ➳.
On the book’s web site at http://www.hs-weingarten.de/*ertel/aibook digital
materials for the exercises such as training data for learning algorithms, a page with
references to AI programs mentioned in the book, a list of links to the covered
topics, a clickable list of the bibliography, an errata list, and presentation slides for
lecturers can be found. I ask the reader to please send suggestions, criticisms, and
tips about errors directly to ertel@hs-weingarten.de.
This book is an updated translation of my German book “Grundkurs Künstliche
Intelligenz” published by Vieweg Verlag. My special thanks go to the translator
Nathan Black who in an excellent trans-Atlantic cooperation between Germany and
California via SVN, Skype and Email produced this text. I am grateful to Franz
Kurfeß, who introduced me to Nathan; to MatthewWight for proofreading the
translated book and to Simon Rees from Springer Verlag for his patience.
I would like to thank my wife Evelyn for her support and patience during this
time consuming project. Special thanks go to Wolfgang Bibel and Chris Loben-
schuss, who carefully corrected the German manuscript. Their suggestions and
discussions lead to many improvements and additions. For reading the corrections
and other valuable services, I would like to thank Richard Cubek, Celal Döven,
Joachim Feßler, Nico Hochgeschwender, Paul Kirner, Wilfried Meister, Norbert
Perk, Peter Radtke, Markus Schneider, Manfred Schramm, Uli Stärk, Michel Tokic,
Arne Usadel and all interested students. My thanks also go out to Florian Mast for
the priceless cartoons and very effective collaboration.
I hope that during your studies this book will help you share my fascination with
Artificial Intelligence.

Ravensburg Wolfgang Ertel


February 2011
Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 What Is Artificial Intelligence? . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Brain Science and Problem Solving . . . . . . . . . . . . . . . 3
1.1.2 The Turing Test and Chatterbots . . . . . . . . . . . . . . . . . 5
1.2 The History of AI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.1 The First Beginnings . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.2 Logic Solves (Almost) All Problems . . . . . . . . . . . . . . 8
1.2.3 The New Connectionism . . . . . . . . . . . . . . . . . . . . . . . 9
1.2.4 Reasoning Under Uncertainty . . . . . . . . . . . . . . . . . . . 9
1.2.5 Distributed, Autonomous and Learning Agents . . . . . . 10
1.2.6 AI Grows Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.2.7 The AI Revolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3 AI and Society . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3.1 Does AI Destroy Jobs? . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3.2 AI and Transportation . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.3.3 Service Robotics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.4 Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.5 Knowledge-Based Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2 Propositional Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.1 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.3 Proof Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.4 Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.5 Horn Clauses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.6 Computability and Complexity . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.7 Applications and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.8 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

ix
x Contents

3 First-order Predicate Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39


3.1 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
3.2 Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.2.1 Equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.3 Quantifiers and Normal Forms . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.4 Proof Calculi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.5 Resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
3.5.1 Resolution Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.5.2 Equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.6 Automated Theorem Provers . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.7 Mathematical Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.8 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
3.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
3.10 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
4 Limitations of Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.1 The Search Space Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.2 Decidability and Incompleteness . . . . . . . . . . . . . . . . . . . . . . . . 67
4.3 The Flying Penguin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
4.4 Modeling Uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
4.5 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
5 Logic Programming with PROLOG . . . . . . . . . . . . . . . . . . . . . . . . . 75
5.1 PROLOG Systems and Implementations . . . . . . . . . . . . . . . . . . 76
5.2 Simple Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
5.3 Execution Control and Procedural Elements . . . . . . . . . . . . . . . 79
5.4 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
5.5 Self-modifying Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
5.6 A Planning Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.7 Constraint Logic Programming . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.9 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
6 Search, Games and Problem Solving . . . . . . . . . . . . . . . . . . . . . . . . . 91
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
6.2 Uninformed Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.2.1 Breadth-First Search . . . . . . . . . . . . . . . . . . . . . . . . . . 97
6.2.2 Depth-First Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
6.2.3 Iterative Deepening . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
6.2.4 Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.2.5 Cycle Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
6.3 Heuristic Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
6.3.1 Greedy Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
6.3.2 A★-Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
6.3.3 Route Planning with the A★ Search Algorithm . . . . . . 109
Contents xi

6.3.4 IDA★-Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111


6.3.5 Empirical Comparison of the Search Algorithms . . . . . 111
6.3.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6.4 Games with Opponents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
6.4.1 Minimax Search. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
6.4.2 Alpha-Beta-Pruning . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
6.4.3 Non-deterministic Games . . . . . . . . . . . . . . . . . . . . . . . 117
6.5 Heuristic Evaluation Functions . . . . . . . . . . . . . . . . . . . . . . . . . 118
6.5.1 Learning of Heuristics . . . . . . . . . . . . . . . . . . . . . . . . . 118
6.6 State of the Art . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
6.6.1 Chess . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
6.6.2 Go . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
7 Reasoning with Uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
7.1 Computing with Probabilities . . . . . . . . . . . . . . . . . . . . . . . . . . 127
7.1.1 Conditional Probability . . . . . . . . . . . . . . . . . . . . . . . . 130
7.2 The Principle of Maximum Entropy . . . . . . . . . . . . . . . . . . . . . 136
7.2.1 An Inference Rule for Probabilities . . . . . . . . . . . . . . . 136
7.2.2 Maximum Entropy Without Explicit Constraints . . . . . 141
7.2.3 Conditional Probability Versus Material
Implication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
7.2.4 MaxEnt-Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
7.2.5 The Tweety Example . . . . . . . . . . . . . . . . . . . . . . . . . . 144
7.3 LEXMED, an Expert System for Diagnosing Appendicitis . . . . . . 145
7.3.1 Appendicitis Diagnosis with Formal Methods . . . . . . . 145
7.3.2 Hybrid Probabilistic Knowledge Base . . . . . . . . . . . . . 146
7.3.3 Application of LEXMED . . . . . . . . . . . . . . . . . . . . . . . . . 149
7.3.4 Function of LEXMED . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
7.3.5 Risk Management Using the Cost Matrix . . . . . . . . . . 153
7.3.6 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
7.3.7 Application Areas and Experiences . . . . . . . . . . . . . . . 157
7.4 Reasoning with Bayesian Networks . . . . . . . . . . . . . . . . . . . . . 158
7.4.1 Independent Variables . . . . . . . . . . . . . . . . . . . . . . . . . 158
7.4.2 Graphical Representation of Knowledge as a
Bayesian Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
7.4.3 Conditional Independence . . . . . . . . . . . . . . . . . . . . . . 160
7.4.4 Practical Application . . . . . . . . . . . . . . . . . . . . . . . . . . 162
7.4.5 Software for Bayesian Networks . . . . . . . . . . . . . . . . . 163
7.4.6 Development of Bayesian Networks . . . . . . . . . . . . . . 165
7.4.7 Semantics of Bayesian Networks . . . . . . . . . . . . . . . . . 168
7.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
7.6 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
xii Contents

8 Machine Learning and Data Mining . . . . . . . . . . . . . . . . . . . . . . . . . 175


8.1 Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
8.2 The Perceptron, a Linear Classifier . . . . . . . . . . . . . . . . . . . . . . 183
8.2.1 The Learning Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
8.2.2 Optimization and Outlook . . . . . . . . . . . . . . . . . . . . . . 188
8.3 The Nearest Neighbor Method . . . . . . . . . . . . . . . . . . . . . . . . . 189
8.3.1 Two Classes, Many Classes, Approximation . . . . . . . . 193
8.3.2 Distance Is Relevant . . . . . . . . . . . . . . . . . . . . . . . . . . 194
8.3.3 Computation Times . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
8.3.4 Summary and Outlook . . . . . . . . . . . . . . . . . . . . . . . . . 196
8.3.5 Case-Based Reasoning . . . . . . . . . . . . . . . . . . . . . . . . . 197
8.4 Decision Tree Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
8.4.1 A Simple Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
8.4.2 Entropy as a Metric for Information Content . . . . . . . . 200
8.4.3 Information Gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
8.4.4 Application of C4.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
8.4.5 Learning of Appendicitis Diagnosis . . . . . . . . . . . . . . . 207
8.4.6 Continuous Attributes . . . . . . . . . . . . . . . . . . . . . . . . . 210
8.4.7 Pruning—Cutting the Tree . . . . . . . . . . . . . . . . . . . . . . 211
8.4.8 Missing Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
8.4.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
8.5 Cross-Validation and Overfitting . . . . . . . . . . . . . . . . . . . . . . . . 213
8.6 Learning of Bayesian Networks . . . . . . . . . . . . . . . . . . . . . . . . 215
8.6.1 Learning the Network Structure . . . . . . . . . . . . . . . . . . 215
8.7 The Naive Bayes Classifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
8.7.1 Text Classification with Naive Bayes . . . . . . . . . . . . . 220
8.8 One-Class Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
8.8.1 Nearest Neighbor Data Description . . . . . . . . . . . . . . . 223
8.9 Clustering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
8.9.1 Distance Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
8.9.2 k-Means and the EM Algorithm . . . . . . . . . . . . . . . . . 226
8.9.3 Hierarchical Clustering . . . . . . . . . . . . . . . . . . . . . . . . 228
8.9.4 How is the Number of Clusters Determined? . . . . . . . 230
8.10 Data Mining in Practice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
8.10.1 The Data Mining Tool KNIME . . . . . . . . . . . . . . . . . . 233
8.11 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
8.12 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
9 Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
9.1 From Biology to Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
9.1.1 The Mathematical Model . . . . . . . . . . . . . . . . . . . . . . . 247
9.2 Hopfield Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Contents xiii

9.2.1 Application to a Pattern Recognition Example . . . . . . 251


9.2.2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
9.2.3 Summary and Outlook . . . . . . . . . . . . . . . . . . . . . . . . . 255
9.3 Neural Associative Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
9.3.1 Correlation Matrix Memory . . . . . . . . . . . . . . . . . . . . . 257
9.3.2 The Binary Hebb Rule. . . . . . . . . . . . . . . . . . . . . . . . . 259
9.3.3 A Spelling Correction Program . . . . . . . . . . . . . . . . . . 261
9.4 Linear Networks with Minimal Errors . . . . . . . . . . . . . . . . . . . 263
9.4.1 Least Squares Method . . . . . . . . . . . . . . . . . . . . . . . . . 264
9.4.2 Application to the Appendicitis Data . . . . . . . . . . . . . . 265
9.4.3 The Delta Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
9.4.4 Comparison to the Perceptron . . . . . . . . . . . . . . . . . . . 268
9.5 The Backpropagation Algorithm . . . . . . . . . . . . . . . . . . . . . . . . 269
9.5.1 NETtalk: A Network Learns to Speak . . . . . . . . . . . . . 272
9.5.2 Learning of Heuristics for Theorem Provers . . . . . . . . 273
9.5.3 Problems and Improvements . . . . . . . . . . . . . . . . . . . . 274
9.6 Support Vector Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
9.7 Deep Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
9.7.1 Nature as Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
9.7.2 Stacked Denoising Autoencoder . . . . . . . . . . . . . . . . . 279
9.7.3 Other Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
9.7.4 Systems and Implementations . . . . . . . . . . . . . . . . . . . 281
9.7.5 Applications of Deep Learning . . . . . . . . . . . . . . . . . . 281
9.8 Creativity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
9.9 Applications of Neural Networks . . . . . . . . . . . . . . . . . . . . . . . 284
9.10 Summary and Outlook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
9.11 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
10 Reinforcement Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
10.2 The Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
10.3 Uninformed Combinatorial Search . . . . . . . . . . . . . . . . . . . . . . 293
10.4 Value Iteration and Dynamic Programming . . . . . . . . . . . . . . . 295
10.5 A Learning Walking Robot and Its Simulation . . . . . . . . . . . . . 298
10.6 Q-Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
10.6.1 Q-Learning in a Nondeterministic Environment . . . . . . 303
10.7 Exploration and Exploitation. . . . . . . . . . . . . . . . . . . . . . . . . . . 304
10.8 Approximation, Generalization and Convergence . . . . . . . . . . . 305
10.9 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
10.10 AlphaGo, the Breakthrough in Go . . . . . . . . . . . . . . . . . . . . . . 306
10.11 Curse of Dimensionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
10.12 Summary and Outlook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
10.13 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
xiv Contents

11 Solutions for the Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313


11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
11.2 Propositional Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
11.3 First-Order Predicate Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
11.4 Limitations of Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
11.5 PROLOG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
11.6 Search, Games and Problem Solving . . . . . . . . . . . . . . . . . . . . 319
11.7 Reasoning with Uncertainty . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
11.8 Machine Learning and Data Mining . . . . . . . . . . . . . . . . . . . . . 329
11.9 Neural Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
11.10 Reinforcement Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Introduction
1

1.1 What Is Artificial Intelligence?

The term artificial intelligence stirs emotions. For one thing there is our fascination
with intelligence, which seemingly imparts to us humans a special place among life
forms. Questions arise such as “What is intelligence?”, “How can one measure
intelligence?” or “How does the brain work?”. All these questions are meaningful
when trying to understand artificial intelligence. However, the central question for
the engineer, especially for the computer scientist, is the question of the intelligent
machine that behaves like a person, showing intelligent behavior.
The attribute artificial might awaken much different associations. It brings up
fears of intelligent cyborgs. It recalls images from science fiction novels. It raises
the question of whether our highest good, the soul, is something we should try to
understand, model, or even reconstruct.
With such different offhand interpretations, it becomes difficult to define the term
artificial intelligence or AI simply and robustly. Nevertheless I would like to try,
using examples and historical definitions, to characterize the field of AI. In 1955,
John McCarthy, one of the pioneers of AI, was the first to define the term artificial
intelligence, roughly as follows:
The goal of AI is to develop machines that behave as though they were intelligent.

To test this definition, the reader might imagine the following scenario. Fifteen
or so small robotic vehicles are moving on an enclosed four by four meter square
surface. One can observe various behavior patterns. Some vehicles form small
groups with relatively little movement. Others move peacefully through the
space and gracefully avoid any collision. Still others appear to follow a leader.
Aggressive behaviors are also observable. Is what we are seeing intelligent
behavior?
According to McCarthy’s definition the aforementioned robots can be described
as intelligent. The psychologist Valentin Braitenberg has shown that this seemingly

© Springer International Publishing AG 2017 1


W. Ertel, Introduction to Artificial Intelligence, Undergraduate Topics
in Computer Science, DOI 10.1007/978-3-319-58487-4_1
2 1 Introduction

Fig. 1.1 Two very simple Braitenberg vehicles and their reactions to a light source

complex behavior can be produced by very simple electrical circuits [Bra84].


So-called Braitenberg vehicles have two wheels, each of which is driven by an
independent electric motor. The speed of each motor is influenced by a light sensor
on the front of the vehicle as shown in Fig. 1.1. The more light that hits the sensor,
the faster the motor runs. Vehicle 1 in the left part of the figure, according to its
configuration, moves away from a point light source. Vehicle 2 on the other hand
moves toward the light source. Further small modifications can create other
behavior patterns, such that with these very simple vehicles we can realize the
impressive behavior described above.
Clearly the above definition is insufficient because AI has the goal of solving
difficult practical problems which are surely too demanding for the Braitenberg
vehicle. In the Encyclopedia Britannica [Bri91] one finds a Definition that goes like:

AI is the ability of digital computers or computer controlled robots to solve problems that
are normally associated with the higher intellectual processing capabilities of humans …

But this definition also has weaknesses. It would admit for example that a
computer with large memory that can save a long text and retrieve it on demand
displays intelligent capabilities, for memorization of long texts can certainly be
considered a higher intellectual processing capability of humans, as can for
example the quick multiplication of two 20-digit numbers. According to this
definition, then, every computer is an AI system. This dilemma is solved elegantly
by the following definition by Elaine Rich [Ric83]:

Artificial Intelligence is the study of how to make computers do things at which, at the
moment, people are better.

Rich, tersely and concisely, characterizes what AI researchers have been doing for
the last 50 years. Even in the year 2050, this definition will be up to date.
Tasks such as the execution of many computations in a short amount of time are
the strong points of digital computers. In this regard they outperform humans by
many multiples. In many other areas, however, humans are far superior to
machines. For instance, a person entering an unfamiliar room will recognize the
surroundings within fractions of a second and, if necessary, just as swiftly make
decisions and plan actions. To date, this task is too demanding for autonomous1

1
An autonomous robot works independently, without manual support, in particular without remote
control.
14 1 Introduction

added tax on energy and resource consumption. We would thus arrive at a highly
prosperous, more sustainable human world with less environmental damage and
more local trade. The reader may study the literature and assess whether the ideas
quoted here are interesting and, if necessary, help to make the required changes.
To conclude this section, I would like to quote the famous physicist Stephen
Hawking. In a community-driven interview on www.reddit.com he gave the following
answer to whether he had any thoughts about unemployment caused by automation:
If machines produce everything we need, the outcome will depend on how things are
distributed. Everyone can enjoy a life of luxurious leisure if the machine-produced
wealth is shared, or most people can end up miserably poor if the machine-owners
successfully lobby against wealth redistribution. So far, the trend seems to be toward the
second option, with technology driving ever-increasing inequality.

Another Hawking quotation is also fitting. During the same interview,6 to an AI


professor’s question about which moral ideas he should impart to his students,
Hawking answered:
… Please encourage your students to think not only about how to create AI, but also about
how to ensure its beneficial use.

As a consequence we should question the reasonableness of AI applications such as


the export of intelligent cruise missiles to “allied” Arab states, the deployment of
humanoid combat robots, etc.

1.3.2 AI and Transportation

In the past 130 years, automotive industry engineers have made great strides. In
Germany, one out of every two people owns their own car. These cars are highly
reliable. This makes us very mobile and we use this very convenient mobility in work,
everyday life and leisure. Moreover, we are dependent on it. Today, we can not get by
without a motor vehicle, especially in rural areas with weak public transportation
infrastructure, as for instance in Upper Swabia, where the author and his students live.
The next stage of increased convenience in road transportation is now imminent.
In a few years, we will be able to buy electric self-driving cars, i.e. robotic cars,
which will autonomously bring us to almost any destination. All passengers in the
robotic car would be able to read, work or sleep during the trip. This is possible on
public transit already, but passengers in a robotic car would be able to do this at any
time and on any route.
Autonomous vehicles that can operate independently could also travel without
passengers. This will lead to yet another increase in convenience: robotic taxis. Via a
smartphone app, we will be able to order the optimal taxi, in terms of size and
equipment, for any conceivable transportation purpose. We will be able to choose
whether we want to travel alone in the taxi or whether we are willing to share a ride with

6
https://www.reddit.com/user/Prof-Stephen-Hawking.
Another random document with
no related content on Scribd:
Hanna ymmärsi syyn hänen äkkinäiseen päätökseensä ja katsahti
häneen hymyillen. Toiset kumarsivat, mutisten kiitoksiaan. Hanna
kiitti kreiviä ainoastaan katseellaan ja se olikin ainoa, minkä tämä
huomasi. Samassa oli kreivi jo Hannan vierellä.

»Te saatte nähdä erästä esiäitiäni kuvaavan taulun, jolla on onni


olla teidän näköisenne, arvoisa neiti», sanoi hän.

»Ehkä heidän joukossaan on joku Orfalvy», vastasi Hanna.

Tällä nimellä oli hyvä kaiku, ja itse teossa olikin avioliittoja solmittu
Edelberg- ja Orfalvy-sukujen jäsenten kesken.

»Olette siis Orfalvy… ehkäpä minun serkkuni?»

Nyt yhtyi kenraalitar keskusteluun. Hän sanoi Hannan olevan


nuoren rouvan, syntyisin Orfalvy, eikä neidin, sekä esitti itsensä
saman nimen kantajana. Kreivi kumarsi; tuttavuus oli tehty. Sitten
kenraalitar esitti seurueen muut jäsenet.

Kreivi suoritti isännänvelvollisuutensa linnassaan mitä suurimmalla


rakastettavuudella. Hän oli melkein koko ajan Hannan lähettyvillä, ja
Hanna esiintyi edukseen. Hän oli päättänyt valloittaa tämän
mieltäkiinnittävän miehen, olisihan se kuitenkin voitto, ja sitten olisi
suurenmoista hyljätä tällainen valloitus.

Kun huoneet, kokoelma ja varuskamarit olivat nähdyt, halusi


seurue tuhansin kiitoksin palata ravintolaan. Mutta kreivi ei sitä
sallinut.

»Tehän olette huvimatkalla», sanoi hän. »Sallikaa minun ottaa


siihen osaa 'huvitusmestarina'. Ennen kaikkea syömme nyt
aamiaista; kello on kaksitoista. Sitten valjastutan hevoset ja ajamme
metsästyslinnaani, jonka asekokoelman luulisin huvittavan herroja;
sitten pieni souturetki järvellä ja vasta päivällisen jälkeen, jonka
toivon teidän syövän luonani, sallin teidän palata kotiin.»

Kaikki olivat ihastuneet, mutta Hanna tiesi kenen takia kreivi


tämän teki. Hän tunsi itsensä onnelliseksi. Tämähän oli jo elämisen
arvoista. Päivän ohjelmaa seurattiin uskollisesti, ja kun seurue kello
yhdeksän tienoissa sanoi jäähyväiset — kreivi itse auttoi naisia
vaunuihin ja puristi intohimoisesti Hannan kättä — oli nuori
maailmanmies korviaan myöten rakastunut.

»Tämän viehättävän pikku-rouvan tahdon voittaa», hän ajatteli.

Hanna nojasi vaunun selustaan vaipuen sanomattomaan


onnenhuumeeseen.

»Tätä viehättävää miestä tahdon vastustaa», paloi hänen


mielessään.

Dori täti, joka istui hänen vieressään, ei voinut kyllin ylistää nuoren
linnanherran rakastettavaisuutta sekä kuluneen päivän huveja. Mutta
Hanna ei vastannut tähän mitään.

»Suo minun levätä hiukan; minulla on päänsärkyä», sanoi hän


tahtoen olla rauhassa ajatuksineen.

Kun hän saapui kotiin, istui Ewald kirjoituspöytänsä edessä.

»Oh, vihdoinkin sinä tulet», sanoi hän. »On jo myöhä… Mennään


levolle. No, onko sinulla ollut hauskaa?»

»Oi, kuninkaallisen hauskaa», vastasi Hanna.


VII.

Viikko kului eikä Hanna nähnyt uutta ihailijaansa. Hän ajatteli jo


kreivin poistuneen paikkakunnalta koettamatta lähestyä häntä, ja
hän tunsi katkeraa pettymystä. Ei juuri siksi, että olisi tahtonut
rohkaista häntä, vaan siksi, että kreivi saattoi hänet niin pian
unohtaa… siksi, että päivän kestäneen unen hän oli ehkä yksinään
uneksinut. Kaikki tämä loukkasi häntä.

Kahdeksan päivää huviretken jälkeen Hanna istui kummitätinsä


kanssa kaupunginpuistossa, jonne joka viikko kaikki kokoontuivat
sotilassoittokunnan n.s. kävelykonserttiin. Molemmat naiset olivat
sillä haavaa yksin. Kenraalitar tarkasteli ohikulkevien pukuja, ja
Hanna istui ajatuksiinsa vaipuneena. Orkesteri soitti Brindisiä
Traviatasta.

Äkkiä hänen sydämensä alkoi kiivaasti sykkiä. Käytävän päässä


hän oli nähnyt kreivin. Tämä tuli, huomattuaan molemmat naiset,
nopein askelin heidän luokseen.

Kenraalitar osoitti lähellä olevaa vapaata tuolia, jolle kreivi istuutui.

»Minä matkustin vierailunne jälkeisenä päivänä Edelbergistä»,


sanoi hän. »Asiani kutsuivat minut takaisin Wieniin; mutta nyt aion
viipyä täällä jonkun aikaa.»

Hän silmäili tulisin katsein nuorta rouvaa.

»Täällä kaupungissako?» kysyi hän. »Vai linnassanneko?»

»En, täällä kaupungissa. Minusta tuntuu, kuin tämä kaupunki olisi


valtakunnan mielenkiintoisin kaupunki», jatkoi hän hiljaa.

»Teilläpä on ihmeellinen maku», vastasi Hanna hymyillen.


»Teillehän on koko maailma avoinna. Te voitte halunne mukaan
lähteä pikajunassa Pariisiin tai huvialuksella purjehtia valtameren
poikki…»

»Taikka lentää kanuunankuulan matkassa kuuhun», naureskeli


kreivi.

»Ei, niin pitkälle emme toki ole vielä tulleet.»

»Te huomaatte siis, ettei koko maailma ole avoinna minulle.


Jokaista ihmistä varten on olemassa ainoastaan pieni osa maata
taikka unelmien valtakuntaa, jota hän voi sanoa omaksi
maailmakseen… nimittäin se osa, jonka hänen rakkautensa
käsittää.»

»Taikka hänen velvollisuutensa», jatkoi Hanna.

»Miten kukin tahtoo», arveli Edelberg.

»Miten kunkin tulee», jatkoi Hanna.

Pikku rouva raukka! Hän oli jo asettunut puolustuskuntoon, tuntien


siitä nautintoa. Hän ei tiennyt, että nainen on varmimmin turvassa
hyökkäyksiltä niin kauan, kun hän ei ole huomaavinaan olevansa
vaarassa.

Tämän jälkeen hän tapasi usein kreivin. Kreivi toimeenpani juhlia


ja huvimatkoja; hän vieraili usein Hannan kummitädin luona;
kävelyillä ja teattereissa hän oli aina Hannan vierellä. Ballmannin
kodissa hän ei kuitenkaan käynyt, joten pian kaikki puhuivat nuoren,
kauniin professorinrouvan huomiota-herättävästä valloituksesta;
Ewald yksin ei siitä tiennyt mitään. Hanna vastaanotti kreivin
kunnioituksenosoitukset ilontuntein, mutta torjui rohkeasti kaiken
tunkeilevaisuuden. Kreivi rakasti häntä; hän ei tosin ollut sitä
sanonut… eikä hän saakaan sitä sanoa, ajatteli Hanna… mutta hän
tiesi sen kuitenkin. Entä hän itse? Oi, jospa hän olisi ollut vapaa,
kuinka hän olisikaan rakastanut tuota miellyttävää, hurmaavaa
miestä! Mutta hän oli naimisissa ja — kunniallinen vaimo. Tätä hän
toisti itselleen kerran toisensa jälkeen.

Eräs asia olisi hänet voinut pelastaa. Jos hän olisi voinut sanoa
miehelleen:

»Sinä suojelijani, parhain ystäväni, anna minun avata sinulle


sydämeni… Minua seuraa miehen rakkaus, joka voi syöstä minut
turmioon. Koetan vastustaa vaaraa, mutta tunnen sen vetävän
minua puoleensa. Auta minua, tee vaara tehottomaksi, suojele
minua rakkaudellasi!»

Mies, joka on elänyt maailmassa tai ainakin tutkinut sellaisia


kirjoja, joissa maailma kuvastuu, hän tietää vaaran hetkiä olevan
kauniitten nuorten naisten elämässä; hän tuntee intohimon,
heikkouden ja sydämen ristiriidat ja hän on yhä suuremmalla
hellyydellä sulkeva apuatarvitsevan syliinsä ja voimakkaalla
käsivarrellaan pidättävä häntä kuiluun syöksymästä. Mutta Ewald
Ballmann ei olisi ymmärtänyt vaimoansa, jos hän olisi siten hänelle
puhunut, sen Hanna tunsi, ja se saattoi hänet vaikenemaan. Ewald
olisi suuttunut ja halveksinut häntä tai sanonut häntä »haaveelliseksi
romaanienlukijaksi». Hän olisi yhtä hyvin voinut puhua hänelle
unkarinkielellä — jota hän ei ymmärtänyt — kuin kertoa intohimojen
lumoista.

Eräänä päivänä tai oikeammin sanoen iltana tuli kauan sanomatta


ollut ja kuitenkin jo niin kauan mieliä kalvanut sana sanotuksi.

Oltiin huvimatkalla. Seurue palasi jalkaisin voidakseen paremmin


nauttia kuutamoisesta kesäillasta. Edelberg oli tarjonnut Hannalle
käsivartensa. He kulkivat hiukan toisista edellä, eikä kukaan voinut
kuunnella heidän keskusteluaan.

»Eikö totta, Hanna, te olette tietänyt sen jo kauan», sanoi kreivi


äkkiä.

»Mitä minä olen tietänyt jo kauan?»

»Sen että rakastan teitä.»

Hanna tiesi sen kylläkin, mutta tämä ensimäinen julkilausuminen


iski häneen kuin salama. Hän pysähtyi, ja hänen käsivartensa vapisi
hänen kainalossaan.

»Älkää puhuko niin», pyysi hän hiljaa. »Se loukkaa minua…»

Mutta hänen äänensä ei ollut vihainen, ainoastaan kiihtynyt.

Kreivi veti hänet muassaan kauemmaksi.


»Älkäämme pysähtykö! Se voisi herättää huomiota. Miksi minun
rakkauteni loukkaisi teitä? Jos te olisitte vapaa, tarjoaisin teille käteni
ja nimeni. Te olette ihanin, jumalallisin, hurmaavin nainen, minkä
olen tavannut. Elämäni kuuluu teille… kuuluu sinulle… Tee minulle
mitä tahdot…»

Ensi kertaa lausuttu »sinä» iski häneen taas kuin salama.

»Kuinka te uskallatte sinutella minua?»

»Hanna, Hanna, älä kiellä sydämesi ääntä! Sinun täytyy tietää,


että minun tuntemani rakkaus, sellainen rakkaus on sinun arvoisesi.
Sinähän et tunne itseäsi, sinä ihana nainen, jos sinä…»

»Te olette mieletön! Laskekaa minut irti!»

Hanna tahtoi vetää kätensä pois, mutta kreivi ei hellittänyt.

»Hanna, älkää olko minulle vihainen! Jos tahdotte, olen puhumatta


rakkaudestani… minä vaikenen siksi, kunnes te itse sanotte: 'Elämä
on sentään ihanaa… vie minut pois!'»

»Sitä en sano koskaan. Kalleinta minulle on kunniani.»

»Uskokaa minua, Hanna, kun rakastaa, ei koko maailmassa ole


mitään 'kalliimpaa kuin rakastettu olento.»

»Onpa kylläkin. Jospa rakastaisinkin, pitäisin aina velvollisuutta


kallisarvoisempana.»

»Mutta kun te ette rakasta, ette myöskään voi arvostella sitä


asiaa…»

»Kukapa tietää?…»
»Hanna, rakastatko minua?»

Hanna ei vastannut. Kreivi ymmärsi hänen vaitiolonsa, ja he


jatkoivat matkaansa ääneti. Hetken kuluttua hän sanoi:

»Minä olen niin sanomattoman, niin äärettömän onnellinen, että se


vallan pelottaa minua. En tahdo toivoa mitään muuta kuin sitä, minkä
jo olen voittanut, tietoisuutta siitä, että te…»

»Hiljaa!» huudahti Hanna. »Sitä ei koskaan saa lausua.»

»Minä tottelen käskyjänne. Mitä teillä on vielä sanottavaa?»

»Te ette koskaan saa enää puhua tästä… tämä viimeinen


neljännestunti on pyyhittävä todellisuudesta… Ainoastaan sillä
ehdolla annan teille anteeksi», lisäsi hän hiljaa, »mutta en unohda.»

Siten solmittiin vaarallinen liitto. Ensimäinen pysäkkihän


vaarallisella tiellä on juuri molemminpuolisen tunnustuksen
uusiutumisen kielto. Puhutaan jokapäiväisistä asioista. Katsellaan
toisiaan hellästi silmiin ja sanotaan: »Tänään on kaunis ilma.»
»Sanomalehdet kertovat ministerinvaihdoksesta.» Ja näihin sanoihin
sisältyy kuitenkin: »Minä rakastan sinua, minä rakastan sinua.» Se
kuuluu rakastetun äänestä, se soi alituiseen, vaikka se onkin vain
yhden ainoan kerran ilmilausuttu. Tämä on ehkä viehättävämpää,
salaisempaa, ihanampaa kuin sanoilla ilmituoden. Sydän värähtelee
silloin kuin ilmakanteleen kielet. Kun Hanna lausui vaarallisen
»kukapa tietää», sanoi hän oikeastaan enemmän kuin tunsi. Hänen
sydämensä ei ollut silloin vielä pauloissa; vasta tämä sana sitoi
hänet, eikä hänellä ollut enää voimia katkaista tätä sidettä. Hänen
puolustusmenettelynsä mukaan oli kunniakkaampaa vastustaa
miestä, jota rakasti, kuin sitä, joka oli ainoastaan vaarallinen; hän
tahtoi kohottaa siveyttään niin hyvin omissa kuin hänen silmissään
näyttämällä, että siveys voi kunniakkaasti vastustaa rakkautta.

Vielä olisi Hannalla ollut tilaisuus pyytää miehensä suojelusta.


Mutta hän katsoi olevansa kyllin vahva yksin kestämään
kamppailunsa. Ketään hän ei enää tahtonut uskotukseen… hänen
salaisuutensa oli hänelle kallis. Rikkauden, aarteen tavoin se oli
kätkettynä hänen ahdistettuun sydämeensä.

Palatessaan huvimatkalta vastasi hän Ewaldin tavanmukaiseen


kysymykseen: »Onko sinulla ollut hauskaa?» hyvin
välinpitämättömästi, haukotellen:

»Ei, siellä oli hyvin ikävää.»

»Sen kyllä uskon», vastasi Ewald.


VIII.

Asiat kehittyivät kuten saattoi aavistaakin. Yhä kiihkeämmin, yhä


huimaavammin veti kuilu puoleensa. Hanna koetti ajatella
kunniaansa, omanarvon-tunnettaan, velvollisuuttaan, mitään pahaa
aavistamatonta, luottavaa miestään, jonka kunnia oli hänenkin
kunniansa. Hän piti siveyttään suuressa arvossa… mutta eikö
ihminen rakasta myöskin elämää, jos hän korkean tornin huipusta
katselee alas ja haluaa auttamattomasti suistua syvyyteen?

Jo aikoja sitten he olivat rikkoneet sopimuksensa olla puhumatta


rakkaudestaan. Sata kertaa oli kreivi intohimoisesti rukoillut Hannaa
omakseen. Yhdeksänkymmentäyhdeksän kertaa hän vastasi »ei».

»Paetkaamme, Hanna!» kysyi hän sadannen kerran. »Me emme


tahdo valehdella, emme pettää; julkisesti tahdomme asettaa
rakkauden elämämme päämääräksi. Sinulle omistan koko
tulevaisuuteni. Minä kannan surut puolestasi, minä jaksan kestää
moitteet; lähtekäämme vieraaseen maahan, jossa ei kukaan meitä
tunne, missä sinä vallitset kauneuden kuningattarena. Ellet sinä tule
omakseni, täytyy minun kuolla… Hanna, tule — tule — meitä odottaa
taivaan autuudet…»
Hanna sulki silmänsä.

»Minä olen hukassa», sanoi hän.

Kreivi tukahutti riemuhuutonsa.

»Sinä tulet siis?»

»Tulen.»

Paosta sovittiin seuraavalla tavalla: kreivi matkustaa ensin yksin


Wieniin. Hannan tulee, otollisen hetken ilmaantuessa, lähteä
iltajunassa jälkeen. Väliasemalta hän sähköttää kreiville, joka on
sitten häntä vastassa asemalla. Ellei kreivi saa ajoissa
sähkösanomaa eikä niin ollen saavu asemalle, ottaa Hanna vaunut
ja ajaa »Hotel Imperial'iin, jossa on asunto varattuna »kreivitär
Edelbergille».

Tuskin oli Hanna myöntynyt, ennenkuin hän jo tunsi tällaisen


askeleen tuottamaa tuskaa. Mutta arpa oli heitetty. Siitä hetkestä
aina lähtöpäivän iltaan saakka hän eli kuin unessa. Hänen
rakastettunsa puolesta antamansa uhri oli todellakin suuri. Ewaldin
näkeminen oli murtaa hänen sydämensä. Oli hetkiä, jolloin hän
todella rakasti miestään tuota hyvää, levollista, lapsellisen onnellista
miestä, joka nyt oli tuleva onnettomaksi — rakasti enemmän kuin
loistavaa, hemmoteltua kreiviä, johon ei oikein luottanut.

Edelberg oli jo ollut viikon Wienissä, kun lukion johtajan


kaksikymmenviisivuotisjuhla soi Hannalle tilaisuuden Ewaldin
poissaollessa ryhtyä matkavalmistuksiin ja lähteä kotoa. Hän päätti
käyttää tätä hyväkseen, mutta oli kuin joku muu Hanna olisi tehnyt
tämän päätöksen ja toimeenpannut sen ja kuin oikea Hanna olisi
vavisten ollut katsojana. Ja sitten näimme hänen viimeisen kerran
astuvan peilin ääreen sanomaan jäähyväisiä kyyneleiselle kuvalleen.

*****

Neljä tuntia myöhemmin Ballmann palasi kotiin. Hän avasi


äänettömästi oven omalla avaimellaan ja meni suoraa päätä
makuukamariin. Siellä hän sytytti kynttilän ja hämmästyi suuresti,
kun vaimonsa ei ollut mennyt levolle.

»Hän on odottanut minua», ajatteli hän mennen saliin. Mutta siellä


oli pimeää, lamppu oli sammunut. Hakien kynttilän hän meni vielä
kerran sinne. Avatut kaapit, huiskin haiskin olevat paperinpalaset,
sammuneen lampun käry herättivät hänessä arvaamattoman
levottomuuden.

»Onkohan jokin onnettomuus tapahtunut?» kysyi hän ääneen.

Hän meni kirjoituspöydän ääreen. Siellä oli hänelle osoitettu kirje.


Mitä tämä oli? Häntä värisytti. Hän tunsi käsialan: »Hannalta». Hän
ajatteli häntä rakkaudella, sillä hän oli juuri kaivannut häntä tyhjässä
kodissa.

Hän avasi kirjeen ja alkoi lukea. Hänen silmissään musteni. Hän ei


heti ymmärtänyt Hannan kirjeen tarkoitusta, vaan luki sen vielä
kerran. Sitten hän vaipui kirjoituspöydän ääressä olevalle tuolille ja
luki kirjeen kolmannen kerran. Kauhistuen hän katseli ympärilleen
huoneessa. Siellä vallitseva epäjärjestys toisti kirjeen sisällyksen:
»Sinä olet yksin, kunniasi on tahrattu, sinä olet hyljätty, mies
raukka!» Vaikeroiden hän antoi kätensä vaipua pöydälle ja painoi
päänsä niihin.
Kauan, kauan hän oli samassa asennossa. Kynttilä paloi loppuun,
ja yhä istui Ewald kasvot käsien peitossa ja — itki.
IX.

Sillä välin Hanna istui yksinään ensi luokan osastossa silmät


ummessa. Hän ajatteli huomispäivää; edellistä päivää hän ei
tahtonut ensinkään muistaa. Kuvat miehestään, kummitädistään,
entisestä elämästään hän karkoitti ajatuksistaan, hän tahtoi vain
uneksia tulevaisuudesta. Taistelu oli päättynyt. Hän oli
auttamattomasti katkaissut kaikki siteet, mitkä häntä yhdistivät
takanaolevaan. Hänen edessään häämötti ihmeellinen elämä täynnä
yllätyksiä, tuntemattomia, viekoittelevia ja värisyttäviä seikkailuja,
joihin sekoittui rakkautta ja syntiä, kunniaa ja häpeää, iloa ja kauhua.
Että hän saakin kokea jotain sellaista!

Hän kuunteli pyörien jyrinää, veturin puhkumista, viereisestä


osastosta kuuluvia ääniä, junailijain huutoja, vaunujen töytäyksiä,
yleensä kaikkia rautatiematkoihin yhdistyviä ääniä, jotka hänen
mielestään soittivat hänelle tulevaisuuden outoa symfoniaa. Kuinka
ihmiset saattoivat olla niin välinpitämättömiä! Miten he asemilla
häärivät edestakaisin löytääkseen matkakapineensa! Ja että he
saattoivat jäädä väliasemille eivätkä matkustaneet Wieniin, Hotel
Imperialiin… rakastettua tapaamaan! Voi heitä poloisia, heillä oli vain
jokapäiväinen elämä edessä!
Hanna nukahti hetkeksi, mutta alituiseen hän kuuli — unissaankin
— rautatiesymfonian, minkä sävelissä soi hänen määrätty, mutta
epäselvä tulevaisuutensa.

Junailija herätti hänet.

»Saisinko piletin?»

Hanna otti käsineestään pienen keltaisen lipun.

»Olemmeko pian perillä?» kysyi hän.

»Seuraava asema on Wien», vastasi junailija jättäen takaisin


piletin ja meni seuraavaan vaunuun.

Nyt häntä ei haluttanut enää nukkua. Päivä oli jo valjennut. Hanna


katseli ikkunasta ohikiitäviä sähkölennätinpatsaita näennäisesti
kohoavine ja laskevine lankoineen, viljavainioita, joiden sarat
ikäänkuin muodostivat avattuja ja tien luona suljettuja viuhkoja,
ratavartiatupia pienine puutarhapalstoineen, joissa koreat asterit ja
jäykät georgiinit kukkivat, rautatiekiskoja, joita näkyi nyt yhä
tiheämmin ja joilla oli numeroituja tavaravaunuja; kaikkea tätä hän
katseli tahtomatta ajatella mitään muuta. Hän tahtoi hetkessä koota
matkan vaikutelmat ja unohtaa sen päämäärän. Hänestä
rautatiematkat olivat hauskoja. Hän oli saanut tehdä ainoastaan
joitakuita matkoja, kaksi tai kolme kertaa hän oli ollut Wienissä,
kerran Triestissä, siinä kaikki; mutta hän oli kuitenkin säilyttänyt
muistossaan lapsellisen ihastuksensa niiden johdosta. Nyt hän sai
matkustaa avaraan maailmaan… Hän pääsi Pariisiin, Lontooseen,
Italiaan, Amerikkaan, milloin häntä vain haluttaisi. Hän vaipui
matkaunelmiinsa. Juna hiljensi kulkuaan ja vieri suurelle asemalle…
Wien!
Vaunujen ovet avattiin; kantajia ryntäsi esille, ja asemasillalla vilisi
ihmisiä.

Äkkiä nuori rouva säikähti. Matka oli lopussa, ja nyt alkoi


tuntematon elämä. Hän ei ollut sähköttänyt, vaikka oli sovittu. Viime
hetkessä hän oli päättänyt ilmoittaa tulostaan vasta hotelliin
saavuttuaan. Mutta ehkäpä Edelberg oli sittenkin tullut. Hän katseli
arasti ympärilleen tietämättä, pelkäsikö vai toivoiko kreivin olevan
vastassa. Jos hän olisi nähnyt hänet, olisi hän ehkä ajatellut:
»Jumalan kiitos, hän on täällä!» Mutta kun ei kukaan tullut häntä
vastaan hänen seuratessaan ihmisvirtaa ja tullessaan rappusille
näkemättä kreiviä, tunsi hän rauhoittuvansa ja ajatteli: »Jumalan
kiitos! Hän ei ole täällä.»

Kantaja kulki hänen jäljessään tuoden hänen matkalaukkuaan.

»Haluatteko vaunut?» kysyi hän.

»Kyllä», vastasi Hanna.

»Onko armollisella rouvalla muita tavaroita?»

»Ei; viekää minut vaunuihin.»

»Olkaa hyvä, tännepäin!»

Hanna seurasi kantajaa kadulle, missä vaunuja ja muita ajopelejä


oli pitkässä rivissä. Hiukan kauempana olivat raitiotievaunut. Kantaja
avasi vaunujen oven ja asetti matkalaukun niihin. Hanna nousi
vaunuihin.

»Entä juomarahat!»
Hanna avasi kukkaronsa. Hänellä ei ollut pikkurahoja, joten hän
antoi miehelle guldenin.

»Kiitoksia, armollinen rouva. Minne kuski saa ajaa?»

»Hotel Imperialiin.»

»Hotel Imperialiin!» huusi kantaja kuskille ja sulki oven.

Matka sujui wieniläisvaunuille ominaisella nopeudella; kuljettiin


etukaupungin läpi ja saavuttiin keskikaupungin kautta Ring'ille.

Kello oli lähes yhdeksän aamulla. Puodit olivat jo avatut. Kaduilla


vilisi kävelijöitä ja ajavia. Tämä vilkas hälinä häikäisi Hannan silmiä.

»Ja kaikilla näillä ihmisillä ei ole aavistustakaan siitä, mimmoinen


kohtalo minua odottaa!» ajatteli hän. »Tiedänkö sitä edes itsekään?
Miten ihmeellistä! Eilen tähän aikaan olin vielä kotona; silloin saatoin
vielä päätellä suuntaan tai toiseen, tänään ympäröi minua jo uusi,
tuntematon maailma… en ole niin onneton kuin eilen illalla… minä
olen… ei, onnellinen en ole… mutta niin utelias, niin äärettömässä
jännityksessä.»

Vaunut pysähtyivät hotellin eteen.

»Onko kreivitär Edelbergiä varten tilattu huone?» kysyi Hanna


hiukan epävarmalla äänellä ovenvartialta.

»On kyllä, armollinen kreivitär», vastasi tämä syvään kumartaen ja


auttoi nuoren rouvan vaunuista.

»Vie kreivitär N:o 20:een», sanoi hän palvelijalle. »Kuskin maksan


minä. Armollinen kreivitär ei huoli vaivautua.»
Hanna seurasi palvelijaa ylös portaita. Hotel Imperial oli vanha
herttuallinen linna. Leveät, matoilla peitetyt portaat kullattuine
käsipuineen, kukkineen ja peileineen tekivät juhlallisen vaikutuksen.
Hannan tuli hyvä olla. Ensimäinen askel oudossa maailmassa oli toki
kullattu. Tästä hetkestä saakka hän saisi elää aina sellaisissa
palatseissa.

Saavuttuaan ensimäiseen kerrokseen palvelija avasi kaksiosaisen


oven sekä sanoi:

»Tässä ovat tilatut huoneet. Haluaako teidän armonne syödä


aamiaista?»

Hanna vastasi myöntävästi astuen huoneistoonsa. Ensimäinen


huone, suuri sali, keltaisella damastilla päällystettyine
huonekaluineen teki loistavan vaikutuksen; salin vieressä oli
makuuhuone ja pukeutumishuone. Jokaisessa uunissa loimusi kirkas
takkavalkea. Hanna riisui hatun ja palttoon, astui peilin luo ja
huomatessaan, etteivät matkan rasitukset olleet vähintäkään
himmentäneet hänen kukoistavaa kauneuttaan, hän hymyillen
järjesti kiharoitansa.

Senjälkeen hän siirtyi parvekkeelle. Hänen edessään oli kaunis


Ring-katu. Leuto syksyilma väreili plataanien latvoissa. Vaunujen
tärinä ja omituinen suurkaupungin tuoksu, jonka hän muisti
aikaisemmilta käynneiltään Wienissä, tunkeutui hänen luokseen.

Sillä aikaa oli palvelija asettanut hopeatarjottimelle katetun


aamiaisen pöydälle. Hanna palasi saliin ja kaatoi itselleen teetä. Hän
oli nälissään ja hiukan väsynyt. Komea aamiainen erinomaisine
wieniläisleipineen, tuoreine voineen, vaahtoavine kermoineen,
munineen, kinkkuineen ja piirakaisineen maistui erinomaisen hyvältä
ja antoi hänelle uusia voimia. Hän soitti. Palvelija saapui.

»Milloin nämä huoneet tilattiin?» kysyi hän.

»Kahdeksan päivää sitten. Kreivi Edelberg käy kahdesti päivässä


kysymässä, onko hänen rouva serkkunsa jo saapunut.
Ilmoitammeko herra kreiville?»

»Minä kirjoitan lipun. Asuuko hän kaukana täältä?

»Edelbergien palatsi sijaitsee Oopperan luona, aivan lähellä.»

»Hyvä, antakaa minulle paperia ja mustetta, niin kirjoitan.»

»Tässä, teidän armonne. Odotanko.»

»Ei, soitan sitten kun olen kirjoittanut.»

»Hyvä.»

Ennenkuin Hanna istuutui kirjoittamaan, kulki hän huoneissa vielä


kerran. Hän huomasi silloin vasta, että siellä oli sellaisia tavaroita,
joita hotellihuoneissa ei juuri tapaa. Salissa oli flyygeli ja nuotteja.
Eräällä pöydällä oli sanomalehtiä, kirjoja ja albumi. Kukkaspöytiä oli
nurkissa, ja uuninreunalla ja peilipöydillä olevat maljakot olivat
täynnään kukkia. Miten hellästi ja huomaavaisesti hänen
rakastettunsa olikaan ajatellut häntä!

Ja kuitenkaan hän ei tuntenut jälleennäkemisen iloa; päinvastoin


hän ajatteli vavisten tapaamista. Tuskainen puna peitti hänen
poskiaan hänen ajatellessaan hetkeä, jolloin hänen voittajansa
astuisi kynnyksen yli. Hän halusi siirtää sitä hetkeä vielä hiukan. Ja
siksi hän istuutui pöydän ääreen kirjoittamaan:

»Olen juuri saapunut. Olen väsynyt ja tarvitsen parin tunnin levon.


Odotan teitä — ei, sinua — kello viiden tienoissa. H.»

Hän soitti ja jätti kirjeen palvelijalle.

»Viekää tämä heti Edelbergien palatsiin.»

»Toimitetaan.»

Sitten hän lukitsi ovet voidakseen rauhassa katsella kauniita ja


mieltäkiinnittäviä tavaroita. Hän tarkasti kaikkia erikseen. Ensin hän
avasi flyygelin. Se oli Streich. Hän soitti muutamia akordeja: oi, miten
täyteläiset, pehmeät ja kirkkaat ne olivat. Nuottien joukosta hän löysi
uusimpien, suurten oopperain sekä Karl- ja Wiedener-teattereissa
juuri myrskyisintä suosiota herättäneiden operettien partituurit,
muutamia Straussin valsseja, Chopinin nocturneja sekä Verdin
messun. Pöydällä oli ranskalaisia, englantilaisia ja saksalaisia
kuvalehtiä; Wienin pilalehtiä, muotilehtiä sekä Octave Feuillet'n
»Camorsin kreivi»; joku Disraelin romaani Tauchnitz-painoksena;
valokuvakokoelma Belvedere-näyttelystä sekä toinen, jossa oli
eurooppalaisten hallitsijain ja taidepiirin kuuluisuuksien kuvat.

Hanna silmäili kaikkea tätä pintapuolisesti. Hän päätti myöhemmin


kiinnittää niihin enemmän huomiota. Kun oman romaanin tapahtumat
seuraavat toisiaan niin nopeasti kuin tässä, ei saata syventyä
mielikuviin. Salista hän meni makuu- ja pukeutumishuoneeseen.
Vasta nyt hän huomasi täälläkin häntä odottavan yllätyksiä.
Peilipöydän viereisellä tuolilla oli avonainen, noin puolilleen täytetty
matkalaukku. Peilipöydälle posliinikehyksisen peilin ympärille oli

You might also like