100% found this document useful (1 vote)
5 views

An Introduction to Statistical Computing A Simulation based Approach 1st Edition Jochen Voss instant download

Ebook download

Uploaded by

hyslopstutz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
5 views

An Introduction to Statistical Computing A Simulation based Approach 1st Edition Jochen Voss instant download

Ebook download

Uploaded by

hyslopstutz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

An Introduction to Statistical Computing A

Simulation based Approach 1st Edition Jochen


Voss pdf download

https://ebookfinal.com/download/an-introduction-to-statistical-
computing-a-simulation-based-approach-1st-edition-jochen-voss/

Explore and download more ebooks or textbooks


at ebookfinal.com
Here are some recommended products for you. Click the link to
download, or explore more at ebookfinal

Program Evaluation An Introduction to an Evidence Based


Approach 6th Edition David Royse

https://ebookfinal.com/download/program-evaluation-an-introduction-to-
an-evidence-based-approach-6th-edition-david-royse/

Introduction to Supercritical Fluids A Spreadsheet based


Approach 1st Edition Richard Smith

https://ebookfinal.com/download/introduction-to-supercritical-fluids-
a-spreadsheet-based-approach-1st-edition-richard-smith/

Location Based Services 1st Edition Jochen Schiller

https://ebookfinal.com/download/location-based-services-1st-edition-
jochen-schiller/

An Introduction to Statistical Signal Processing 1st


Edition Robert M. Gray

https://ebookfinal.com/download/an-introduction-to-statistical-signal-
processing-1st-edition-robert-m-gray/
An Introduction to Numerical Methods A MATLAB Approach
Third Edition Guenther

https://ebookfinal.com/download/an-introduction-to-numerical-methods-
a-matlab-approach-third-edition-guenther/

An invariant approach to statistical analysis of shapes


1st Edition Subhash R. Lele

https://ebookfinal.com/download/an-invariant-approach-to-statistical-
analysis-of-shapes-1st-edition-subhash-r-lele/

An Introduction to Statistical Concepts 3rd Edition Debbie


L. Hahs-Vaughn

https://ebookfinal.com/download/an-introduction-to-statistical-
concepts-3rd-edition-debbie-l-hahs-vaughn/

A Comprehensible Guide to J1939 First Edition Voss

https://ebookfinal.com/download/a-comprehensible-guide-to-j1939-first-
edition-voss/

An introduction to computer simulation methods


Applications to physical systems 3rd Edition Harvey Gould

https://ebookfinal.com/download/an-introduction-to-computer-
simulation-methods-applications-to-physical-systems-3rd-edition-
harvey-gould/
An Introduction to Statistical Computing A Simulation
based Approach 1st Edition Jochen Voss Digital Instant
Download
Author(s): Jochen Voss
ISBN(s): 9781118357729, 1118357728
Edition: 1
File Details: PDF, 3.37 MB
Year: 2013
Language: english
An Introduction to
Statistical Computing
WILEY SERIES IN COMPUTATIONAL STATISTICS

Consulting Editors:

Paolo Giudici
University of Pavia, Italy

Geof H. Givens
Colorado State University, USA

Bani K. Mallick
Texas A & M University, USA

Wiley Series in Computational Statistics is comprised of practical guides and cutting


edge research books on new developments in computational statistics. It features
quality authors with a strong applications focus. The texts in the series provide
detailed coverage of statistical concepts, methods and case studies in areas at the
interface of statistics, computing, and numerics.
With sound motivation and a wealth of practical examples, the books show in
concrete terms how to select and to use appropriate ranges of statistical comput-
ing techniques in particular fields of study. Readers are assumed to have a basic
understanding of introductory terminology.
The series concentrates on applications of computational methods in statistics to
fields of bioinformatics, genomics, epidemiology, business, engineering, finance and
applied statistics.

Titles in the Series


Biegler, Biros, Ghattas, Heinkenschloss, Keyes, Mallick, Marzouk, Tenorio,
Waanders, Willcox – Large-Scale Inverse Problems and Quantification of Uncertainty
Billard and Diday – Symbolic Data Analysis: Conceptual Statistics and Data Mining
Bolstad – Understanding Computational Bayesian Statistics
Borgelt, Steinbrecher and Kruse – Graphical Models, 2e
Dunne – A Statistical Approach to Neutral Networks for Pattern Recognition
Liang, Liu and Carroll – Advanced Markov Chain Monte Carlo Methods
Ntzoufras – Bayesian Modeling Using WinBUGS
Tufféry – Data Mining and Statistics for Decision Making
An Introduction to
Statistical Computing
A Simulation-based Approach

Jochen Voss
School of Mathematics, University of Leeds, UK
This edition first published 2014

C 2014 John Wiley & Sons, Ltd

Registered office
John Wiley & Sons, Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ,
United Kingdom
For details of our global editorial offices, for customer services and for information about how to apply
for permission to reuse the copyright material in this book please see our website at www.wiley.com.
The right of the author to be identified as the author of this work has been asserted in accordance with the
Copyright, Designs and Patents Act 1988.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or
transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise,
except as permitted by the UK Copyright, Designs and Patents Act 1988, without the prior permission of
the publisher.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may
not be available in electronic books.
Designations used by companies to distinguish their products are often claimed as trademarks. All brand
names and product names used in this book are trade names, service marks, trademarks or registered
trademarks of their respective owners. The publisher is not associated with any product or vendor
mentioned in this book.
Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in
preparing this book, they make no representations or warranties with respect to the accuracy or
completeness of the contents of this book and specifically disclaim any implied warranties of
merchantability or fitness for a particular purpose. It is sold on the understanding that the publisher is not
engaged in rendering professional services and neither the publisher nor the author shall be liable for
damages arising herefrom. If professional advice or other expert assistance is required, the services of a
competent professional should be sought.
Library of Congress Cataloging-in-Publication Data
Voss, Jochen.
An introduction to statistical computing : a simulation-based approach / Jochen Voss. – First edition.
pages cm. – (Wiley series in computational statistics)
Includes bibliographical references and index.
ISBN 978-1-118-35772-9 (hardback)
1. Mathematical statistics–Data processing. I. Title.
QA276.4.V66 2013
519.501 13–dc23
2013019321

A catalogue record for this book is available from the British Library.
ISBN: 978-1-118-35772-9
Typeset in 10/12pt Times by Aptara Inc., New Delhi, India

1 2014
Contents

List of algorithms ix

Preface xi

Nomenclature xiii

1 Random number generation 1


1.1 Pseudo random number generators 2
1.1.1 The linear congruential generator 2
1.1.2 Quality of pseudo random number generators 4
1.1.3 Pseudo random number generators in practice 8
1.2 Discrete distributions 8
1.3 The inverse transform method 11
1.4 Rejection sampling 15
1.4.1 Basic rejection sampling 15
1.4.2 Envelope rejection sampling 18
1.4.3 Conditional distributions 22
1.4.4 Geometric interpretation 26
1.5 Transformation of random variables 30
1.6 Special-purpose methods 36
1.7 Summary and further reading 36
Exercises 37

2 Simulating statistical models 41


2.1 Multivariate normal distributions 41
2.2 Hierarchical models 45
2.3 Markov chains 50
2.3.1 Discrete state space 51
2.3.2 Continuous state space 56
2.4 Poisson processes 58
2.5 Summary and further reading 67
Exercises 67
vi CONTENTS

3 Monte Carlo methods 69


3.1 Studying models via simulation 69
3.2 Monte Carlo estimates 74
3.2.1 Computing Monte Carlo estimates 75
3.2.2 Monte Carlo error 76
3.2.3 Choice of sample size 80
3.2.4 Refined error bounds 82
3.3 Variance reduction methods 84
3.3.1 Importance sampling 84
3.3.2 Antithetic variables 88
3.3.3 Control variates 93
3.4 Applications to statistical inference 96
3.4.1 Point estimators 97
3.4.2 Confidence intervals 100
3.4.3 Hypothesis tests 103
3.5 Summary and further reading 106
Exercises 106

4 Markov Chain Monte Carlo methods 109


4.1 The Metropolis–Hastings method 110
4.1.1 Continuous state space 110
4.1.2 Discrete state space 113
4.1.3 Random walk Metropolis sampling 116
4.1.4 The independence sampler 119
4.1.5 Metropolis–Hastings with different move types 120
4.2 Convergence of Markov Chain Monte Carlo methods 125
4.2.1 Theoretical results 125
4.2.2 Practical considerations 129
4.3 Applications to Bayesian inference 137
4.4 The Gibbs sampler 141
4.4.1 Description of the method 141
4.4.2 Application to parameter estimation 146
4.4.3 Applications to image processing 151
4.5 Reversible Jump Markov Chain Monte Carlo 158
4.5.1 Description of the method 160
4.5.2 Bayesian inference for mixture distributions 171
4.6 Summary and further reading 178
4.6 Exercises 178

5 Beyond Monte Carlo 181


5.1 Approximate Bayesian Computation 181
5.1.1 Basic Approximate Bayesian Computation 182
5.1.2 Approximate Bayesian Computation with regression 188
5.2 Resampling methods 192
CONTENTS vii

5.2.1 Bootstrap estimates 192


5.2.2 Applications to statistical inference 197
5.3 Summary and further reading 209
Exercises 209

6 Continuous-time models 213


6.1 Time discretisation 213
6.2 Brownian motion 214
6.2.1 Properties 216
6.2.2 Direct simulation 217
6.2.3 Interpolation and Brownian bridges 218
6.3 Geometric Brownian motion 221
6.4 Stochastic differential equations 224
6.4.1 Introduction 224
6.4.2 Stochastic analysis 226
6.4.3 Discretisation schemes 231
6.4.4 Discretisation error 236
6.5 Monte Carlo estimates 243
6.5.1 Basic Monte Carlo 243
6.5.2 Variance reduction methods 247
6.5.3 Multilevel Monte Carlo estimates 250
6.6 Application to option pricing 255
6.7 Summary and further reading 259
Exercises 260

Appendix A Probability reminders 263


A.1 Events and probability 263
A.2 Conditional probability 266
A.3 Expectation 268
A.4 Limit theorems 269
A.5 Further reading 270

Appendix B Programming in R 271


B.1 General advice 271
B.2 R as a Calculator 272
B.2.1 Mathematical operations 273
B.2.2 Variables 273
B.2.3 Data types 275
B.3 Programming principles 282
B.3.1 Don’t repeat yourself! 283
B.3.2 Divide and conquer! 286
B.3.3 Test your code! 290
B.4 Random number generation 292
B.5 Summary and further reading 294
Exercises 294
viii CONTENTS

Appendix C Answers to the exercises 299


C.1 Answers for Chapter 1 299
C.2 Answers for Chapter 2 315
C.3 Answers for Chapter 3 319
C.4 Answers for Chapter 4 328
C.5 Answers for Chapter 5 342
C.6 Answers for Chapter 6 350
C.7 Answers for Appendix B 366

References 375

Index 379
List of algorithms

Random number generation


alg. 1.2 linear congruential generator 2
alg. 1.13 inverse transform method 12
alg. 1.19 basic rejection sampling 15
alg. 1.22 envelope rejection sampling 19
alg. 1.25 rejection sampling for conditional distributions 22

Simulating statistical models


alg. 2.9 mixture distributions 47
alg. 2.11 componentwise simulation 49
alg. 2.22 Markov chains with discrete state space 53
alg. 2.31 Markov chains with continuous state space 58
alg. 2.36 Poisson process 61
alg. 2.41 thinning method for Poisson processes 65

Monte Carlo methods


alg. 3.8 Monte Carlo estimate 75
alg. 3.22 importance sampling 85
alg. 3.26 antithetic variables 89
alg. 3.31 control variates 93

Markov Chain Monte Carlo methods


alg. 4.2 Metropolis–Hastings method for continuous state space 110
alg. 4.4 Metropolis–Hastings method for discrete state space 113
alg. 4.9 random walk Metropolis 117
alg. 4.11 independence sampler 119
alg. 4.12 Metropolis–Hastings method with different move types 121
alg. 4.27 Gibbs sampler 142
alg. 4.31 Gibbs sampler for the Ising model 155
alg. 4.32 Gibbs sampler in image processing 158
alg. 4.36 reversible jump Markov Chain Monte Carlo 165
x LIST OF ALGORITHMS

Beyond Monte Carlo


alg. 5.1 basic Approximate Bayesian Computation 182
alg. 5.6 Approximate Bayesian Computation with regression 191
alg. 5.11 general bootstrap estimate 196
alg. 5.15 bootstrap estimate of the bias 200
alg. 5.18 bootstrap estimate of the standard error 202
alg. 5.20 simple bootstrap confidence interval 205
alg. 5.21 BCa bootstrap confidence interval 207

Continuous-time models
alg. 6.6 Brownian motion 217
alg. 6.12 Euler–Maruyama scheme 232
alg. 6.15 Milstein scheme 235
alg. 6.26 multilevel Monte Carlo estimates 251
alg. 6.29 Euler–Maruyama scheme for the Heston model 256
Preface

This is a book about exploring random systems using computer simulation and thus,
this book combines two different topic areas which have always fascinated me:
the mathematical theory of probability and the art of programming computers. The
method of using computer simulations to study a system is very different from the
more traditional, purely mathematical approach. On the one hand, computer exper-
iments normally can only provide approximate answers to quantitative questions,
but on the other hand, results can be obtained for a much wider class of systems,
including large and complex systems where a purely theoretical approach becomes
difficult.
In this text we will focus on three different types of questions. The first, easiest
question is about the normal behaviour of the system: what is a typical state of the sys-
tem? Such questions can be easily answered using computer experiments: simulating
a few random samples of the system gives examples of typical behaviour. The second
kind of question is about variability: how large are the random fluctuations? This
type of question can be answered statistically by analysing large samples, generated
using repeated computer simulations. A final, more complicated class of questions is
about exceptional behaviour: how small is the probability of the system behaving in
a specified untypical way? Often, advanced methods are required to answer this third
type of question. The purpose of this book is to explain how such questions can be
answered. My hope is that, after reading this book, the reader will not only be able
to confidently use methods from statistical computing for answering such questions,
but also to adjust existing methods to the requirements of a given problem and, for
use in more complex situations, to develop new specialised variants of the existing
methods.
This text originated as a set of handwritten notes which I used for teaching
the ‘Statistical Computing’ module at the University of Leeds, but now is greatly
extended by the addition of many examples and more advanced topics. The material
we managed to cover in the ‘Statistical Computing’ course during one semester is less
than half of what is now the contents of the book! This book is aimed at postgraduate
students and their lecturers; it can be used both for self-study and as the basis of
taught courses. With the inclusion of many examples and exercises, the text should
also be accessible to interested undergraduate students and to mathematically inclined
researchers from areas outside mathematics.
xii PREFACE

Only very few prerequisites are required for this book. On the mathematical side,
the text assumes that the reader is familiar with basic probability, up to and including
the law of large numbers; Appendix A summarises the required results. As a con-
sequence of the decision to require so little mathematical background, some of the
finer mathematical subtleties are not discussed in this book. Results are presented in a
way which makes them easily accessible to readers with limited mathematical back-
ground, but the statements are given in a form which allows the mathematically more
knowledgeable reader to easily add the required detail on his/her own. (For example,
I often use phrases such as ‘every set A ⊆ Rd ’ where full mathematical rigour would
require us to write ‘every measurable set A ⊆ Rd ’.) On the computational side, basic
programming skills are required to make use of the numerical methods introduced
in this book. While the text is written independent of any specific programming
language, the reader will need to choose a language when implementing methods
from this book on a computer. Possible choices of programming language include
Python, Matlab and C/C++. For my own implementations, provided as part of the
solutions to the exercises in Appendix C, I used the R programming language; a short
introduction to programming with R is provided in Appendix B.
Writing this book has been a big adventure for me. When I started this project,
more than a year ago, my aim was to cover enough material so that I could discuss
the topics of multilevel Monte Carlo and reversible jump Markov Chain Monte Carlo
methods. I estimated that 350 pages would be enough to cover this material but it
quickly transpired that I had been much too optimistic: my estimates for the final
page count kept rising and even after several rounds of throwing out side-topics and
generally tightening the text, the book is still stretching this limit! Nevertheless, the
text now covers most of the originally planned topics, including multilevel Monte
Carlo methods near the very end of the book. Due to my travel during the last year,
parts of this book have been written on a laptop in exciting places. For example, the
initial draft of section 1.5 was written on a coach travelling through the beautiful
island of Kyushu, halfway around the world from where I live! All in all, I greatly
enjoyed writing this book and I hope that the result is useful to the reader.
This book contains an accompanying website. Please visit www.wiley.com/
go/statistical_computing

Jochen Voss
Leeds, March 2013
Nomenclature

For reference, the following list summarises some of the notation used throughout
this book.

ø the empty set


N the natural numbers: N = {1, 2, 3, . . .}
N0 the non-negative integers: N = {0, 1, 2, . . .}
Z the integers: Z = {. . . , −2, −1, 0, 1, 2, . . .}
n mod m the remainder of the division of n by m, in the range 0, 1, . . . , m − 1
δkl the Kronecker delta: δkl = 1 if k = l and δkl = 0 otherwise
R the real numbers
x the number x ∈ R ‘rounded up’, that is the smallest integer greater than
or equal to x
(an )n∈N a sequence of (possibly random) numbers: (an )n∈N = (a1 , a2 , . . .)
O(·) the big O notation, introduced in definition
 3.16
 
[a, b] an interval of real numbers: [a, b] = x ∈ R  a ≤ x ≤ b
{a, b} the set containing a and b   
A the complement of a set: A = x  x ∈ / A .
A×B the Cartesian
 product
 of the sets A and B:
A × B = (a, b)  a ∈ A, b ∈ B
1 A (x) the indicator function of the set A: 1 A (x) = 1 if x ∈ A and 0 otherwise
(see section A.3)
U[0, 1] the uniform distribution on the interval [0, 1]
U{−1, 1} the uniform distribution on the two-element set {−1, 1}
Pois(λ) the Poisson distribution with parameter λ
X ∼μ indicates that a random variable X is distributed according to a probability
distribution μ
|S| the number of elements in a finite set S; in section 1.4 also the volume of
a subsets S ⊆ Rd
RS space of vectors where the components are indexed by elements of S (see
section 2.3.2)
R S×S space of matrices where rows and columns are indexed by elements of S
(see section 2.3.2)
1

Random number generation

The topic of this book is the study of statistical models using computer simulations.
Here we use the term ‘statistical models’ to mean any mathematical models which
include a random component. Our interest in this chapter and the next is in simu-
lation of the random component of these models. The basic building block of such
simulations is the ability to generate random numbers on a computer, and this is the
topic of the present chapter. Later, in Chapter 2, we will see how the methods from
Chapter 1 can be combined to simulate more complicated models.
Generation of random numbers, or more general random objects, on a computer
is complicated by the fact that computer programs are inherently deterministic: while
the output of computer program may look random, it is obtained by executing the
steps of some algorithm and thus is totally predictable. For example the output of a
program computing the decimal digits of the number

π = 3.14159265358979323846264338327950288419716939937510 · · ·

(the ratio between the perimeter and diameter of a circle) looks random at first sight,
but of course π is not random at all! The output can only start with the string of digits
given above and running the program twice will give the same output twice.
We will split the problem of generating random numbers into two distinct sub-
problems: first we will study the problem of generating any randomness at all, con-
centrating on the simple case of generating independent random numbers, uniformly
distributed on the interval [0, 1]. This problem and related concerns will be discussed
in Section 1.1. In the following sections, starting with Section 1.2, we will study the
generation of random numbers from different distributions, using the independent,
uniformly distributed random numbers obtained in the previous step as a basis.

An Introduction to Statistical Computing: A Simulation-based Approach, First Edition. Jochen Voss.


© 2014 John Wiley & Sons, Ltd. Published 2014 by John Wiley & Sons, Ltd.
2 AN INTRODUCTION TO STATISTICAL COMPUTING

1.1 Pseudo random number generators


There are two fundamentally different classes of methods to generate random
numbers:

(a) True random numbers are generated using some physical phenomenon which
is random. Generating such numbers requires specialised hardware and can
be expensive and slow. Classical examples of this include tossing a coin or
throwing dice. Modern methods utilise quantum effects, thermal noise in
electric circuits, the timing of radioactive decay, etc.
(b) Pseudo random numbers are generated by computer programs. While these
methods are normally fast and resource effective, a challenge with this
approach is that computer programs are inherently deterministic and therefore
cannot produce ‘truly random’ output.

In this text we will only consider pseudo random number generators.

Definition 1.1 A pseudo random number generator (PRNG) is an algorithm which


outputs a sequence of numbers that can be used as a replacement for an independent
and identically distributed (i.i.d.) sequence of ‘true random numbers’.

1.1.1 The linear congruential generator


This section introduces the linear congruential generator (LCG), a simple example of
a PRNG. While this random number generator is no longer of practical importance,
it shares important characteristics with the more complicated generators used in
practice today and we study it here as an accessible example. The LCG is given by
the following algorithm.

Algorithm 1.2 (linear congruential generator)


input:
m > 1 (the modulus)
a ∈ {1, 2, . . . , m − 1} (the multiplier)
c ∈ {0, 1, . . . , m − 1} (the increment)
X 0 ∈ {0, 1, . . . , m − 1} (the seed)
output:
a sequence X 1 , X 2 , X 3 , . . . of pseud random numbers
1: for n = 1, 2, 3, . . . do
2: X n ← (a X n−1 + c) mod m
3: output X n
4: end for
RANDOM NUMBER GENERATION 3

In the algorithm, ‘mod’ denotes the modulus for integer division, that is the value
n mod m is the remainder of the division of n by m, in the range 0, 1, . . . , m −
1. Thus the sequence generated by algorithm 1.2 consists of integers X n from the
range {0, 1, 2, . . . , m − 1}. The output depends on the parameters m, a, c and on the
seed X 0 . We will see that, if m, a and c are carefully chosen, the resulting sequence
behaves ‘similar’ to a sequence of independent, uniformly distributed random vari-
ables. By choosing different values for the seed X 0 , different sequences of pseudo
random numbers can be obtained.

Example 1.3 For parameters m = 8, a = 5, c = 1 and seed X 0 = 0, algorithm 1.2


gives the following output:

n 5X n−1 + 1 Xn

1 1 1
2 6 6
3 31 7
4 36 4
5 21 5
6 26 2
7 11 3
8 16 0
9 1 1
10 6 6

The output 1, 6, 7, 4, 5, 2, 3, 0, 1, 6, . . . shows no obvious pattern and could be con-


sidered to be a sample of a random sequence.

While the output of the LCG looks random, from the way it is generated it is
clear that the output has several properties which make it different from truly random
sequences. For example, since each new value of X n is computed from X n−1 , once the
generated series reaches a value X n which has been generated before, the output starts
to repeat. In example 1.3 this happens for X 8 = X 0 and we get X 9 = X 1 , X 10 = X 2
and so on. Since X n can take only m different values, the output of a LCG starts
repeating itself after at most m steps; the generated sequence is eventually periodic.
Sometimes the periodicity of a sequence of pseudo random numbers can cause
problems, but on the other hand, if the period length is longer than the amount of
random numbers we use, periodicity cannot affect our result. For this reason, one
needs to carefully choose the parameters m, a and c in order to achieve a long enough
period. In particular m, since it is an upper bound for the period length, needs to be
chosen large. In practice, typical values of m are on the order of m = 232 ≈ 4 · 109
and a and c are then chosen such that the generator actually achieves the maximally
possible period length of m. A criterion for the choice of m, a and c is given in the
following theorem (Knuth, 1981, Section 3.2.1.2).
4 AN INTRODUCTION TO STATISTICAL COMPUTING

Theorem 1.4 The LCG has period m if and only if the following three conditions
are satisfied:

(a) m and c are relatively prime;


(b) a − 1 is divisible by every prime factor of m;
(c) if m is a multiple of 4, then a − 1 is a multiple of 4.

In the situation of the theorem, the period length does not depend on the seed X 0
and usually this parameter is left to be chosen by the user of the PRNG.

Example 1.5 Let m = 232 , a = 1 103 515 245 and c = 12 345. Since the only
prime factor of m is 2 and c is odd, the values m and c are relatively prime and condition
(a) of the theorem is satisfied. Similarly, condition (b) is satisfied, since a − 1 is
even and thus divisible by 2. Finally, since m is a multiple of 4, we have to check
condition (c) but, since a − 1 = 1 103 515 244 = 275 878 811 · 4, this condition also
holds. Therefore the LCG with these parameters m, a and c has period 232 for every
seed X 0 .

1.1.2 Quality of pseudo random number generators


PRNGs used in modern software packages such as R or Matlab are more sophisticated
(and more complicated) than the LCG presented in Section 1.1.1, but they still share
many characteristics of the LCG. We will see that no PRNG can produce a perfect
result, but the random number generators used in practice, for example the Mersenne
Twister algorithm (Matsumoto and Nishimura, 1998), are good enough for most
purposes. In this section we will discuss criteria for the quality of the output of
general PRNGs, and will illustrate these criteria using the LCG as an example.

1.1.2.1 Period length of the output


We have seen that the output of the LCG is eventually periodic, with a period length
of at most m. This property that the output is eventually periodic is shared by all
PRNGs implemented in software. Most PRNGs used in practice have a period length
which is much larger than the amount of random numbers a computer program could
ever use in a reasonable time. For this reason, periodicity of the output is not a big
problem in practical applications of PRNGs. The period length is a measure for the
quality of a PRNG.

1.1.2.2 Distribution of samples


The output of almost all PRNGs is constructed so that it can be used as a replacement
for an i.i.d. sample of uniformly distributed random numbers. Since the output takes
RANDOM NUMBER GENERATION 5

values in a finite set S = {0, 1, . . . , m − 1}, in the long run, for every set A ⊆ S we
should have

  
# i  1 ≤ i ≤ N , Xi ∈ A #A
≈ , (1.1)
N #S

where #A stands for the number of elements in a finite set A.


Uniformity of the output can be tested using statistical tests like the chi-
squared test or the Kolmogorov–Smirnov test (see e.g. Lehmann and Romano, 2005,
Chapter 14).
One peculiarity when applying statistical tests for the distribution of samples to the
output of a PRNG is that the test may fail in two different ways: The output could either
have the wrong distribution (i.e. not every value appears with the same probability),
or the output could be too regular. For example, the sequence X n = n mod m hits
every value equally often in the long run, but it shows none of the fluctuations which
are typical for a sequence of real random numbers. For this reason, statistical tests
should be performed as two-sided tests when the distribution of the output of a PRNG
is being tested.

Example 1.6 Assume that we have a PRNG with m = 1024 possible output values
and that we perform a chi-squared test for the hypothesis

P (X i ∈ {64 j, 64 j + 1, . . . , 64 j + 63}) = 1/16

for j = 0, 1, . . . , 15.
If we consider a sample X 1 , X 2 , . . . , X N , the test statistic of the chi-squared test
is computed from the observed numbers of samples in each block, given by

  
O j = # i  64 j ≤ X i < 64( j + 1) .

The expected count for block j, assuming that (1.1) holds, is

E j = N · 64/1024 = N /16

for j = 0, 1, . . . , 15 and the test statistic of the corresponding chi-squared test is

15
(O j − E j )2
Q= .
j=0
Ej
6 AN INTRODUCTION TO STATISTICAL COMPUTING

For large sample size N , and under the hypothesis (1.1), the value Q follows a
χ 2 -distribution with 15 degrees of freedom. Some quantiles of this distribution are:

q 6.262 7.261 ··· 24.996 27.488

P(Q ≤ q) 0.025 0.05 ··· 0.95 0.975

Thus, for a one-sided test with significance level 1 − α = 95% we would reject the
hypothesis if Q > 24.996. In contrast, for a two-sided test with significance level
1 − α = 95%, we would reject the hypothesis if either Q < 6.262 or Q > 27.488.
We consider two different test cases: first, if X n = n mod 1024 for n =
1, 2, . . . , N = 106 , we find Q = 0.244368. Since the series is very regular, the value
of Q is very low. The one-sided test would accept this sequence as being uniformly
distributed, whereas the two-sided test would reject the sequence.
Secondly, we consider X n = n mod 1020 for n = 1, 2, . . . , N = 106 . Since this
series never takes the values 1021 to 1023, the distribution is wrong and we expect a
large value of Q. Indeed, for this case we get Q = 232.5864 and thus both versions
of the test reject this sequence.

Random number generators used in practice, and even the LCG for large enough
values of m, pass statistical tests for the distribution of the output samples without
problems.

1.1.2.3 Independence of samples


Another aspect of the quality of PRNGs is the possibility of statistical dependence
between consecutive samples. For example, in the LCG each output sample is a
deterministic function of the previous sample and thus consecutive samples are clearly
dependent. To some extent this problem is shared by all PRNGs.
An easy way to visualise the dependence between pairs of consecutive samples
is a scatter plot of the points (X i , X i+1 ) for i = 1, 2, . . . , N − 1. A selection of such
plots is shown in Figure 1.1. Figure 1.1(a) illustrates what kind of plot one would
expect if X i ∼ U[0, 1] was a true i.i.d. sequence. The remaining panels correspond
to different variants of the LCG. Figure 1.1(b) (using m = 81) clearly illustrates that
each X i can only be followed by exactly one value X i+1 . While the same is true for
Figure 1.1(c) and (d) (using m = 1024 and m = 232 , respectively), the dependence
is much convoluted there and in particular the structure of Figure 1.1(d) is visually
indistinguishable from the structure of Figure 1.1(a).
One method for constructing PRNGs where X i+1 is not a function of X i is to
use a function f (X i ) of the state, instead of the state X i itself, as the output of
the PRNG. Here, f : {0, 1, . . . , m − 1} → {0, 1, . . . , m̃ − 1} is a map where m̃ < m
and where the same number of pre-images is mapped to each output value. Then a
uniform distribution of X i will be mapped to a uniform distribution for f (X i ) but
the output f (X i+1 ) is not a function of the previous output f (X i ). This allows to
construct random number generators with some degree of independence between
consecutive values.
RANDOM NUMBER GENERATION 7

(a) (b)

1.0
1.0

0.8
0.8

0.6
0.6
Xi+1

Xi+1
0.4
0.4

0.2
0.2

0.0
0.0

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0
Xi Xi
(c) (d)

1.0
1.0

0.8
0.8
0.6

0.6
Xi+1

Xi+1
0.4

0.4
0.2

0.2
0.0

0.0

0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0

Xi Xi

Figure 1.1 Scatter plots to illustrate the correlation between consecutive outputs
X i and X i+1 of different pseudo random number generators. The random number
generators used are the runif function in R (a), the LCG with m = 81, a = 1 and
c = 8 (b), the LCG with m = 1024, a = 401, c = 101 (c) and finally the LCG with
parameters m = 232 , a = 1 664 525, c = 1 013 904 223 (d). Clearly the output in the
second and third example does not behave like a sequence of independent random
variables.

One way to quantify the independence of the output samples of a PRNG is the
following criterion.

Definition 1.7 A periodic sequence (X n )n∈N with values in a finite set S and
period length P is k-dimensionally equidistributed, if every possible subsequence
x = (x1 , . . . , xk ) ∈ S k of length k occurs equally often in the sequence X , that is if
  
N x = # i  0 ≤ i < P, X i+1 = xi , . . . , X i+k = xk

does not depend on x.

A random number generator is good, if the output is k-dimensionally equidis-


tributed for large values of k.
Discovering Diverse Content Through
Random Scribd Documents
from *, end with 1 plain, work a round loop, 3 chain, miss 2, and edge.
10th.—Edge; 3 chain, miss 2, 1 plain, *, 3 chain, miss 7, 11 plain in the round
loop, 3 chain, miss 7, 1 plain in the 5 chain, (miss 3, and 3 plain in the 5
chain 5 times), miss 9, 1 plain in the 5 chain; repeat from *, and end with
3 chain, miss 7, 11 plain as before, 3 chain, miss 7, 1 plain, 3 chain, miss
2, and edge.
11th.—Edge, *, 5 chain, miss 11, 1 plain, (5 chain, miss 1, and 1 plain 5
times), 5 chain, miss 11, 1 plain, work a round loop: repeat from *, and
end with 5 chain, miss 11, 1 plain, (5 chain, miss 1, and 1 plain 5 times
as before), 5 chain, miss 11, and edge.
12th.—Edge; 3 chain, miss 5, 1 plain in the 5 chain, *, (miss 3, and 3 plain in
the 5 chain 5 times), miss 3, 1 plain in the 5 chain, 3 chain, miss 7, 11
plain in the round loop, 3 chain, miss 7, 1 plain in the 5 chain; repeat
from *, and end with (miss 3, and 3 plain 5 times), miss 3, 1 plain, 3
chain, miss 5, and edge.
13th.—Edge; 3 chain, miss 2, 1 plain, *, 5 chain, miss 11, 1 plain, work a
round loop, 5 chain, miss 11, 1 plain, (5 chain, miss 1, and 1 plain 5
times): repeat from *, and end with 5 chain, miss 11, 1 plain, work a
round loop, 5 chain, miss 11, 1 plain, 3 chain, miss 2, and edge.
14th.—Edge; 5 chain, miss 3, 1 plain in the 3 chain, miss 3, *, 1 plain in the 5
chain, 3 chain, miss 7, 11 plain in the round loop, 3 chain, miss 7, 1 plain
in the 5 chain, (miss 3, and 3 plain in the 5 chain 5 times), repeat from *,
and end with miss 3, 1 plain, 3 chain, miss 7, 11 plain as before, 3 chain,
miss 7, 1 plain, miss 3, 1 plain, 3 chain, miss 3, and edge. Repeat the last
6 rows 6 times more; and to shape the Neck, decrease thus:—
1st row.—Work the pattern as the 11th row 3 times, then 3 chain, miss 11, (2
treble, 1 chain, 2 treble in one, for the edge,) turn back, leaving the
remaining stitches for the other side.
2d.—Work as the 10th row; end with 3 chain, miss 2, and edge.
3d.—Work as the 13th row: end with 5 chain, miss 9, and edge.
4th.—Work as the 12th row; end with miss 3, 1 plain, 3 chain, miss 2, and
edge.
5th.—Work as the 11th row; at the end omit the last round loop, and work 1
chain, miss 13, and edge.
6th.—Work as the 12th row; and end the same as that row.
7th.—Work as the 13th row; end with 5 chain, miss 11, 1 plain, 1 chain, miss
13, and edge.
8th.—Work as the 12th row; and end with miss 3, 1 plain, 3 chain, miss 2,
and edge: repeat these 8 rows twice more, working one pattern less each
repeat. For the other side, commence in the 78th stitch from the 1st side
—that is, in the side of the round loop, and decrease thus:—
1st.—2 treble, 1 chain, 2 treble, for the edge; then work as the 13th row 3
times, and end with 5 chain, miss 11, and edge.
2d.—Work as the 12th row, end with 5 chain, miss 7, and edge.
3d.—Work as the 11th row, end with 5 chain, miss 11, 1 plain, 3 chain, miss
2, and edge.
4th.—Work as the 14th row, and end with miss 3, 1 plain, 3 chain, miss 3, and
edge.
5th.—Edge; 1 chain, miss 13, 1 plain, *, then work as the 11th row, and end
the same as that row.
6th.—Work as the 12th row, and end the same as that row.
7th.—Edge; 1 chain, miss 13, 1 plain, *, work as the 11th row, end with 5
chain, miss 11, 1 plain, 3 chain, miss 2, and edge.
8th.—Work as the 14th row; end with miss 3, 1 plain, 3 chain, miss 5, and
edge: repeat these 8 rows twice more, working 1 pattern less each
repeat. Then work 50 chain stitches, turn, and on the chain stitches work
50 plain and along the neck work 5 chain, and 1 plain, in the 2 chain at
the beginning and end of the rows, repeating to the other point, and at
the end work 50 chain to correspond with the other side.
For the Edging.—1st row—4 chain, miss 4, 2 treble, repeat.
2nd, 3d, and 4th rows—1 chain, miss 1, 1 treble, repeat.
5th row—12 plain, *, 7 chain, 21 plain, repeat from * and end with 7 chain,
12 plain.
6th row—5 chain, miss 2, 1 plain, 5 chain, miss 3, 3 plain, 1 chain, miss 3, (2
treble, 2 chain, 2 treble, 3 chain, 2 treble, 2 chain, 2 treble, 3 chain, 2
treble, 2 chain, 2 treble; these 12 treble stitches are all to be worked in
the 7 chain of the last row,) then 1 chain, miss 3, 3 plain, 5 chain, miss 2,
1 plain, repeat, and end with 5 chain, miss 3, 1 plain.
7th row—1 chain, miss 3, 1 plain, *, 3 chain, miss 5, 1 plain, in the 5 chain,
miss 8, (2 treble, 2 chain, 2 treble; these 4 treble are to be worked in the
2 chain of the last row,) 3 chain miss 3, 1 plain in the 3 chain of last row,
3 chain, miss 3 (2 treble, 2 chain, 2 treble in the 2 chain as before), 3
chain, miss 3, 1 plain in the 3 chain, 3 chain, miss 3, (2 treble, 2 chain, 2
treble in the 2 chain as before,) miss 8, 1 plain in the 5 chain of the last
row, 3 chain, miss 5, 1 plain, in the 5 chain, repeat from *.
8th row—miss 1, 1 plain, 3 chain, miss 4, (3 treble, 2 chain, 3 treble; those 6
treble in the 2 chain of last row,) 3 chain, miss 4, 1 plain, repeat, end
miss 1, 1 plain.
9th row—miss 2, 1 plain, 3 chain, miss 5, (3 treble, 2 chain, 3 treble in the 2
chain of last row,) 3 chain, miss 5, 1 plain, repeat, end, miss 1, 1 plain.
10th row—miss 2, 3 plain, miss 3, 7 treble in the 2 chain, miss 3, 3 plain,
repeat.
CROCHET EDGING.
Taylor’s Crochet Thread, No. 10, or 12; Needle, No. 22, Bell Gauge.—Make a
chain of 792 stitches per yard, or 33 for each pattern. This Edging is worked
backwards and forwards, and will be one inch and a half deep.

1st row.—3 chain, miss 2, 1 plain: repeat, and end with 2 plain.
2d and 3d.—3 chain, miss 3, 1 plain in the 3 chain of the last row: repeat.
4th.—Miss 1, 3 plain in the 3 chain of the last row—repeat, and end 1 plain.
5th.—(3 chain, miss 2, 1 plain 5 times), 7 chain, miss 2, 1 plain, (3 chain, miss
2, 1 plain 5 times); repeat.
6th.—(Miss 1, 3 plain in the 3 chain 4 times), miss 2, 1 plain in the 3 chain,
miss 2, (5 chain, and 1 treble 7 times in the 7 chain of the 5th row), 3
chain, miss 2, 1 plain in the 3 chain, miss 2, (3 plain, and miss 1, 4 times
in the 3 chain): repeat.
7th.—2 plain, *, (3 chain, miss 2, 1 plain 3 times,) (3 chain, miss 3, and 1
treble in the 3 chain 8 times), 3 chain, miss 3, 1 plain, (3 chain, miss 2,
and 1 plain 4 times); repeat from *.
8th.—Miss 1, and 3 plain in the 3 chain: repeat, and end with 1 plain.
9th.—(3 chain, miss 2, and 1 plain twice), 3 chain, miss 5, 1 plain, (5 chain,
miss 2, and 1 plain 8 times), 3 chain, miss 5, 1 plain, (3 chain, miss 2,
and 1 plain twice): repeat.
10th.—(Miss 1, and 3 plain in the 3 chain twice), miss 2, 1 plain in the 3
chain, miss 2, (5 plain, and miss 1 in the 5 chain 8 times), miss 2, 1 plain
in the 3 chain, miss 2, (3 plain, and miss 1 in the 3 chain twice): repeat.
11th.—2 plain, *, 3 chain, miss 3, 1 plain, (2 chain, miss 3, 1 plain, 4 chain,
and 1 plain 8 times), 2 chain, miss 3, 1 plain, (3 chain, miss 2, and 1
plain twice): repeat from *.
12th.—(Miss 1, 3 plain in the 3 chain twice), (miss 2, 1 plain in the 2 chain,
miss 2, 4 treble in the 4 chain 8 times), miss 2, 1 plain in the 2 chain,
miss 2, 3 plain in the 3 chain, repeat, end with 2 plain.
13th.—5 chain, miss 5, 1 plain, (5 chain, miss 4, 1 plain in the centre of the 4
treble in the 12th row 8 times), 5 chain, miss 5, 1 plain—repeat.
14th.—Miss 1, 1 plain, 6 treble, 1 plain: these 8 stitches are worked in the 5
chain of the 13th row: repeat, and fasten off.
*** END OF THE PROJECT GUTENBERG EBOOK THE CROCHET
BOOK, FOURTH SERIES ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like