random number generators and monte carlo ...

72 downloads 0 Views 2MB Size Report
Oct 4, 2012 - statistical properties of a random sequence - like the equiprobability of all numbers ... the example, the increase of the world human population.
RANDOM NUMBER GENERATORS AND MONTE CARLO INTEGRATION THESIS SUBMITTED TO

M. J. P. ROHILKHAND UNIVERSITY In fulfillment of the requirement for the degree of

DOCTOR OF PHILOSOPHY *** 2012 *** Under the Supervision of Dr. Anil Kishore Saxena. Ex-Head : Mathematics Department Bareilly College, Bareilly By

( Saurabh Saxena ) House No 19: UDIT II Mahanagar, Bareilly Phone: +919997029495 [1]

Dedicated To My Parents

Smt. Meera Saxena & Shri Ashok Kumar Saxena

who gave proper direction to my life

[2]

***DECLARATION***

I do hereby affirm that the present research work in the thesis entitled "Random Number Generators And Monte Carlo Integration", has been carried out by me under the supervision of Dr. Anil Kishore Saxena and this work has not been submitted elsewhere for any other degree, diploma, fellowship or any other similar title.

Date: October 4, 2012

[ Saurabh Saxena ] Research Scholar

[3]

***CERTIFICATE***

This is to certify that Saurabh Saxena has carried out this work for Ph.D. thesis entitled "Random Number Generators And Monte Carlo Integration" under my supervision for more than three years. This thesis is a bonafide work and has not been submitted for a degree at any other university

Date: October 4, 2012

Dr. Anil Kishore Saxena Ex-Head Department of Mathematics Bareilly College, Bareilly

[4]

***ACKNOWLEDGEMENT***

It

is a matter of extra pleasure for me to record my indebtedness to my

supervisor Dr.Anil Kishore Saxena, Ex-Head: Department of Mathematics, Bareilly College Bareilly, who read the original manuscript and offered me his valuable guidance, constant inspiration, encouragement and criticism for its correction and improvement throughout the present work. I am profoundly indebted to Dr.P.Bera (Department of Mathematics IIT Roorkee) who enriched my academics and helped me to work out on this topic. I would express my thanks to Chairman Mr.Mukesh Gupta; M.D Dr.Pramod Rana; Group Director Dr.Swatantra Kumar; Dean Engineering Er.Santosh Khare, and Head-Department of Mathematics Dr.A.P.Singh of Future Group of Institutions Bareilly for their inspiration and moral support. I express my cordial gratitude to Er.Hemant Yadav, Director: P.P.G Institute of Engineering Bareilly, for his valuable advice and discussions. I am also thankful to my friends Amit Chandra, Dr.Vinod Kumar Verma, Abhishek Saxena and especially Ankur Mittal for offering their help and valuable suggestions. To my Family, must go the largest debt of gratitude for their generous and constant encouragement and understanding. Last but not the least, I would like to thank almighty for whatever I am and could able to do.

Date: October 4, 2012

[Saurabh Saxena] [5]

***PREFACE***

In the present work, various types of one dimensional, two dimensional and three dimensional integrals are taken into consideration and are evaluated by Monte Carlo method using RANDOM POINTS (self generated and online generated) as well as EQUISPACED POINTS. First chapter relates with the general introduction to randomness, random number, use of these numbers in mathematics. Available generators to generate these numbers are also depicted here. In second chapter two types of random numbers, one is self generated through a computer program and the other is through the online available software are discussed. These random numbers are having extensive application in further chapters to apply Monte Carlo Integration. To generate random numbers we first give a program and steps involved in its execution. We also give a full description of the online random number generator. The nomenclature of these files of random numbers is the last attribute of this chapter. Third chapter is devoted for testing of random numbers, generated in chapter 2.For this very purpose POKER TEST, RUN TEST, FREQUENCY TEST, FREQUENCY MONOBIT TEST and their characteristic are discussed in detail. Necessary computer programs for the calculations required in these test is also given.

[6]

Fourth chapter relates to Monte Carlo Method for Numerical Integration. We describe this method in detail including its origination and error involved. We show how this method is used in Centre Point Formula. We also discuss complete steps of Monte Carlo Integration for one dimensional Integral and its extension for multidimensional integration. Chapter five includes the calculation for one dimensional integral. We solve three different types of one dimensional integral by Monte Carlo Integration using different number of random points and also using equi-spaced points. A program for this calculation is also illustrated. Sixth chapter includes the calculation for two dimensional Integral. We solve three different types of two dimensional integral by Monte Carlo Integration using different number of random points and also using equi-spaced points. A program for this calculation is also illustrated. Chapter seven includes the calculation for three dimensional Integral. We solve two different types of three dimensional integral by Monte Carlo Integration using different number of random points and also using equi-spaced points. A program for this calculation is also illustrated. Eighth chapter is the last chapter of thesis which consists of conclusion of our research work.

[7]

***PROPOSED WORK***

Monte

Carlo

Method

has

taken

extensive

applications

in many fields using only random numbers generated by different and efficient random number generators. In every field the basic requirements for Monte Carlo method are 1.

Sample should be random.

2.

Sample size should be large.

The proposed research work deals with the use of Monte Carlo Method for Numerical Integration. So far the research work in this field only comprises the efficiency of random number generator and the randomness of these numbers and how the randomness of these numbers may be increased to get the best approximation of an integral using these numbers. Here we are proposing the same method for numerical integration but the approach takes a new idea of using the equispaced numbers instead of random numbers i.e. when we apply Monte Carlo method for numerical integration then instead of evaluating the function over the random numbers in the given range of integration we first divide the range of integration into n equal interval, obtain n equispaced points and then evaluate the integral over these points.

[8]

CHAPTER -1

INTRODUCTION

[9]

RANDOMNESS It was around 330 BC when Aristotle defined randomness just be associated with coincidences outside the system whatever one is looking at, while around 300 BC

Epicurus

defined

that

randomness

might

be

continually injected into the motion of all atoms. The presence of apparent randomness[36]in digit sequences of square roots, logarithms etc, and other mathematical constructs was presumably noticed by the 1600s, and by

[10]

the late 1800s it was being taken for granted. But the significance of this for randomness in nature was never recognized. In the late 1800s and early 1900s attempts to justify both statistical mechanics and probability theory led to ideas that perfect microscopic randomness might somehow be a fundamental feature of the physical world. One case where there was occasional discussion of origins of randomness from the early 1900s was fluid turbulence. Traditional mathematical models of natural systems are often expressed in terms of probabilities. In 1927 the first attempt was made to provide supply of random digits to researchers, when a table of 41,600 digits developed by Leonard H.C.Tippet was published by Cambridge machine

University

was

built

Press.

by

RAND

In

the

1950s,

Corporation

to

A

unique

generate

pseudorandom binary bits of 0 or 1 that were then used to generate one million random decimal digits. John Von Neumann[8,35]is

a

name

which

is

treated

as

an

early

pioneer in the development of pseudo random numbers.

Concept of randomness is having somewhat different meanings in different fields. As per the definition given by Aristotle randomness is the situation when a choice is to be made which has no logical element by which to make the choice. In general outcomes of a [11]

process which is assumed to be random, do not follow any

describable

deterministic

pattern,

but

follow

a

probability distribution. For example, the rolling of a die in natural state of affairs produce random results as one cannot compute before throwing the die what digit

will

appearing

be

on

any

the

digit

top, may

but

be

the

probability

calculated.

of

Factually

speaking random numbers should not be generated with a method

chosen

at

random.

The

generation

of

random

numbers is too important to be left to chance[18].As per John Von Neumann, any one who considers arithmetical methods of producing random digits is, of course, in a state of sin. As

far

as

the

best

example

as

a

source

of

randomness is considered, the roulette having a rolling ball may be considered , because behavior of the ball is unpredictable and do not follow any deterministic pattern. types

Basically

randomness

(i) TRUE-RANDOMNESS

is

defined

as

of

two

(ii) PSEUDO-RANDOMNESS

TRUE-RANDOMNESS If the randomness is generated with the help of the phenomenon happening in the environment then it is [12]

called True randomness and the numbers attaining such type of randomness are known as true random numbers.

No mater which physical phenomenon is used, the process

of

generating

true

random

numbers

involves

little, unpredictable changes in the data. For example, HotBits

uses

small

variations

in

the

delay

between

happening of radioactive decay, and RANDOM.ORG[9] uses small deviation in the amplitude of atmospheric noise and many more examples are there to get true randomness into a computer. So far the best physical phenomenon for

the

source.

purpose The

dot

of

true

of

time

randomness when

a

is

radioactive

radioactive

source

decays is completely unpredictable .This approach is used

by

the

Hot-Bits

service

at

Fourmi

lab

in

Switzerland.

Completely category

of

randomized true

design

random

number

falls

within

the

generation.

The

generation of true random numbers outside the computer environment is based on the theory of entropy. Sources of

entropy

include

nuclear

conditions.

HotBits

uses

decay

and

radioactive

atmospheric

decay,

while

Random.org uses radio noise to generate randomness.

[13]

Another common entropy source is the behavior of human users of the system, if such users exist. While humans are not considered good randomness generators upon request, they generate random behavior quite well in the context of playing mixed strategy games. The utilization of human gameplay entropy for randomness generation was studied by Ran Halprin and Moni Naor.

PSEUDO-RANDOMNESS Randomness generated by any deterministic pattern with

the

randomness

help and

of the

the

system

numbers

is

called

attaining

such

Pseudotype

of

randomness are known as Pseudo Random Numbers[32]. A process that appears to be random but it is not, is said to be pseudorandom process .Statistical randomness is a typical exhibition of pseudorandom sequences while it is generated by an entirely deterministic process. A pseudo-random variable[24,26] is a variable created by a deterministic

procedure

which

takes

random

bits

as

input. Most

computer

programming

languages

include

functions or library routines that purport to be random number generators. They are often designed to provide a [14]

random

byte

or

word,

or

a

floating

point

number

uniformly distributed between 0 and 1. Such library functions often have poor statistical properties and some will repeat patterns after only tens of thousands of

trials.

They

are

often

initialized

using

a

computer's real time clock as the seed. These functions may provide enough randomness for certain tasks (for example video games) but are unsuitable where highquality

randomness

is

required,

such

as

in

cryptographic applications[41], statistics or numerical analysis. Much higher quality random number sources are available on most operating systems.

RANDOM NUMBERS Although it may look simple at first sight to give a definition of what a random number is, it proves to be quite difficult in practice. A random number is a number

generated

unpredictable, reliably

by

and

a

which

reproduced.

process, cannot

This

whose be

sub

definition

outcome

is

sequentially works

fine

provided that one has some kind of a black box - such a black box is usually called a random number generator that fulfills this task. However, if one were to be given

a

number,

it

is

simply [15]

impossible

to

verify

whether it was produced by a random number generator or not[18]. In order to study the randomness of the output of such a generator, it is hence absolutely essential to consider sequences of numbers. In the case of a finite sequence of numbers[23], it is formally impossible to verify whether it is random or not. It is only possible to check that it shares the statistical properties of a random sequence - like the equiprobability of all numbers - but this a difficult and tricky task. To illustrate this, let us for example consider

a

binary

random

number

generator

producing

sequences of ten bits. Although it is exactly as likely as any other ten bits sequences, 1 1 1 1 1 1 1 1 1 1 does look less random than 0 1 1 0 1 0 1 0 0 0.

In order to cope with this difficulty, definitions have been proposed to characterize "practical" random number sequences. According to Knuth, a sequence of random numbers is a sequence of independent numbers with

a

specified

distribution

and

a

specified

probability of falling in any given range of values. For

Schneider,

it

is

a

sequence

that

has

the

same

statistical properties as random bits, is unpredictable and cannot be reliably reproduced. A concept that is [16]

present in both of these definition and that must be emphasized

is

the

fact

that

numbers

in

a

random

sequence must not be correlated. Knowing one of the numbers of a sequence must not help predicting the other ones. Whenever random numbers are mentioned in the rest of this paper, it will be assumed that they fulfill these "practical" definitions.

RANDOMNESS AND MATHEMATICS In mathematics statistical approaches are used to explain

the

distribution

theory of

a

of set

probability of

empirical

and

probability

observations

in

large supply of random numbers. For the purposes of simulation we often need to find means to generate random

numbers

on

demand.

Random

numbers

are

of

fundamental need for Monte Carlo Integration[13]. One should not be confused between randomness and unpredictability which seems to be interconnected in ordinary usage, but separate in mathematics[4].Just for the example, the increase of the world human population is quite predictable approximately, but total births [17]

and

deaths

individually

cannot

be

accurately

calculated.

RANDOM NUMBER GENERATOR A

random

abbreviated

as

number

generator

RNG

a

is

which

computational

is or

often

physical

device designed to generate a sequence of numbers or symbols that lack any pattern, i.e. they appear random. Hardware-based systems for random number generation are widely

used,

but

often

fall

short

of

this

goal[18,30],though they may meet some of the statistical tests for randomness intended to ensure that they do not have any easily discernible patterns. Methods for generating random results have existed since ancient times, including dice, coin flipping, the shuffling of playing cards. The many applications of randomness have led to many different methods for generating random data. These methods may vary as to how unpredictable or statistically random they are, and how quickly they can generate

random

computational

numbers.

random

Before

number

the

generators,

advent

of

generating

large amounts of sufficiently random numbers (important in statistics) required a lot of work. Results would sometimes be collected and distributed as random number tables. A growing number of government-run lotteries, and

lottery

games,

are

using [18]

RNGs

instead

of

more

traditional drawing methods, such as using ping-pong or rubber balls. A

computational

or

physical

device

which

is

designed to generate a sequence of numbers following the

non-deterministic

number

generator.

The

pattern two

is

types

known

as

a

random

of

random

number

generator are described as follows.

PSEUDO-RANDOM NUMBER GENERATOR PRNGs

are

algorithms

that

use

the

set

of

mathematical statements or simply pre calculated tables to generate sequence of numbers that come into view as random. PRNGs[25] are efficient, they can produce ample of

numbers

generated

in

short

time,

and

sequence

of

numbers

can be regenerated at a later date if the

seed (starting point) of the sequence is known. The thought of using atmospheric noise to generate random numbers came up while framing a prototype of an online gambling system. Pseudo Random Number Generator are often initialized using a real time clock of a computer,

as

the

seed.

Randomness

often

obtained

through these functions may be suitable for certain [19]

tasks

(for

example

video

games)

but

are

unsuitable

where high-quality randomness is needed, such as in cryptographic

applications,

statistics

or

numerical

analysis. As an example of generating random numbers from physical processes was the Atari 8-bit computers, in which electronic noise from an analog circuit is used to generate true random numbers. Other examples are of radioactive decay, thermal noise, shot noise and clock drift. An outline to different type of pseudo random number generator is given below. The

generation

important While

and

of

common

cryptography

pseudo-random task

and

in

numbers

computer

certain

is

an

programming.

numerical

algorithms

require a very high degree of apparent randomness, many other

operations

only

need

a

unpredictability.

Some

simple

modest

amount

of

examples

might

be

presenting a user with a "Random Quote of the Day", or determining which way a computer-controlled adversary might

move

in

randomness

are

algorithms

and

a

computer

also in

game.

closely

creating

Weaker

associated

amortized

forms with

searching

of hash and

sorting algorithms. Some applications which appear at [20]

first sight to be suitable for randomization are in fact not quite so simple. For instance, a system that 'randomly' selects music tracks for a background music system must only appear to be random; a true random system

would

have

no

restriction

on

the

same

item

appearing two or three times in succession. There are a couple of methods to generate a random number based on a probability density function. These methods involve transforming a uniform random number in way[26].

some

Because

of

this,

these

methods

work

equally well in generating both pseudo-random and true random

numbers.

One

method,

called

the

inversion

method, involves integrating up to an area greater than or

equal

to

the

random

number

(which

should

be

generated between 0 and 1 for proper distributions). A second method, called the acceptance-rejection method, involves choosing an x and y value and testing whether the function of x is greater than the y value. If it is, the x value is accepted. Otherwise, the x value is rejected and the algorithm tries again. Some

frequently

used

pseudo

generators[41]are listed as below

[21]

random

number

MID SQUARE GENERATOR It

is

one

of

the

earliest

methods

used

for

generation of random numbers. In this method we begin with an n-digit number (called seed), then we square it and take n-digits in the middle as the next number. For example let the seed number be 5673, after squaring we get 32182929. After removing two first and two last digits from it we get the next random number as 1829. Again

repeating

the

same

process

we

get

the

next

numbers in the same style.

LINEAR CONGRUENTIAL GENERATOR Linear congruential generator is the most common method for generating pseudorandom numbers which was invented in 1951 by Derrick H. Lehmer(1905-1991). In 1991, George Marsaglia and Arif Zaman at Florida State University invented a random number generator capable of generating a chain of pseudorandom numbers with a period of at least 10250. Linear Congruential Generator was first suggested by Lehmer. According to him it is an easily applicable method of generating pseudorandom sequences. The sequence of pseudorandom numbers < rn> is given by [22]

rn+1= ( a rn + b ) modulo m where m (modulo), a (multiplier) and b (increment) are magic integers chosen by theoretical and empirical analysis of the sequence generated and r0 is an initial non-random seed value.

ARITHMATIC CONGRUENTIAL GENERATOR Another kind of psudo-random number generator is the arithmetic congruential generator whose algorithm is given by rn+1= ( rn-1 + rn ) modulo m For example if Then

r1 =

9 , r2 = 13 and m = 17

r3 = ( 9 + 13 ) mod 17 = 5 r4 = (13 + 5 )

mod 17

= 1

……….etc . and so on the process will go on.

COMBINED CONGRUENTIAL GENEATOR The simulations of complex computer networks, in which

thousands

program,

require

of

users

are

substantially [23]

executing longer

hundreds periods.

of One

method of meeting such a demand is to combine two or more multiplicative congruential generators in such a way that the combined generator has good statistical properties and has a longer period. If ri.1 , ri.2 , ri.3 ,.........ri.k are the ith output from

k

different

multiplicative

congruential

generators, where the jth generator has prime modulus mj and the multiplier aj chosen so that the period is mj-1 then the combined generator will give

With

TEST OF RANDOMNESS Various sequence

statistical

to

attempt

to

tests

can

compare

be

applied

and

to

evaluate

a

the

sequence to a truly random sequence. Randomness is the property of a random sequence that can be characterized and

described

in

terms

of

Independence

and

uniform

distribution[25] of the numbers. The likely outcome of statistical

tests,

when

applied

to

a

truly

random

sequence, is known a priori. There are so many possible [24]

statistical

tests,

absence

a

of

each

"pattern"

assessing which,

the

if

presence

detected,

or

would

indicate that the sequence is nonrandom. Because there are so many tests for judging whether a sequence is random

or

not,

no

specific

finite

set

of

tests

is

deemed "complete." In addition, the results of statistical testing must be interpreted with some care and caution to avoid incorrect conclusions about a specific generator. A

test[1]is

statistical

formulated

to

test

a

specific null hypothesis (H0). For the present research work,

the

null

hypothesis

under

test

is

that

the

sequence being tested is random. Associated with this null

hypothesis

is

the

alternative

hypothesis

(Ha),

which, for this present work, is that the sequence is not

random.

For

each

applied

test,

a

decision

or

conclusion is derived that accepts or rejects the null hypothesis i.e., whether the generator is (or is not) producing random values, based on the sequence that was produced. For

each

test,

a

relevant

randomness

statistic

must be chosen and used to determine the acceptance or rejection of the null hypothesis. Under an assumption [25]

of randomness, such a statistic has a distribution of possible values. A theoretical reference distribution of

this

statistic

under

the

null

hypothesis

is

determined by mathematical methods. From this reference distribution,

a

critical

value

is

determined

(typically, this value is "far out" in the tails of the distribution, say out at the 95 % or 99 % point). During a test, a test statistic value is computed on the data (the sequence being tested). This test statistic value is compared to the critical value. If the test statistic value exceeds the critical value, the

null

hypothesis

Otherwise,

the

for

null

randomness

hypothesis

is

(the

rejected. randomness

hypothesis) is not rejected (i.e., the hypothesis is accepted). In

practice,

hypothesis

testing

the

reason

works

is

that that

statistical

the

reference

distribution and the critical value are dependent on and

generated

under

a

tentative

assumption

of

randomness. If the randomness assumption is, in fact, true

for

the

data

at

hand,

then

the

resulting

calculated test statistic value on the data will have a very

low

probability

(e.g.,0.05% [26]

or

0.01

%)

of

exceeding the critical value. On the other hand, if the calculated

test

statistic

value

does

exceed

the

critical value (i.e., if the low probability event does in

fact

occur),

then

from

a

statistical

hypothesis

testing point of view, the low probability event should not occur naturally. Therefore,

when

the

calculated

test

statistic

value exceeds the critical value, the conclusion is made

that

the

original

assumption

of

randomness

is

suspect or faulty. In

this

case,

statistical

hypothesis

testing

yields the following conclusions: reject H0 randomness) and accept Ha (non-randomness).

MONTE CARLO METHOD The Monte Carlo method is a method for solving problems using random variables. It is a powerful tool in many fields of mathematics, physics and engineering. The algorithms[12]based on this method give statistical estimates for any linear functional of the solution by performing random sampling of a certain random variable whose

mathematical

expectation

functional. [27]

is

the

desired

The basis of the Monte Carlo method[27], along with its name, was formed during World War II in Los Alamos when the atom bomb was developed. On the basis of this method Monte Carlo integration becomes a mathematical technique random

that

relies

variables

and

on

statistical

random

sampling

properties to

of

numerically

estimate integrals. It is well suited for the highdimensional integrals[31].Monte Carlo methods estimate integrals or other quantities that can be expressed as an

expectation

by

averaging

the

results

of

a

high

number of statistical trials. Computers are ideal for performing such trials, and the appearance of faster and

faster

computers

has

driven

the

wide

spread

application of Monte Carlo methods today. This change towards

stochastic

simulation

with

computers

was

adequately described by Schneider. "It is interesting to note that computers have led to

a

novel

revolution

in

mathematics.

Whereas

previously an investigation of a random process was regarded as being complete as soon as it was reduced to an analytic description, nowadays it is convenient in many cases to solve an analytic problem by reducing it to a corresponding random process and then simulating that process"[33]. [28]

CHAPTER -2

RANDOM NUMBERS DATA FILES

[29]

The

basic

requirement

of

MONTE

CARLO

TECHNIQUE[15]for numerical integration is a large sample of random numbers in the range of integration. As far as the sample size is concerned, we partially agree with the requirement of large number of nodes( points in the range of integration )as we shall observe later that as the number of nodes increases the evaluated value of integral comes to be closer and closer to the exact value. But we completely disapprove the random character

of

nodes.

Our

rejection

[30]

of

randomness

is

specifically

for

numerical

integration

and

not

for

other applications of MONTE CARLO TECHNIQUE and it will be completely established in next coming chapters. For this purpose we shall first generate the random numbers with the help of TIMER and RANDOMIZE statements of GWBASIC in a program that follows PROG2_1.BAS 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260

CLS : KEY OFF D$ = DATE$: T$ = TIME$ V = TIMER: V$ = STR$(V): V1$ = LEFT$(V$,5) : DIM N(5000) LOCATE 6,15 : PRINT "Choice 1 for 1000 numbers file" LOCATE 8,15: PRINT "Choice 2 for 2000 numbers file" LOCATE 10,15: PRINT "Choice 3 for 3000 numbers file" LOCATE 12,15: PRINT "Choice 4 for 4000 numbers file" LOCATE 14,15: PRINT "Choice 5 for 5000 numbers file" LOCATE 18,15: INPUT "Type your Choice Number....( 1 to 5 )";CHOICE IF CHOICE < 0 OR CHOICE > 5 THEN 110 ELSE 130 LOCATE 18,15 : PRINT " GOTO 90 F$ = "H:Mydata"+ RIGHT$(STR$(CHOICE),1) + ".dat" OPEN F$ FOR OUTPUT AS #1 RANDOMIZE(V) FOR I = 1 TO CHOICE*1000 R$ = STR$(RND) N(I)= VAL(R$) 'IF VAL(LEFT$(R$,2))= 0 THEN PRINT R$, WRITE #1,N(I):COUNT = COUNT + 1 NEXT I CLS:PRINT:PRINT TAB(25): PRINT "Name of Data File ", F$ PRINT:PRINT:PRINT TAB(25): PRINT "NUMBER of Data ",,COUNT PRINT:PRINT: PRINT TAB(25)"DATE of creation ",D$ PRINT:PRINT: PRINT TAB(25)"TIME of creation ",T$ CLOSE #1:END

[31]

"

On execution of this program, we are prompted as Choice 1 for 1000 numbers file Choice 2 for 2000 numbers file Choice 3 for 3000 numbers file Choice 4 for 4000 numbers file Choice 5 for 5000 numbers file Type your Choice Number.....(1 to 5) ? If we input 1 as the choice number then the output is as below Name of Data File

H:Mydata1.dat

NUMBER of Data

1000

DATE of creation

05-17-2012

TIME of creation

10:23:54

In this way a data file of 1000 random numbers is being created in drive H by the name of "Mydata1.dat". If we again execute this program with same input 1 for

choice

then

the

already

created

data

file

"Mydata1.dat" in H drive will be omitted and a new data file of 1000 random numbers will be created in drive H by the same name "Mydata1.dat".The input 2 for the choice variable will create a data file of 2000 random numbers by the name of "Mydata2.dat" in H drive. If we again execute this program for the choice 2 then the [32]

file "Mydata2.dat" which was created just now will be omitted and a new file by the name of "Mydata2.dat" will be created i.e. execution of this program for the file which is already present will remove the existing file and a new file with the same name will be formed. Just to examine the nature of data files ( test of

randomness,

random

number

Poker's

test

created

by

and this

run

test

program

it

etc

)of

becomes

essential to retain the same files by other name.On account of this fact we have executed this program thrice (as we have to use them for three integrals ) for each choice selection and retained them by other names. For choice 1 on first time execution File created

"H:Mydata1.dat"

New name awarded

"H:Int_1_1.dat"

For choice 1 on second time execution File created

"H:Mydata1.dat"

New name awarded

"H:Int_2_1.dat"

For choice 1 on third time execution File created

"H:Mydata1.dat"

New name awarded

"H:Int_3_1.dat"

Each of the above noted files will contain 1000 random numbers. [33]

Similarly for other choice selection of 2,3,4 and 5 we shall get three files for each choice selection. For A = 1,2,3

and B = 1,2,3,4,5

we follow that the file "H:Int_A_B.DAT" will contain B1000

random

numbers

and

it

will

be

used

for

the

evaluation of Ath Integral. Out of the above noted fifteen data files we may require any single data or a series of data from any of these files. For this purpose we now give a program in GWBASIC as below PROG2_2.BAS 10 20 30 40 50 60 70 80 90 100 110 120 130

CLS : KEY OFF : CLEAR LOCATE 5,5: PRINT "Select the Random Data file......" LOCATE 12,5 : PRINT "Choice 1.......Data File of 1000 Random Numbers" LOCATE 14,5 : PRINT "Choice 2.......Data File of 2000 Random Numbers" LOCATE 16,5 : PRINT "Choice 3.......Data File of 3000 Random Numbers" LOCATE 18,5 : PRINT "Choice 4.......Data File of 4000 Random Numbers" LOCATE 20,5 : PRINT "Choice 5.......Data File of 5000 Random Numbers" LOCATE 22,5 : INPUT "Give your Choice Number....",A$ :A=VAL(A$) IF A 5 THEN 100 ELSE 110 LOCATE 22,5 : PRINT " ":GOTO 80 CLS : LOCATE 5,5 : PRINT "Select the Integral..." LOCATE 12,5 : PRINT "Choice 1.......File used for First Integral" LOCATE 14,5 : PRINT "Choice 2.......File used for Second Integral"

[34]

140 150 160 170 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360

LOCATE 16,5 : PRINT "Choice 3.......File used for Third Integral" LOCATE 20,5 : INPUT "Give your Choice Number....",B$ :B=VAL(B$) IF B 3 THEN 170 ELSE 180 F$="h :"+"Int_"+B$+"_"+A$+".dat": DIM N(A*1000):I=1 OPEN F$ FOR INPUT AS #1 INPUT #1,X : N(I)=X : COUNT=COUNT+1 : I=I+1 IF NOT EOF(1) THEN 200 ELSE 220 CLOSE #1 CLS : LOCATE 5,5 : PRINT"Give your selection....." LOCATE 10,5 : PRINT"Type 1 to view a single data" LOCATE 12,5 : PRINT"Type 2 to view data in given range" LOCATE 18,5 : INPUT "Type your choice number.........."; ANS IF ANS 2 THEN 280 ELSE 290 LOCATE 18,5 : PRINT "Type your choice number.......... " : GOTO 260 IF ANS =1 THEN 300 ELSE 320 CLS : LOCATE 12,5 : INPUT " Give data number "; D LOCATE 14,5 : PRINT " Required Random Number is ";N(D):GOTO 360 CLS : LOCATE 12,5 : INPUT " Give starting data number ";D1 LOCATE 14,5 : INPUT " Give ending data number ";D2 LOCATE 16,5 : PRINT"Your Random Numbers are..." LOCATE 17,1 : FOR I= D1 TO D2 : PRINT USING ".####";N(I),:NEXT I END

As a result of execution of this program we are first prompted as Select the Random Data File..... Choice 1.....Data File of 1000 Random Numbers Choice 2.....Data File of 2000 Random Numbers Choice 3.....Data File of 3000 Random Numbers Choice 4.....Data File of 4000 Random Numbers Choice 5.....Data File of 5000 Random Numbers Give your Choice Number....? [35]

Here we have to input our choice number which can be 1,2,3,4 or 5 according as the size of data file required to view is 1000,2000,3000,4000 or 5000. Let the choice is 2 (for 2000 Random Numbers) After that the next prompt message is Select the Integral.... Choice 1.....File used for First Integral. Choice 2.....File used for Second Integral. Choice 3.....File used for Third Integral. Give your Choice Number..... This choice number will decide the integral under consideration. Let

the

choice

number

selected

this

time

is

1

which is corresponding to the first Integral. The last prompt of this session is Give your selection.... Type 1 to view a single data Type 2 to view data in a given range Type your choice number......? Selection of 1 will ask you the data number in the file "H:Int_1_2.dat".Let 346 is required data number in this file of 2000 numbers then, our ultimate output of the program is Required Random Number is .2270722 Selection of 2 will ask you [36]

Give the starting data number... Let it be 569 then Give the ending data number .... Let it be 581 then output is Your Random Numbers are.... .1060 .2012 .1481 .7971 .8186 .5364 .9739 .0761 .9635 .4065 .6989 .1452 .2729 It should be noted that for neat and clean display of these data the required data range is rounded off to four decimal places by PRINT USING statement. Apart

from

the

generation

of

random

numbers

through computer programs in GWBASIC we now switch over to

online

generation

of

random

numbers.

For

this

purpose we searched many sites which provide random numbers instantly. Out of them three sides which are taken under consideration are

1. RANDOM.ORG (http://www.random.org/decimal-fractions/) RANDOM.ORG offers true random numbers to anyone on the

Internet.

noise,

which

pseudo-random

The for

randomness many

number

comes

purposes algorithms

is

from

atmospheric

better

typically

than used

the in

computer programs. People use RANDOM.ORG for holding [37]

drawings, lotteries and sweepstakes, to drive games and gambling sites, for scientific applications and for art and music. The service has existed since 1998 and was built and is being operated by Mads Haahr of the School of Computer Science and Statistics at Trinity College, Dublin in Ireland. As

of

today,

RANDOM.ORG

has

generated

1.12

trillion random bits for the Internet community. The numbers used in our work generated by random.org are obtained as fractional values upto four decimal places between 0 and 1 and used directly in our work.

2. RESEARCH RANDOMIZER (http://www.randomizer.org/form.htm) RESEARCH RANDOMIZER is the site which is designed for researchers and students who want a quick way to generate

random

numbers

experimental

conditions.

used

wide

in

psychology

a

or

Research

variety

experiments,

assign

of

participants

Randomizer

situations,

medical

trials,

can

to be

including and

survey

research. The program uses a JavaScript random number generator to produce customized sets of random numbers. Since its release in 1997, Research Randomizer has been used to generate number sets over 15.8 million [38]

times.

This

service

is

part

of

Social

Psychology

Network and is fast, free, and runs with any recent web browser as long as JavaScript isn't disabled. The

numbers

used

in

our

work

generated

by

randomizer.org are obtained as integral values of four digits between 0 and 9999 and then divided by 10000 to obtain fractional values between 0 and 1 and then they are used in our work.

3. GRAPH PAD Software (http://www.graphpad.com/quickcalcs/randomn1.cfm) Graph-Pad Software has been dedicated to creating software exclusively for the international scientific community

Since

1984.

Created

by

scientists

for

scientists, its intuitive programs provide researchers worldwide with the tools they need to simplify data analysis, statistics and graphing. It provides free service as quick calcs which is an online calculator for scientist and researchers to generate random numbers. The

numbers

used

in

our

work

generated

by

graphpad.com are obtained as integral values of four digits between 0 and 9999 and then divided by 10000 to [39]

obtain fractional values between 0 and 1 then they are used in our work.

NOMENCLATURE OF THE DATA FILES Five data files of random numbers from each of the above noted sites are saved as under F ile N a m e

S it e

S ize

o lr r 1 .d a t

R e s e a r c h R a n d o m iz e r

1000

o lr r 1 .d a t

R e s e a r c h R a n d o m iz e r

2000

o lr r 1 .d a t

R e s e a r c h R a n d o m iz e r

3000

o lr r 1 .d a t

R e s e a r c h R a n d o m iz e r

4000

o lr r 1 .d a t

R e s e a r c h R a n d o m iz e r

5000

o lr o r g 1 .d a t

R a n d o m .O r g

1000

o lr o r g 2 .d a t

R a n d o m .O r g

2000

o lr o r g 3 .d a t

R a n d o m .O r g

3000

o lr o r g 4 .d a t

R a n d o m .O r g

4000

o lr o r g 5 .d a t

R a n d o m .O r g

5000

o lg p 1 .d a t

G ra p h Pa d

1000

o lg p 2 .d a t

G ra p h Pa d

2000

o lg p 3 .d a t

G ra p h Pa d

3000

o lg p 4 .d a t

G ra p h Pa d

4000

o lg p 5 .d a t

G ra p h Pa d

5000

T a b le 2 .1

As far as the notation and nomenclature of these files are concerned it should be noted ol stands for ONLINE gp stands for GRAPH PAD rorg stands for RANDOM.ORG rr stands for RESEARCH RANDOMIZER [40]

and the last numeral n stands for the size of the file which is n multiplied by 1000. All the random numbers in the above noted fifteen files are distinct and have no correlation with each other. In order to view the data of any of the above fifteen

files,

we

present

the

following

GWBASIC

program. PROG2_3.BAS 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230

CLS: KEY OFF LOCATE 5,10 : PRINT "Choice 1 for file for RESEARCH RANDOMIZER data file" LOCATE 7,10 : PRINT "Choice 2 for file for RANDOM.ORG data file" LOCATE 9,10 : PRINT "Choice 3 for file for GRAPH PAD data file" LOCATE 15,10 : INPUT "Type your Choice Number ";A IF A < 0 OR A > 3 THEN 70 ELSE 80 LOCATE 15,10 : PRINT" ":GOTO 50 ON A GOTO 90 ,100 , 110 F$= "olrr":GOTO 120 F$= "olrorg":GOTO 120 F$= "olgp" CLS:LOCATE 5,10 : PRINT "Type 1 for 1000 data" LOCATE 7,10 : PRINT "Type 2 for 2000 data" LOCATE 9,10 : PRINT "Type 3 for 3000 data" LOCATE 11,10 : PRINT "Type 4 for 4000 data" LOCATE 13,10 : PRINT "Type 5 for 5000 data" LOCATE 15,10 : INPUT "Give size number ";A$ IF VAL(A$) < 0 OR VAL(A$) > 5 THEN 190 ELSE 200 LOCATE 15,10 : PRINT " ":GOTO 170 F$=F$+A$+".dat": F$="H:"+F$ OPEN F$ FOR INPUT AS #1 INPUT #1,X PRINT USING ".####";X,

[41]

240 250

IF NOT EOF(1) THEN 220 CLOSE #1:END

On execution of this program we shall encounter with two sessions of input. In first session the choice number will decide the online site from which the data file is created. Corresponding to choice 1 the online site is

RESEARCH RANDOMIZER Corresponding to choice 2 the online site is

RANDOM.ORG Corresponding to choice 3 the online site is

GRAPH PAD In the second session of input the choice number will decide the size of the data file created. The input N (such that 0 < N < 6) will be for the file which contains N multiplied by 1000 data. In

the

final

stage

of

the

program

we

get

the

required output of all the data of required file. It should be noted that these data are displayed on screen rounded

upto

four

decimal

statement.

[42]

places

by

PRINT

USING

CHAPTER -3 TESTS for randomness of data files

[43]

The

first

tests

for

random

numbers

were

published by M.G. Kendall and Bernard Babington Smith in the Journal of the Royal Statistical Society in 1938. These were built on statistical tools such as Pearson's distinguish

chi-square

test[33]and

whether

experimental

was

developed

phenomena

to

matched

their theoretical probabilities. Kendall and Smith's original four tests were Hypothesis tests, which took as their null hypothesis the idea that each number in a given random sequence had an [44]

equal

chance

patterns

of

in

occurring,

the

data

and

should

that be

various

also

other

distributed

equiprobably. The frequency test, was very basic: checking to make sure that there were roughly the same number of 0s, 1s, 2s, 3s, etc. The

serial

test,

did

the

same

thing

but

for

sequences of two digits at a time (00, 01, 02, etc.), comparing

their

observed

frequencies

with

their

hypothetical predictions were they equally distributed. The

gap

test,

looked

at

the

distances

between

zeroes (00 would be a distance of 0, 030 would be a distance of 1, 02250 would be a distance of 3, etc.). If a given sequence was able to pass all of these tests within a given degree of freedom and level of significance (generally 5%), then it was judged to be, in

their

words

differentiated

"locally "local

random".

Kendall

randomness"

and

from

Smith "true

randomness" in that many sequences generated with truly random methods might not display "local randomness" to a given degree of freedom very large sequences might contain many rows of a single digit. This might be [45]

"random" on the scale of the entire sequence, but in a smaller block it would not be "random" (it would not pass their tests), and would be useless for a number of statistical applications. As random number sets became more and more common, more

tests,

of

increasing

sophistication

were

used.

Some modern tests plot random digits as points on a three-dimensional plane, which can then be rotated to look for hidden patterns[36].In 1995, the statistician George Marsaglia created a set of tests known as the diehard tests, which he distributes with a CD-ROM of 5 billion pseudorandom numbers. Pseudorandom

number

generators

require

tests

as

exclusive verifications for their "randomness," as they are decidedly not produced by "truly random" processes, but

rather

by

deterministic

algorithms.

Over

the

history of random number generation, many sources of numbers thought to appear "random" under testing have later

been

discovered

to

be

very

non-random

when

subjected to certain types of tests. The notion of quasi random numbers[2] was developed to circumvent some of

these

generators

problems, are

still

though

pseudorandom

extensively [46]

used

number in

many

applications (even known to be extremely "non-random"), as they are "good enough" for most applications.

POKER TEST In order to test the randomness of the data in data files created in chapter 2, we shall first examine the data files by Poker's Test[47].Factually speaking Poker is a family of card games involving betting and individualistic play whereby the winner is determined by the ranks and combinations of their cards, some of which

remain

hidden

un-till

the

end

of

the

game.

Poker's test which derived its name from this game of cards is specially designed to test the independence of the

data

which

is

the

primary

requirement

of

randomness. In testing independence, our null hypothesis is H0: Numbers are random. (In terms of Independence) This null hypothesis, H0, reads that the numbers are independent. Failure to reject the null hypothesis means that no evidence of dependence has been detected on the basis of this test. The very first requirement for the application of POKER'S

TEST

on

data

files [47]

is

to

find

the

actual

probability of getting a number in the range of .0000 to .9999 in which Category 1:

all the four integers are distinct like .ABCD

Category 2:

all the four integers are same like .AAAA

Category 3:

any three integers are same like .AAAB,.AABA,.ABAA,.BAAA

Category 4:

Exactly one pair of like digits like .AABC,.ABAC,.ABCA,.BAAC ,.BACA ,.BCAA

Category 5:

Two pairs of like digits like .AABB,.ABBA,.ABAB

Now we shall evaluate the probabilities of getting a number from each of the above noted categories.

Probability for Category 1 Event 1 The very first integer can be any of 0,1,2,3,4,5,6,7,8,9 Probabilty for this event P(E1)= 10/10 = 1 Event 2 Second integer is different from first Probabilty for this event P(E2)= 9/10 = .9 [48]

Event 3 Third integer is different from first & second Probabilty for this event P(E3)= 8/10 = .8 Event 4 Fourth integer is different from first, second and third Probabilty for this event P(E4)= 7/10 = .7 Therefore Probabilty of getting a number of Category 1 p1 = P(E1)P(E2)P(E3)P(E4) = 1(.9)(.8)(.7)= 0.504

Probability for Category 2 Event 1 The very first integer can be any of 0,1,2,3,4,5,6,7,8,9 Probabilty for this event P(E1)= 10/10 = 1 Event 2 Second integer is same as first Probabilty for this event P(E2)= 1/10 = .1 Event 3 Third integer is same as first & second Probabilty for this event P(E3)= 1/10 = .1 Event 4 Fourth integer is same as first, second and third [49]

Probabilty for this event P(E4)= 1/10 = .1 Therefore Probabilty of getting a number of Category 2 p2 = P(E1)P(E2)P(E3)P(E4) =

1(.1)(.1)(.1) =

0.001

Probability for Category 3 Event 1 If the number is of the type .AAAB Probabilty for this event P(E1) = (10/10)(.1)(.1)(.9) = .009 Event 2 If the number is of the type .AABA Probabilty for this event P(E2) = (10/10)(.1)(.9)(.1) = .009 Event 3 If the number is of the type .ABAA Probabilty for this event P(E3) = (10/10)(.9)(.1)(.1) = .009 Event 4 If the number is of the type .BAAA Probabilty for this event P(E4) = (10/10)(.9)(.1)(.1) = .009 Probabilty of getting a number of Category 3 p3 = P(E1)+ P(E2)+ P(E3)+ P(E4) = 0.009 +.009 +.009 +.009 = 0.036 [50]

Probability for Category 4 If the four digit number contains exactly one pair of like digits then it can be any one of the following forms .AABC,.ABAC,.ABCA,.BAAC ,.BACA ,.BCAA Probabilty of getting a number of the type .AABC = P(E1)= 1(.1)(.9)(.8)= 0.072 Probabilty of getting a number of the type .ABAC = P(E2)= 1(.9)(.1)(.8)= 0.072 Probabilty of getting a number of the type .ABCA = P(E3)= 1(.9)(.8)(.1)= 0.072 Probabilty of getting a number of the type .BAAC = P(E4)= 1(.9)(.1)(.8)= 0.072 Probabilty of getting a number of the type .BACA = P(E5)= 1(.9)(.8)(.1)= 0.072 Probabilty of getting a number of the type .BCAA = P(E6)= 1(.9)(.8)(.1)= 0.072 Probabilty of getting a number of Categoery 4 p4 = P(E1)+ P(E2)+ P(E3)+ P(E4)+ P(E5)+ P(E6) = .072 +.072 +.072 + .072 +.072 +.072 = .432

Probability for Category 5 In a four digits number two pairs of like digits can appear in following ways [51]

.AABB,.ABBA,.ABAB Probabilty of getting a number of the type .AABB = P(E1)= 1(.1)(.9)(.1)= 0.009 Probabilty of getting a number of the type .ABBA = P(E2)= 1(.9)(.1)(.1)= 0.009 Probabilty of getting a number of the type .ABAB = P(E3)= 1(.9)(.1)(.1)= 0.009 Probabilty of getting a number of Category 5 p5 = P(E1)+ P(E2)+ P(E3) =

.009 + .009 + .009

=

.027

In a sample space of size N Expected frequency of Category 1 = p1N Expected frequency of Category 2 = p2N Expected frequency of Category 3 = p3N Expected frequency of Category 4 = p4N Expected frequency of Category 5 = p5N For a data file of size 1000, expected frequencies are (.504)x1000,(.001)x1000,(.036)x1000,(.432)x1000 and (.027)x1000 i.e.

504 , 1 , 36 , 432 and 27

Our data files are of size 1000 , 2000 , 3000 , 4000 and 5000 Expected frequencies for these files are as under [52]

E x p e c t e d f r e q u e n c ie s F ile S iz e

1000

2000

3000

4000

5000

C a te o g e ry 1

504

1008

1512

2016

2520

C a te o g e ry 2

1

2

3

4

5

C a te o g e ry 3

36

72

108

144

180

C a te o g e ry 4

432

864

1296

1728

2160

C a te o g e ry 5

27

54

81

108

135

Tab l e 3.0

Next in order to evaluate the observed frequencies of these five categories in our files, we now present a computer program as below PROG3_1.BAS 10 20 30 40 50 60 70 80 90 100

110 120 130 140 150 160 170

CLS: DIM K$(1000) : C1=0:C2=0:C3=0:C4=0:C5 = 0 :DIM N$(4) OPEN "H:INT_1_1.DAT" FOR INPUT AS #1 FOR I = 1 TO 1000 INPUT #1,X$ K$(I)=X$:NEXT I FOR J = 1 TO 1000 X$=K$(J) FOR I = 1 TO 4 : N$(I)=MID$(X$,I+2,1) : NEXT I REM**CHECK FOR DISTINCT DIGITS**** IF N$(1) N$(2) AND N$(1) N$(3) AND N$(1) N$(4) AND N$(2) N$(3) AND N$(2) N$(4) AND N$(3) N$(4) THEN C1=C1+1 REM***CHECK FOR TRIPPLE REPETITION **** IF N$(1)=N$(2) AND N$(2)=N$(3) AND N$(3) N$(4) THEN C2=C2+1 IF N$(1)=N$(2) AND N$(1)=N$(4) AND N$(3) N$(1) THEN C2=C2+1 IF N$(1)=N$(3) AND N$(3)=N$(4) AND N$(1) N$(2) THEN C2=C2+1 IF N$(2)=N$(3) AND N$(3)=N$(4) AND N$(1) N$(2) THEN C2=C2+1 REM***CHECK FOR FOUR TIMES REPETITION *** IF N$(1)=N$(2) AND N$(2)=N$(3)

[53]

180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350

AND N$(3)=N$(4) THEN C3=C3+1 REM**CHECK FOR ONE PAIR OF LIKE DIGITS*** IF N$(1)=N$(2) AND N$(2) N$(3) AND N$(2) N$(4) AND N$(3)N$(4) THEN C4 = C4+1 IF N$(1)=N$(3) AND N$(1) N$(2) AND N$(1) N$(4) AND N$(2)N$(4) THEN C4 = C4+1 IF N$(1)=N$(4) AND N$(1) N$(2) AND N$(1) N$(3) AND N$(2)N$(3) THEN C4 = C4+1 IF N$(2)=N$(3) AND N$(1) N$(2) AND N$(4) N$(2) AND N$(1)N$(4) THEN C4 = C4+1 IF N$(2)=N$(4) AND N$(1) N$(2) AND N$(3) N$(2) AND N$(1)N$(3) THEN C4 = C4+1 IF N$(3)=N$(4) AND N$(1) N$(3) AND N$(3) N$(2) AND N$(1)N$(2) THEN C4 = C4+1 REM***CHECK FOR TWO PAIRS OF LIKE DIGITS** IF N$(1)=N$(2) AND N$(2) N$(3) AND N$(3) = N$(4) THEN C5 = C5+1 IF N$(1)=N$(3) AND N$(3) N$(2) AND N$(2) = N$(4) THEN C5 = C5+1 IF N$(1)=N$(4) AND N$(4) N$(2) AND N$(2) = N$(3) THEN C5 = C5+1 NEXT J CLS:LOCATE 10,10 : PRINT "Category 1....FOUR DISTINCT DIGITS","=";C1 LOCATE 12,10: PRINT "Category 2....FOUR LIKE DIGITS",,"=";C3 LOCATE 14,10 : PRINT "Category 3....THREE LIKE DIGITS",,"=";C2 LOCATE 16,10 : PRINT "Category 4....ONE PAIR OF LIKE DIGITS","=";C4 LOCATE 18,10: PRINT "Category 5....TWO PAIRS OF LIKE DIGITS","=";C5 CLOSE :END

This program is designed for the file H:INT_1_1.DAT Data size of which is 1000. As a result of its execution we get the following output

[54]

Category 1 ....FOUR DISTINCT DIGITS

= 508

Category 2 ....FOUR LIKE DIGITS

= 3

Category 3 ....THREE LIKE DIGITS

= 35

Category 4 ....ONE PAIR OF LIKE DIGITS

= 419

Category 5 ....TWO PAIRS OF LIKE DIGITS

= 35

For

observed

frequencies

of

all

other

files

size 1000 we have to modify line 20 only. For file "H:INT_2_1.DAT" the modified form of line 20 will be 20

OPEN "H:INT_2_1.DAT" FOR INPUT AS #1

Execution of which will give Category 1 ....FOUR DISTINCT DIGITS

= 518

Category 2 ....FOUR LIKE DIGITS

= 0

Category 3 ....THREE LIKE DIGITS

= 33

Category 4 ....ONE PAIR OF LIKE DIGITS

= 414

Category 5 ....TWO PAIRS OF LIKE DIGITS

= 35

For the files of size 2000 like "H:INT_1_2.DAT" we have to modify line 10,20,30 and 60 as 10 20 30 60

CLS:DIM K$(2000): C1=0:C2=0:C3=0:C4=0:C5 = 0 :DIM N$(4) OPEN "H:INT_1_2.DAT" FOR INPUT AS #1 FOR I = 1 TO 2000 FOR J = 1 TO 2000

which on execution gives Category 1 ....FOUR DISTINCT DIGITS

= 1018

Category 2 ....FOUR LIKE DIGITS

= 0

[55]

of

Category 3 ....THREE LIKE DIGITS

= 65

Category 4 ....ONE PAIR OF LIKE DIGITS

= 872

Category 5 ....TWO PAIRS OF LIKE DIGITS

= 45

In

observed

such

a

way

we

can

evaluate

the

frequencies of all the thirty files of chapter 2 with following ready report.

Observed Frequencies F ile s D a t a S ize 1 0 0 0 F ile N a m e

IN T _ 1 _ 1

IN T _ 2 _ 1

IN T _ 3 _ 1

o lr r 1

o lr o r g 1

o lg p 1

C a te g o ry 1

508

518

485

498

517

487

C a te g o ry 2

3

0

1

0

1

1

C a te g o ry 3

35

33

39

39

35

41

C a te g o ry 4

419

414

445

432

420

448

C a te g o ry 5

35

35

30

31

27

23

T a b le 3 .1

F ile s D a t a S iz e 2 0 0 0 F ile N a m e

IN T _ 1 _ 1

IN T _ 2 _ 1

IN T _ 3 _ 1

o lr r 1

o lr o r g 1

o lg p 1

C a te g o ry 1

1018

1033

1048

1019

999

1003

C a te g o ry 2

0

2

2

1

2

3

C a te g o ry 3

65

64

74

63

69

77

C a te g o ry 4

872

859

821

862

869

867

C a te g o ry 5

45

42

55

55

61

50

T a b le 3 .2

F ile s D a t a S iz e 3 0 0 0 F ile N a m e

IN T _ 1 _ 1

IN T _ 2 _ 1

IN T _ 3 _ 1

o lr r 1

o lr o r g 1

o lg p 1

C a te g o ry 1

1497

1518

1499

1507

1522

1544

C a te g o ry 2

3

3

4

4

3

4

C a te g o ry 3

118

115

107

106

101

98

C a te g o ry 4

1288

1293

1299

1293

1291

1278

C a te g o ry 5

94

71

91

90

83

76

T a b le 3 .3

[56]

F ile s D a t a S iz e 4 0 0 0 F ile N a m e

IN T _ 1 _ 1

IN T _ 2 _ 1

IN T _ 3 _ 1

o lr r 1

o lr o r g 1

o lg p 1

C a te g o ry 1

2023

2012

1975

2059

1990

2023

C a te g o ry 2

4

6

1

3

4

1

C a te g o ry 3

133

155

139

158

138

148

C a te g o ry 4

1736

1726

1776

1679

1763

1718

C a te g o ry 5

104

101

109

101

105

110

T a b le 3 .4

F ile s D a t a S iz e 5 0 0 0 F ile N a m e

IN T _ 1 _ 1

IN T _ 2 _ 1

IN T _ 3 _ 1

o lr r 1

o lr o r g 1

o lg p 1

C a te g o ry 1

2575

2473

2522

2514

2566

2489

C a te g o ry 2

3

7

3

5

4

5

C a te g o ry 3

170

177

178

182

167

170

C a te g o ry 4

2126

2210

2172

2177

2130

2202

C a te g o ry 5

126

133

125

122

133

134

T a b le 3 .5

Now we are well equipped with expected frequencies as

well

as

observed

frequencies

of

all

the

five

categories in our files. For the evaluation of Chi-Square for these data files we now give a computer program as below PROG3_2.BAS 10 20 30 40 50 60

CLS: KEY OFF:C1=0 : C2=0 :C3=0 :C4=0 :C5=0 : DIM N$(4) LOCATE 4,5 : PRINT "Following files are available...." LOCATE 7,5 : PRINT "1......INT_1_1.DAT","2......INT_2_1.DAT","3......INT_3_1.DAT" LOCATE 8,5 : PRINT "4......olrr1.DAT","5......olrorg1.DAT","6......olgp1.DAT" LOCATE 10,5 : PRINT "7......INT_1_2.DAT","8......INT_2_2.DAT","9......INT_3_2.DAT" LOCATE 11,5 : PRINT

[57]

70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430

"10.....olrr2.DAT","11.....olrorg2.DAT", "12.....olgp2.DAT" LOCATE 13,5 : PRINT "13.....INT_1_3.DAT","14.....INT_2_3.DAT","15.....INT_3_3.DAT" LOCATE 14,5 : PRINT "16.....olrr3.DAT","17.....olrorg3.DAT", "18.....olgp3.DAT" LOCATE 16,5 : PRINT "19.....INT_1_4.DAT","20.....INT_2_4.DAT","21.....INT_3_4.DAT" LOCATE 17,5 : PRINT "22.....olrr4.DAT","23.....olrorg4.DAT", "24.....olgp4.DAT" LOCATE 19,5 : PRINT "25.....INT_1_5.DAT","26.....INT_2_5.DAT","27.....INT_3_5.DAT" LOCATE 20,5 : PRINT "28.....olrr5.DAT","29.....olrorg5.DAT", "30.....olgp5.DAT" LOCATE 22,5 : INPUT "Give File Number ( 1 - 30)";ANS IF ANS < 0 OR ANS > 30 THEN 150 ELSE 160 LOCATE 22,5:PRINT " ": GOTO 130 IF ANS 7 AND ANS < 13 THEN DM=2000 IF ANS >6 AND ANS < 13 THEN DM=2000 IF ANS >12 AND ANS < 19 THEN DM=3000 IF ANS >18 AND ANS < 25 THEN DM=4000 IF ANS >24 AND ANS < 31 THEN DM=5000 IF ANS =1 THEN F$="H:INT_1_1.dat" IF ANS =2 THEN F$="H:INT_2_1.dat" IF ANS =3 THEN F$="H:INT_3_1.dat" IF ANS =4 THEN F$="H:olrr1.dat" IF ANS =5 THEN F$="H:olrorg1.dat" IF ANS =6 THEN F$="H:olgp1.dat" IF ANS =7 THEN F$="H:INT_1_2.dat" IF ANS =8 THEN F$="H:INT_2_2.dat" IF ANS =9 THEN F$="H:INT_3_2.dat" IF ANS =10 THEN F$="H:olrr2.dat" IF ANS =11 THEN F$="H:olrorg2.dat" IF ANS =12 THEN F$="H:olgp2.dat" IF ANS =13 THEN F$="H:INT_1_3.dat" IF ANS =14 THEN F$="H:INT_2_3.dat" IF ANS =15 THEN F$="H:INT_3_3.dat" IF ANS =16 THEN F$="H:olrr3.dat" IF ANS =17 THEN F$="H:olrorg3.dat" IF ANS =18 THEN F$="H:olgp3.dat" IF ANS =19 THEN F$="H:INT_1_4.dat" IF ANS =20 THEN F$="H:INT_2_4.dat" IF ANS =21 THEN F$="H:INT_3_4.dat" IF ANS =22 THEN F$="H:olrr4.dat"

[58]

440 450 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600 610 620 630 640 650 660 670 680 690 700 710

720 730 740 750 760 770 780 790

IF ANS =23 THEN F$="H:olrorg4.dat" IF ANS =24 THEN F$="H:olgp4.dat" IF ANS =25 THEN F$="H:INT_1_5.dat" IF ANS =26 THEN F$="H:INT_2_5.dat" IF ANS =27 THEN F$="H:INT_3_5.dat" IF ANS =28 THEN F$="H:olrr5.dat" IF ANS =29 THEN F$="H:olrorg5.dat" IF ANS =30 THEN F$="H:olgp5.dat" IF ANS < 7 THEN 530 ELSE 540 EC1=504:EC3=1:EC2=36:EC4=432:EC5=27 IF ANS 6 THEN 550 ELSE 560 EC1=1008:EC3=2:EC2=72:EC4=864:EC5=54 IF ANS 12 THEN 570 ELSE 580 EC1=1512:EC3=3:EC2=108:EC4=1296:EC5=81 IF ANS 18 THEN 590 ELSE 600 EC1=2016:EC3=4:EC2=144:EC4=1728:EC5=108 IF ANS 24 THEN 610 ELSE 620 EC1=2520:EC3=5:EC2=180:EC4=2160:EC5=135 CLS:DIM K$(DM):C1=0:C2=0:C3=0:C4=0:C5=0 OPEN F$ FOR INPUT AS #1 FOR I = 1 TO DM INPUT #1,X$ K$(I)=X$:NEXT I FOR J = 1 TO DM X$=K$(J) FOR I = 1 TO 4 : N$(I)= MID$(X$,I+2,1):NEXT I REM*****CHECK FOR DISTINCT DIGITS***** IF N$(1) N$(2) AND N$(1) N$(3) AND N$(1) N$(4) AND N$(2) N$(3) AND N$(2) N$(4) AND N$(3) N$(4) THEN C1=C1+1 REM***CHECK FOR TRIPPLE REPETITION **** IF N$(1)=N$(2) AND N$(2)=N$(3) AND N$(3) N$(4) THEN C2=C2+1 IF N$(1)=N$(2) AND N$(1)=N$(4) AND N$(3) N$(1) THEN C2=C2+1 IF N$(1)=N$(3) AND N$(3)=N$(4) AND N$(1) N$(2) THEN C2=C2+1 IF N$(2)=N$(3) AND N$(3)=N$(4) AND N$(1) N$(2) THEN C2=C2+1 REM**CHECK FOR FOUR TIMES REPETITION** IF N$(1)=N$(2) AND N$(2)=N$(3) AND N$(3)=N$(4) THEN C3=C3+1 REM***CHECK FOR ONE PAIR OF LIKE DIGITS**

[59]

800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990 1000 1010 1020 1030 1040 1050 1060 1070

IF N$(1)=N$(2) AND N$(2) N$(3) AND N$(2) N$(4) AND N$(3)N$(4) THEN C4 = C4+1 IF N$(1)=N$(3) AND N$(1) N$(2) AND N$(1) N$(4) AND N$(2)N$(4) THEN C4 = C4+1 IF N$(1)=N$(4) AND N$(1) N$(2) AND N$(1) N$(3) AND N$(2)N$(3) THEN C4 = C4+1 IF N$(2)=N$(3) AND N$(1) N$(2) AND N$(4) N$(2) AND N$(1)N$(4) THEN C4 = C4+1 IF N$(2)=N$(4) AND N$(1) N$(2) AND N$(3) N$(2) AND N$(1)N$(3) THEN C4 = C4+1 IF N$(3)=N$(4) AND N$(1) N$(3) AND N$(3) N$(2) AND N$(1)N$(2) THEN C4 = C4+1 REM**CHECK FOR TWO PAIRS OF LIKE DIGITS** IF N$(1)=N$(2) AND N$(2) N$(3) AND N$(3) = N$(4) THEN C5 = C5+1 IF N$(1)=N$(3) AND N$(3) N$(2) AND N$(2) = N$(4) THEN C5 = C5+1 IF N$(1)=N$(4) AND N$(4) N$(2) AND N$(2) = N$(3) THEN C5 = C5+1 NEXT J CLS SUM=SUM+(C1-EC1)*(C1-EC1)/EC1 SUM=SUM+(C2-EC2)*(C2-EC2)/EC2 SUM=SUM+(C3-EC3)*(C3-EC3)/EC3 SUM=SUM+(C4-EC4)*(C4-EC4)/EC4 SUM=SUM+(C5-EC5)*(C5-EC5)/EC5 LOCATE 2,5 : PRINT "File Name .....";F$ LOCATE 5,5 : PRINT "Observed Frequencies are.... LOCATE 7,5 : PRINT C1,C2,C3,C4,C5 LOCATE 9,5 : PRINT "Expected Frequencies are.... LOCATE 11,5 : PRINT EC1,EC2,EC3,EC4,EC5 LOCATE 14,5 : PRINT "Calculated Value of Chi-Square ",SUM LOCATE 16,5 : PRINT "Tabulated Value of Chi-Square" LOCATE 18,5 : PRINT "at 5% level of significance is "," 9.488" IF SUM < 9.488 THEN 1060 ELSE 1070 LOCATE 20,5 : PRINT "There is no reason to reject the Null Hypothesis" CLOSE : END

As a rsult of execution of this program we are prompted with the following message Following files are available..... [60]

1

INT_1_1.DAT

2

INT_2_1.DAT

3

INT_3_1.DAT

4

olrr1.DAT

5

olrorg1.DAT

6

olgp1.DAT

7

INT_1_2.DAT

8

INT_2_2.DAT

9

INT_3_2.DAT

10

olrr2.DAT

11

olrorg2.DAT

12

olgp2.DAT

13

INT_1_3.DAT

14

INT_2_3.DAT

15

INT_3_3.DAT

16

olrr3.DAT

17

olrorg3.DAT

18

olgp3.DAT

19

INT_1_4.DAT

20

INT_2_4.DAT

21

INT_3_4.DAT

22

olrr4.DAT

23

olrorg4.DAT

24

olgp4.DAT

25

INT_1_5.DAT

26

INT_2_5.DAT

27

INT_3_5.DAT

28

olrr5.DAT

29

olrorg5.DAT

30

olgp5.DAT

Give File Number ( 1- 30 ) ? Choice 1 for the file number gives the following informations File Name .....H:INT_1_1.DAT Observed Frequencies are... 508

3

35

419

35

432

27

Expected Frequencies are... 504

1

36

Calculated Value of Chi Square is 6.821098 Tabulated Value of Chi Square at 5% level of significance is 9.488 There is no reason to reject the Null Hypothesis Corresponding to other values of file number we get Chi Square as well as the deduction in respect of all the files created in chapter 2.These results can be put in following tabulated forms [61]

Files of Data Size 1000 C h i -S q u a r e T e s t f o r I N T _ 1 _ 1 .D A T

S .N o .

C o m b in a t io n (i)

O b se rve d

Ex p e c te d

fr e q u e n c y

fr e q u e n c y

(O i )

(E i )

(O i -E i )

(O i -E i )

2

(O i -E i )

2

/Ei

1

C a te g o ry 1

508

504

-4

16

0 .0 3 1 7

2

C a te g o ry 2

3

1

-2

4

4 .0 0 0 0

3

C a te g o ry 3

35

36

1

1

0 .0 2 7 8

4

C a te g o ry 4

419

432

13

169

0 .3 9 1 2

5

C a te g o ry 5

35

27

-8

64

2 .3 7 0 4

χ 2 (C a lc u la t e d ) =

6 .8 2 1 1


6 THEN 230 ELSE 240 LOCATE 15,1:PRINT " " : GOTO 210 LOCATE 17,1: INPUT "For y-range type your File Number";C2 IF C2 =< 0 OR C2 > 6 THEN 260 ELSE 270 LOCATE 17,1:PRINT " " : GOTO 240 IF C1 = C2 THEN 280 ELSE 330 LOCATE 18,1: PRINT"You have to choose distinct files" ANS$=INKEY$:IF ANS$="" THEN 290 ELSE 300 LOCATE 15,1:PRINT " " LOCATE 17,1:PRINT " " LOCATE 18,1:PRINT " " : GOTO 210 IF C=1 THEN C1=C1 : IF C=1 THEN C2 = C2 IF C=2 THEN C1=C1+6 : IF C=2 THEN C2=C2+6 IF C=3 THEN C1=C1+12 : IF C=3 THEN C2=C2+12

[136]

360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 510 520 530

IF C=4 THEN C1=C1+18 : IF C=4 THEN C2=C2+18 IF C=5 THEN C1=C1+24 : IF C=5 THEN C2=C2+24 F1$=F$(C1):F2$=F$(C2):CLS DEF FNI(A,B)= A*B + EXP(B) LOCATE 10,5: INPUT "Lower limit for x-variable ";XLO LOCATE 12,5: INPUT "Upper limit for x-variable ";XUP LOCATE 14,5: INPUT "Lower limit for y-variable ";YLO LOCATE 16,5: INPUT "Upper limit for y-variable ";YUP:CLS H=(XUP-XLO)/DS : K=(YUP-YLO)/DS OPEN F1$ FOR INPUT AS #1 OPEN F2$ FOR INPUT AS #2 INPUT #1,X : X=X*(XUP-XLO) INPUT #2,Y : Y=Y*(YUP-YLO) Y = YLO +Y:X = XLO+X:SUM = SUM + FNI(X,Y) IF NOT EOF(1) THEN 470 SUM=SUM/DS : SUM=SUM*(XUP-XLO)*(YUP-YLO) LOCATE 8,10 : PRINT "By Monte-Carlo Integration :-" LOCATE 10,10 : PRINT "Using Random data files: ";F1$; " and ";F2$ LOCATE 12,10 : PRINT"Value of integral ";SUM CLOSE:END

540 550

On execution of the program PROG6_1R.BAS we are first required to input the drive letter where the Random required

Data to

Files choose

are the

stored. size

of

Then the

after

we

are

DATA

FILE

by

inputting the choice number 1,2,3,4 or 5 corresponding to the sizes of 1000, 2000, 3000, 4000 and 5000 data. Next, all the six data files of the required size are depicted on the screen. Out of these six data files we have to choose one data file for x-series and one data file for y-series.

[137]

After this selection, limits of integration for xvariable as well as for y-variable are to be inputted.

Now the INPUT session is complete and finally the evaluated values of the integral by Monte Carlo Method using random nodes and equispaced nodes are displayed.

Corresponding to data size of 1000 and choosing INT_1_1.DAT for x-series and

INT_2_1.DAT for y-series

and Limits of integration : 1 to 2 for x-variable and Limits of integration : 3 to 4 for y-variable

We get the following OUTPUT

By Monte Carlo Integration:Using Random Data Files: G:INT_1_1.DAT and G:INT_2_1.DAT Value of Integral

=

40.27252

Corresponding to data size of 1000 and choosing INT_2_1.DAT for x-series and

INT_1_1.DAT for y-series

[138]

i.e. interchanging the files of x and y series with same limits of integration we get the following OUTPUT By Monte Carlo Integration:Using Random Data Files: G:INT_2_1.DAT

and G:INT_1_1.DAT

Value of Integral

=

39.4643

Out of the six data files for 1000 data size there can be 15 combinations and 15 more combinations when data files for x-series and y-series are interchanged. These 30 pairs of codes for 30 file combinations are

(1,2),(1,3),(1,4),(1,5),(1,6),(2,3) (2,4),(2,5),(2,6),(3,4),(3,5),(3,6) (4,5),(4,6),(5,6),(2,1),(3,1),(4,1) (5,1),(6,1),(3,2),(4,2),(5,2),(6,2) (4,3),(5,3),(6,3),(5,4),(6,4),(6,5)

By repeated execution of this program for these 30 combinations of files for x and y series, we get the following observations.

[139]

FIR S T IN T E G R A L (2-D ) Usin g 1000 R a n d o m D a ta S .N o .

File N a m e

T ru e v a lu e In teg ra l

Va lu e O f In teg ra l Usin g

E rro r

R a n d o m N o d es

1

in t_1_1 & in t_2_1

39.76261

40.27252

0.50991

2

in t_1_1 & in t_3_1

39.76261

39.7384

-0.0242

3

in t_1_1 & o lrr1

39.76261

39.71796

-0.0447

4

in t_1_1 & o lro rg1

39.76261

39.95174

0.18913

5

in t_1_1 & o lgp 1

39.76261

40.19047

0.42786

6

in t_2_1 & in t_1_1

39.76261

39.4643

-0.2983

7

in t_2_1 & in t_3_1

39.76261

39.81743

0.05482

8

in t_2_1 & o lrr1

39.76261

39.78837

0.02576

9

in t_2_1 & o lro rg1

39.76261

40.02318

0.26057

10

in t_2_1 & o lgp 1

39.76261

40.26213

0.49952

11

in t_3_1 & in t_1_1

39.76261

39.41841

-0.3442

12

in t_3_1 & in t_2_1

39.76261

40.30568

0.54307

13

in t_3_1 & o lrr1

39.76261

39.74761

-0.015

14

in t_3_1 & o lro rg1

39.76261

39.97729

0.21468

15

in t_3_1 & o lgp 1

39.76261

40.21144

0.44883

16

o lrr1 & in t_1_1

39.76261

39.41968

-0.3429

17

o lrr1 & in t_2_1

39.76261

40.29828

0.53567

18

o lrr1 & in t_3_1

39.76261

39.76924

0.00663

19

o lrr1 & o lro rg1

39.76261

39.97384

0.21123

20

o lrr1 & o lgp 1

39.76261

40.21274

0.45013

21

o lo rrg1 & in t_1_1

39.76261

39.43876

-0.3239

22

o lro rg1 & in t_2_1

39.76261

40.31837

0.55576

23

o lro rg1 & in t_3_1

39.76261

39.78424

0.02163

24

o lro rg1 & o lrr1

39.76261

39.75909

-0.0035

25

o lro rg1 & o lgp 1

39.76261

40.23304

0.47043

26

o lgp 1 & in t_1_1

39.76261

39.46723

-0.2954

27

o lgp 1 & in t_2_1

39.76261

40.34709

0.58448

28

o lgp 1 & in t_3_1

39.76261

39.8081

0.04549

29

o lgp 1 & o lrr1

39.76261

39.78773

0.02512

30

o lgp 1 & o lro rg1

39.76261

40.02274

0.26013

Tab le 6 .4 .1

[140]

FIR S T IN TE G R A L (2-D ) Usin g 2000 R a n d o m D a ta S .N o .

File N a m e

Tru e v a lu e In teg ra l

Va lu e O f In teg ra l Usin g

E rro r

R a n d o m N o d es

1

int_1_2 & int_2_2

39.76261

40.25756

0.49495

2

int_1_2 & int_3_2

39.76261

39.94837

0.18576

3

int_1_2 & olrr2

39.76261

40.05103

0.28842

4

int_1_2 & olrorg2

39.76261

39.76542

0.00281

5

int_1_2 & olgp2

39.76261

39.93312

0.17051

6

int_2_2 & int_1_2

39.76261

39.52998

-0.2326

7

int_2_2 & int_3_2

39.76261

40.03584

0.27323

8

int_2_2 & olrr2

39.76261

40.12588

0.36327

9

int_2_2 & olrorg2

39.76261

39.84009

0.07748

10

int_2_2 & olgp2

39.76261

40.01141

0.2488

11

int_3_2 & int_1_2

39.76261

39.50343

-0.2592

12

int_3_2 & int_2_2

39.76261

40.30849

0.54588

13

int_3_2 & olrr2

39.76261

40.09824

0.33563

14

int_3_2 & olrorg2

39.76261

39.81324

0.05063

15

int_3_2 & olgp2

39.76261

39.98253

0.21992

16

olrr2 & int_1_2

39.76261

39.51075

-0.2519

17

olrr2 & int_2_2

39.76261

40.31315

0.55054

18

olrr2 & int_3_2

39.76261

40.01298

0.25037

19

olrr2 & olrorg2

39.76261

39.81965

0.05704

20

olrr2 & olgp2

39.76261

39.98842

0.22581

21

olorrg2 & int_1_2

39.76261

39.48668

-0.2759

22

olrorg2 & int_2_2

39.76261

39.89164

0.12903

23

olrorg2 & int_3_2

39.76261

39.98948

0.22687

24

olrorg2 & olrr2

39.76261

40.08115

0.31854

25

olrorg2 & olgp2

39.76261

39.9629

0.20029

26

olgp2 & int_1_2

39.76261

39.50144

-0.2612

27

olgp2 & int_2_2

39.76261

40.30728

0.54467

28

olgp2 & int_3_2

39.76261

40.00572

0.24311

29

olgp2 & olrr2

39.76261

40.09703

0.33442

30

olgp2 & olrorg2

39.76261

39.80991

0.0473

Tab le 6 .4 .2

[141]

FIR S T IN TE G R A L (2-D ) Usin g 3000 R a n d o m D a ta S .N o .

File N a m e

Tru e v a lu e In teg ra l

Va lu e O f In teg ra l Usin g

E rro r

R a n d o m N o d es

1

int_1_3 & int_2_3

39.76261

40.02575

0.26314

2

int_1_3 & int_3_3

39.76261

39.54741

-0.2152

3

int_1_3 & olrr3

39.76261

39.69862

-0.064

4

int_1_3 & olrorg3

39.76261

39.88922

0.12661

5

int_1_3 & olgp3

39.76261

39.87184

0.10923

6

int_2_3 & int_1_3

39.76261

39.73576

-0.0269

7

int_2_3 & int_3_3

39.76261

39.57853

-0.1841

8

int_2_3 & olrr3

39.76261

39.72856

-0.0341

9

int_2_3 & olrorg3

39.76261

39.92128

0.15867

10

int_2_3 & olgp3

39.76261

39.9018

0.13919

11

int_3_3 & int_1_3

39.76261

39.68564

-0.077

12

int_3_3 & int_2_3

39.76261

40.00673

0.24412

13

int_3_3 & olrr3

39.76261

39.67741

-0.0852

14

int_3_3 & olrorg3

39.76261

39.87345

0.11084

15

int_3_3 & olgp3

39.76261

39.8499

0.08729

16

olrr3 & int_1_3

39.76261

39.70882

-0.0538

17

olrr3 & int_2_3

39.76261

40.02886

0.26625

18

olrr3 & int_3_3

39.76261

39.54942

-0.2132

19

olrr3 & olrorg3

39.76261

39.89076

0.12815

20

olrr3 & olgp3

39.76261

39.86984

0.10723

21

olorrg3 & int_1_3

39.76261

39.72508

-0.0375

22

olrorg3 & int_2_3

39.76261

40.04724

0.28463

23

olrorg3 & int_3_3

39.76261

39.57119

-0.1914

24

olrorg3 & olrr3

39.76261

39.71639

-0.0462

25

olrorg3 & olrr3

39.76261

39.89045

0.12784

26

olgp3 & int_1_3

39.76261

39.7232

-0.0394

27

olgp3 & int_2_3

39.76261

40.04326

0.28065

28

olgp3 & int_3_3

39.76261

39.56312

-0.1995

29

olgp3 & olrr3

39.76261

39.71094

-0.0517

30

olgp3 & olrorg3

39.76261

39.90593

0.14332

Tab le 6 .4 .3

[142]

FIR S T IN TE G R A L (2-D ) Usin g 4000 R a n d o m D a ta S .N o .

File N a m e

Tru e v a lu e In teg ra l

Va lu e O f In teg ra l Usin g

E rro r

R a n d o m N o d es

1

int_1_4 & int_2_4

39.76261

39.66985

-0.0928

2

int_1_4 & int_3_4

39.76261

39.69537

-0.0672

3

int_1_4 & olrr4

39.76261

39.51314

-0.2495

4

int_1_4 & olrorg4

39.76261

39.68857

-0.074

5

int_1_4 & olgp4

39.76261

39.8647

0.10209

6

int_2_4 & int_1_4

39.76261

39.65475

-0.1079

7

int_2_4 & int_3_4

39.76261

39.69746

-0.0652

8

int_2_4 & olrr4

39.76261

39.51387

-0.2487

9

int_2_4 & olrorg4

39.76261

39.68638

-0.0762

10

int_2_4 & olgp4

39.76261

39.86355

0.10094

11

int_3_4 & int_1_4

39.76261

39.65509

-0.1075

12

int_3_4 & int_2_4

39.76261

39.67225

-0.0904

13

int_3_4 & olrr4

39.76261

39.51389

-0.2487

14

int_3_4 & olrorg4

39.76261

39.68889

-0.0737

15

int_3_4 & olgp4

39.76261

39.86892

0.10631

16

olrr4 & int_1_4

39.76261

39.64628

-0.1163

17

olrr4 & int_2_4

39.76261

39.65841

-0.1042

18

olrr4 & int_3_4

39.76261

39.68377

-0.0788

19

olrr4 & olrorg4

39.76261

39.67352

-0.0891

20

olrr4 & olgp4

39.76261

39.855504

0.09289

21

olorrg4 & int_1_4

39.76261

39.66131

-0.1013

22

olrorg4 & int_2_4

39.76261

39.67247

-0.0901

23

olrorg4 & int_3_4

39.76261

39.70189

-0.0607

24

olrorg4 & olrr4

39.76261

39.51666

-0.246

25

olrorg4 & olgp4

39.76261

39.86642

0.10381

26

olgp4 & int_1_4

39.76261

39.67253

-0.0901

27

olgp4 & int_2_4

39.76261

39.68647

-0.0761

28

olgp4 & int_3_4

39.76261

39.71711

-0.0455

29

olgp4 & olrr4

39.76261

39.53337

-0.2292

30

olgp4 & olrorg4

39.76261

39.70154

-0.0611

Tab le 6 .4 .4

[143]

FIR S T IN TE G R A L (2-D ) Usin g 5000 R a n d o m D a ta S .N o .

File N a m e

Tru e v a lu e In teg ra l

Va lu e O f In teg ra l Usin g

E rro r

R a n d o m N o d es

1

int_1_5 & int_2_5

39.76261

39.8919

0.12929

2

int_1_5 & int_3_5

39.76261

39.65769

-0.1049

3

int_1_5 & olrr5

39.76261

39.79416

0.03155

4

int_1_5 & olrorg5

39.76261

39.88149

0.11888

5

int_1_5 & olgp5

39.76261

39.71393

-0.0487

6

int_2_5 & int_1_5

39.76261

39.8859

0.12329

7

int_2_5 & int_3_5

39.76261

39.65979

-0.1028

8

int_2_5 & olrr5

39.76261

39.79431

0.0317

9

int_2_5 & olrorg5

39.76261

39.88263

0.12002

10

int_2_5 & olgp5

39.76261

39.71556

-0.047

11

int_3_5 & int_1_5

39.76261

39.86549

0.10288

12

int_3_5 & int_2_5

39.76261

39.87347

0.11086

13

int_3_5 & olrr5

39.76261

39.77256

0.00995

14

int_3_5 & olrorg5

39.76261

39.85649

0.09388

15

int_3_5 & olgp5

39.76261

39.69173

-0.0709

16

olrr5 & int_1_5

39.76261

39.87583

0.11322

17

olrr5 & int_2_5

39.76261

39.88205

0.11944

18

olrr5 & int_3_5

39.76261

39.64663

-0.116

19

olrr5 & olrorg5

39.76261

39.86943

0.10682

20

olrr5 & olgp5

39.76261

39.70263

-0.06

21

olorrg5 & int_1_5

39.76261

39.88443

0.12182

22

olrorg5 & int_2_5

39.76261

39.89164

0.12903

23

olrorg5 & int_3_5

39.76261

39.65173

-0.1109

24

olrorg5 & olrr5

39.76261

39.79057

0.02796

25

olrorg5 & olgp5

39.76261

39.70994

-0.0527

26

olgp5 & int_1_5

39.76261

39.87074

0.10813

27

olgp5 & int_2_5

39.76261

39.8785

0.11589

28

olgp5 & int_3_5

39.76261

39.64079

-0.1218

29

olgp5 & olrr5

39.76261

39.77776

0.01515

30

olgp4 & olrorg4

39.76261

39.86379

0.10118

Tab le 6 .4 .5

[144]

FIRST INTEGRAL (2-D) (USING EQUISPACED NODES) In order to evaluate the value of the integral

I

4

By using equispaced nodes, we now present a tiny program PROG-6-1E.BAS in which the limits of integration are being supplied within the program. For different integral of 2-dimension the user defined function (line 20) should be changed and the limits of integration should be supplied in the INPUT session. By doing so the

program

concerned

will

here

be

with

more a

elaborate

specific

one.

As

integral,

we we

are have

supplied the limits inside the program. The listing of the program PROG6_1E.BAS is as below

PROG6_1E.BAS 10 20 30 40 50 60

REM "First Integral (2-D)-Equispaced Nodes" DEF FNI(A,B)= A*B + EXP(B) CLS:XLO = 1:XUP = 2:YLO = 3:YUP = 4 LOCATE 10,10: INPUT "No of Equispaced Nodes ";N DIM A(N): DIM B(N) A(0)= XLO :B(0)= YLO

[145]

70 80 90 100 110 120 130 140 150 160 170 180

H =(XUP - XLO)/N:K =(YUP - YLO)/N FOR I= 1 TO N A(I)= A(I-1)+H:B(I)= B(I-1)+K NEXT I FOR I = 1 TO N FOR J = 1 TO N ESUM = ESUM + FNI(A(I),B(J)) NEXT J NEXT I ESUM = ESUM*H*K LOCATE 15,10:PRINT "Divisions= " ;N,"Value = ";ESUM END

On execution of this program we are prompted as

No of Equispaced Nodes ?

Inputting

100

for

this

requirement

we

get

the

output as

Divisions = 100

By

repeated

200,300,...,2000

Value = 39.96033

execution divisions

observations.

[146]

of we

this get

program the

for

following

FIR S T IN T E G R A L (2-D )-B Y E Q UIS P A CE D N O D E S N o. of S. N o. Eq u isp ace d V alu e O f In te gral

Tru e V alu e

Error

39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661 39.7661

0.19423 0.09587 0.06242 0.04645 0.0367 0.03078 0.02473 0.02165 0.01782 0.02113 0.02029 0.01545 0.01172 0.00433 -0.00745 -0.01992 -0.02914 -0.03867 -0.00833 0.03199

N od e s 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000

39.96033 39.86197 39.82852 39.81255 39.8028 39.79688 39.79083 39.78775 39.78392 39.78723 39.78639 39.78155 39.77782 39.77043 39.75865 39.74618 39.73696 39.72743 39.75777 39.79809 Tab le 6 .4 .6

[The input (say 100) for number of division will divide the range of x and y in 100 equal parts. These points of division of x and y range are equispaced nodes for x and y series.]

The graph 6.4.1 displays the evaluated values of our first (2-D) integral using equispaced nodes.

[147]

Value Of Integral

40 3 9 .9 5 3 9 .9 3 9 .8 5 3 9 .8 3 9 .7 5 3 9 .7 0

500

1000

1500

2000

2500

No. of Nodes V a lu e O f I n t e g r a l U s in g E q u is p c e d

N ode s

T r u e V a lu e O f I n t e g r a l

G rap h 6 .4 .1

Here we find that using the files of random number of size 1000 minimum error in the value of integral is corresponding

to

combination

olrorg1

&

olrr1

and

similarly for the files of size 2000, 3000, 4000 and 5000

the

best

combinations

are

int_1_2

&

olrorg2,

int_2_3 & int_1_3, olgp4 & int_3_4 and int_3_5 & olrr5.

SECOND INTEGRAL (2-D) (USING RANDOM NODES) Our second integral under investigation is

I

5

For the evaluation of this integral we shall use the same program PROG6_1R.BAS but the line 390 which is responsible

for

the

construction

should be modified. [148]

of

the

integrand

The modified form of line 390 is 390

The

DEF FNI(A,B)= A*B*( 1 + A + B)

same

PROG6_1R.BAS

program

with

above

modification is stored by the name of PROG6_2R.BAS On

execution

of

this

program

PROG6_2R.BAS,

corresponding to data size of 1000 and choosing

INT_1_1.DAT for x-series and

INT_2_1.DAT for y-series

and Limits of integration : 1 to 2 for x-variable Limits of integration : 0 to 3 for y-variable

we get the following OUTPUT By Monte Carlo Integration:Using Random Data Files: G:INT_1_1.DAT

and G:INT_2_1.DAT

Value of Integral

=

31.43739

By repeated execution of this program for all the 30 combinations of files for x and y series, we get the observations depicted in tables numbered 6.5.1; 6.5.2 ; 6.5.3 ;6.5.4 and 6.5.5

[149]

S E CO N D IN T E G R A L (2-D ) Usin g 1000 R a n d o m D a ta S .N o .

File N a m e

T ru e v a lu e In teg ra l

Va lu e O f In teg ra l Usin g

E rro r

R a n d o m N o d es

1

in t_1_1 & in t_2_1

30.75

31.43739

0.68739

2

in t_1_1 & in t_3_1

30.75

30.36758

-0.3824

3

in t_1_1 & olrr1

30.75

30.52351

-0.2265

4

in t_1_1 & olrorg1

30.75

31.08795

0.33795

5

in t_1_1 & olgp 1

30.75

31.46704

0.71704

6

in t_2_1 & in t_1_1

30.75

30.17116

-0.5788

7

in t_2_1 & in t_3_1

30.75

31.31632

0.56632

8

in t_2_1 & olrr1

30.75

30.97057

0.22057

9

in t_2_1 & olrorg1

30.75

31.60234

0.85234

10

in t_2_1 & olgp 1

30.75

31.96182

1.21182

11

in t_3_1 & in t_1_1

30.75

29.81905

-0.9309

12

in t_3_1 & in t_2_1

30.75

32.08098

1.33098

13

in t_3_1 & olrr1

30.75

30.95432

0.20432

14

in t_3_1 & olrorg1

30.75

31.25104

0.50104

15

in t_3_1 & olgp 1

30.75

31.38055

0.63055

16

olrr1 & in t_1_1

30.75

30.00544

-0.7446

17

olrr1 & in t_2_1

30.75

31.73992

0.98992

18

olrr1 & in t_3_1

30.75

30.98626

0.23626

19

olrr1 & olrorg1

30.75

31.17065

0.42065

20

olrr1 & olgp 1

30.75

31.55417

0.80417

21

olorrg1 & in t_1_1

30.75

30.23758

-0.5124

22

olrorg1 & in t_2_1

30.75

32.0158

1.2658

23

olrorg1 & in t_3_1

30.75

30.9384

0.1884

24

olrorg1 & olrr1

30.75

30.82553

0.07553

25

olrorg1 & olgp 1

30.75

31.83072

1.08072

26

olgp 1 & in t_1_1

30.75

30.33429

-0.4157

27

olgp 1 & in t_2_1

30.75

32.142

1.392

28

olgp 1 & in t_3_1

30.75

30.77216

0.02216

29

olgp 1 & olrr1

30.75

30.9283

0.1783

30

olgp 1 & olrorg1

30.75

31.60284

0.85284

Tab le 6 .5 .1

[150]

S E CO N D IN T E G R A L (2-D ) Usin g 2000 R a n d o m D a ta S .N o .

File N a m e

T ru e v a lu e In teg ra l

Va lu e O f In teg ra l Usin g

E rro r

R a n d o m N o d es

1

int_1_2 & int_2_2

30.75

31.6231

0.8731

2

int_1_2 & int_3_2

30.75

30.92063

0.17063

3

int_1_2 & olrr2

30.75

31.26525

0.51525

4

int_1_2 & olrorg2

30.75

30.64673

-0.1033

5

int_1_2 & olgp2

30.75

30.87801

0.12801

6

int_2_2 & int_1_2

30.75

30.49341

-0.2566

7

int_2_2 & int_3_2

30.75

31.64652

0.89652

8

int_2_2 & olrr2

30.75

31.80289

1.05289

9

int_2_2 & olrorg2

30.75

31.19431

0.44431

10

int_2_2 & olgp2

30.75

31.627

0.877

11

int_3_2 & int_1_2

30.75

30.22645

-0.5236

12

int_3_2 & int_2_2

30.75

32.06994

1.31994

13

int_3_2 & olrr2

30.75

31.48865

0.73865

14

int_3_2 & olrorg2

30.75

30.93175

0.18175

15

int_3_2 & olgp2

30.75

31.26737

0.51737

16

olrr2 & int_1_2

30.75

30.43152

-0.3185

17

olrr2 & int_2_2

30.75

32.09504

1.34504

18

olrr2 & int_3_2

30.75

31.33867

0.58867

19

olrr2 & olrorg2

30.75

31.08956

0.33956

20

olrr2 & olgp2

30.75

31.33671

0.58671

21

olorrg2 & int_1_2

30.75

30.23398

-0.516

22

olrorg2 & int_2_2

30.75

31.8818

1.1318

23

olrorg2 & int_3_2

30.75

31.19252

0.44252

24

olrorg2 & olrr2

30.75

31.50337

0.75337

25

olrorg2 & olgp2

30.75

31.09093

0.34093

26

olgp2 & int_1_2

30.75

30.22936

-0.5206

27

olgp2 & int_2_2

30.75

32.10566

1.35566

28

olgp2 & int_3_2

30.75

31.28968

0.53968

29

olgp2 & olrr2

30.75

31.53782

0.78782

30

olgp2 & olrorg2

30.75

30.85392

0.10392

Tab le 6 .5 .2

[151]

S E CO N D IN T E G R A L (2-D ) Usin g 3000 R a n d o m D a ta S .N o .

File N a m e

T ru e v a lu e In teg ra l

Va lu e O f In teg ra l Usin g

E rro r

R a n d o m N o d es

1

int_1_3 & int_2_3

30.75

31.25389

0.50389

2

int_1_3 & int_3_3

30.75

30.26438

-0.4856

3

int_1_3 & olrr3

30.75

30.81432

0.06432

4

int_1_3 & olrorg3

30.75

30.9223

0.1723

5

int_1_3 & olgp3

30.75

31.10889

0.35889

6

int_2_3 & int_1_3

30.75

30.80084

0.05084

7

int_2_3 & int_3_3

30.75

30.39417

-0.3558

8

int_2_3 & olrr3

30.75

30.83923

0.08923

9

int_2_3 & olrorg3

30.75

31.09344

0.34344

10

int_2_3 & olgp3

30.75

31.16709

0.41709

11

int_3_3 & int_1_3

30.75

30.47429

-0.2757

12

int_3_3 & int_2_3

30.75

31.02125

0.27125

13

int_3_3 & olrr3

30.75

30.46015

-0.2899

14

int_3_3 & olrorg3

30.75

30.91808

0.16808

15

int_3_3 & olgp3

30.75

30.72772

-0.0223

16

olrr3 & int_1_3

30.75

30.82094

0.07094

17

olrr3 & int_2_3

30.75

31.31246

0.56246

18

olrr3 & int_3_3

30.75

30.29401

-0.456

19

olrr3 & olrorg3

30.75

30.9082

0.1582

20

olrr3 & olgp3

30.75

30.87106

0.12106

21

olorrg3 & int_1_3

30.75

30.68868

-0.0613

22

olrorg3 & int_2_3

30.75

31.29243

0.54243

23

olrorg3 & int_3_3

30.75

30.48787

-0.2621

24

olrorg3 & olrr3

30.75

30.6517

-0.0983

25

olrorg3 & olrr3

30.75

30.99161

0.24161

26

olgp3 & int_1_3

30.75

30.87649

0.12649

27

olgp3 & int_2_3

30.75

31.38354

0.63354

28

olgp3 & int_3_3

30.75

30.31921

-0.4308

29

olgp3 & olrr3

30.75

30.61178

-0.1382

30

olgp3 & olrorg3

30.75

31.00903

0.25903

Tab le 6 .5 .3

[152]

S E CO N D IN T E G R A L (2-D ) Usin g 4000 R a n d o m D a ta S .N o .

File N a m e

T ru e v a lu e In teg ra l

Va lu e O f In teg ra l Usin g

E rro r

R a n d o m N o d es

1

int_1_4 & int_2_4

30.75

30.53157

-0.2184

2

int_1_4 & int_3_4

30.75

30.48779

-0.2622

3

int_1_4 & olrr4

30.75

30.19908

-0.5509

4

int_1_4 & olrorg4

30.75

30.70143

-0.0486

5

int_1_4 & olgp4

30.75

30.89425

0.14425

6

int_2_4 & int_1_4

30.75

30.50034

-0.2497

7

int_2_4 & int_3_4

30.75

30.60579

-0.1442

8

int_2_4 & olrr4

30.75

30.24078

-0.5092

9

int_2_4 & olrorg4

30.75

30.57272

-0.1773

10

int_2_4 & olgp4

30.75

30.7978

0.0478

11

int_3_4 & int_1_4

30.75

30.42601

-0.324

12

int_3_4 & int_2_4

30.75

30.57734

-0.1727

13

int_3_4 & olrr4

30.75

30.1356

-0.6144

14

int_3_4 & olrorg4

30.75

30.61163

-0.1384

15

int_3_4 & olgp4

30.75

31.05537

0.30537

16

olrr4 & int_1_4

30.75

30.41812

-0.3319

17

olrr4 & int_2_4

30.75

30.47468

-0.2753

18

olrr4 & int_3_4

30.75

30.41425

-0.3358

19

olrr4 & olrorg4

30.75

30.41584

-0.3342

20

olrr4 & olgp4

30.75

30.95341

0.20341

21

olorrg4 & int_1_4

30.75

30.67701

-0.073

22

olrorg4 & int_2_4

30.75

30.56059

-0.1894

23

olrorg4 & int_3_4

30.75

30.64441

-0.1056

24

olrorg4 & olrr4

30.75

30.18126

-0.5687

25

olrorg4 & olgp4

30.75

30.73393

-0.0161

26

olgp4 & int_1_4

30.75

30.6046

-0.1454

27

olgp4 & int_2_4

30.75

30.53114

-0.2189

28

olgp4 & int_3_4

30.75

30.8216

0.0716

29

olgp4 & olrr4

30.75

30.44862

-0.3014

30

olgp4 & olrorg4

30.75

30.48005

-0.27

Tab le 6 .5 .4

[153]

S E CO N D IN T E G R A L (2-D ) Usin g 5000 R a n d o m D a ta S .N o .

File N a m e

T ru e v a lu e In teg ra l

Va lu e O f In teg ra l Usin g

E rro r

R a n d o m N o d es

1

int_1_5 & int_2_5

30.75

30.92533

0.17533

2

int_1_5 & int_3_5

30.75

30.51069

-0.2393

3

int_1_5 & olrr5

30.75

30.83877

0.08877

4

int_1_5 & olrorg5

30.75

31.12194

0.37194

5

int_1_5 & olgp5

30.75

30.69875

-0.0512

6

int_2_5 & int_1_5

30.75

30.91622

0.16622

7

int_2_5 & int_3_5

30.75

30.60986

-0.1401

8

int_2_5 & olrr5

30.75

30.80638

0.05638

9

int_2_5 & olrorg5

30.75

31.15211

0.40211

10

int_2_5 & olgp5

30.75

30.76805

0.01805

11

int_3_5 & int_1_5

30.75

30.83473

0.08473

12

int_3_5 & int_2_5

30.75

30.94092

0.19092

13

int_3_5 & olrr5

30.75

30.66908

-0.0809

14

int_3_5 & olrorg5

30.75

30.71139

-0.0386

15

int_3_5 & olgp5

30.75

30.46885

-0.2812

16

olrr5 & int_1_5

30.75

30.95884

0.20884

17

olrr5 & int_2_5

30.75

30.92807

0.17807

18

olrr5 & int_3_5

30.75

30.45995

-0.2901

19

olrr5 & olrorg5

30.75

30.96872

0.21872

20

olrr5 & olgp5

30.75

30.6121

-0.1379

21

olorrg5 & int_1_5

30.75

31.10125

0.35125

22

olrorg5 & int_2_5

30.75

31.14019

0.39019

23

olrorg5 & int_3_5

30.75

30.36779

-0.3822

24

olrorg5 & olrr5

30.75

30.84071

0.09071

25

olrorg5 & olgp5

30.75

30.68909

-0.0609

26

olgp5 & int_1_5

30.75

30.92736

0.17736

27

olgp5 & int_2_5

30.75

31.02853

0.27853

28

olgp5 & int_3_5

30.75

30.3857

-0.3643

29

olgp5 & olrr5

30.75

30.74625

-0.0038

30

olgp4 & olrorg4

30.75

30.92493

0.17493

Tab le 6 .5 .5

[154]

SECOND INTEGRAL (2-D) (USING EQUISPACED NODES) For the evaluation of the integral

I

5

By using equispaced nodes, we shall take use of the same program PROG6_1E.BAS in which the limits of integration are being supplied within the program. For different

integral

of

2-dimension

the

user

defined

function (line 20 ) should be changed and the limits of integration should be supplied in the INPUT session. By doing so the program will be more elaborate one.As we are concerned here with a specific integral, we have supplied the limits inside the program. The modified forms of line 20 and 30 should be 20

DEF FNI(A,B)= A*B *( 1+ A + B )

30

CLS:XLO = 1:XUP = 2:YLO = 0:YUP = 3

The PROG6_1E.BAS with above two modifications is being stored by the name of PROG6_2E.BAS. On execution of this program PROG6_2E.BAS we are prompted as

No of Equispaced Nodes ?

Inputting 100 for this requirement we get the output as [155]

Divisions = 100 By

repeated

200,300,...,

2000

Value = 31.26226 execution divisions

of

this

we

get

program the

observations S ECO N D IN TEGRA L (2-D )-BY EQ UIS P A CED N O D ES N o. of S. N o. Equispace d V alue O f Inte gral True V alue

Error

N ode s 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000

31.26226 31.00549 30.92027 30.87804 30.85209 30.83486 30.82266 30.81346 30.80615 30.79992 30.7935 30.79036 30.7849 30.77986 30.7731 30.77006 30.76382 30.76133 30.75408 30.74195 Table 6 .5 .6

[156]

30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75 30.75

0.51226 0.25549 0.17027 0.12804 0.10209 0.08486 0.07266 0.06346 0.05615 0.04992 0.0435 0.04036 0.0349 0.02986 0.0231 0.02006 0.01382 0.01133 0.00408 -0.00805

for

following

The graph 6.5.1 displays the evaluated values of

Value Of Integral

our first (2-D) integral using equispaced nodes.

No. of Nodes

Here we find that using the files of random number of size 1000 minimum error in the value of integral is corresponding

to

combination

olgp1

&

int_3_1

and

similarly for the files of size 2000, 3000, 4000 and 5000

the

best

combinations

are

int_1_2

&

olrorg2,

int_3_3 & olgp3, olrorg4 & olgp4 and olgp5 & olrr5.

[157]

THIRD INTEGRAL (2-D) (USING RANDOM NODES) Our third and last integral under investigation is

I

6

For the evaluation of this integral we shall use the same program PROG6_1R.BAS but the line 390 which is responsible

for

the

construction

of

the

integrand

should be modified. The modified form of line 390 is 390

DEF FNI(A,B)= A/B + B/A

The program PROG6_1R.BAS with above modification is stored by the name of PROG6_3R.BAS In this program the limits of integration are to be

supplied

at

every

execution.

IF

the

limits

of

integration are submitted in the program then execution will be quite fast. By repeated execution of this program for all the 30 combinations of files for x and y series, we get the observations depicted in tables 6.6.1, 6.6.2, 6.6.3, 6.6.4 & 6.6.5 on next pages. The high lighted entry in each table is for the least error. [158]

TH IRD IN TEGRA L (2-D ) Usin g 1000 Ran d o m D ata S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

File N am e int_1_1 & int_2_1 int_1_1 & int_3_1 int_1_1 & olrr1 int_1_1 & olrorg1 int_1_1 & olgp1 int_2_1 & int_1_1 int_2_1 & int_3_1 int_2_1 & olrr1 int_2_1 & olrorg1 int_2_1 & olgp1 int_3_1 & int_1_1 int_3_1 & int_2_1 int_3_1 & olrr1 int_3_1 & olrorg1 int_3_1 & olgp1 olrr1 & int_1_1 olrr1 & int_2_1 olrr1 & int_3_1 olrr1 & olrorg1 olrr1 & olgp1 olorrg1 & int_1_1 olrorg1 & int_2_1 olrorg1 & int_3_1 olrorg1 & olrr1 olrorg1 & olgp1 olgp1 & int_1_1 olgp1 & int_2_1 olgp1 & int_3_1 olgp1 & olrr1 olgp1 & olrorg1

Tru e v alu e In teg ral 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 Table 6 .6 .1

[159]

Valu e O f In teg ral Usin g

Erro r

Ran d o m N o d es 9.420214 9.366838 9.34217 9.366514 9.372259 9.318706 9.304336 9.338642 9.340624 9.358641 9.350452 9.378662 9.333392 9.371546 9.422638 9.335342 9.426064 9.34276 9.391445 9.404498 9.328801 9.41467 9.363309 9.376181 9.399275 9.258329 9.335519 9.332606 9.30249 9.301378

0.05595 0.00258 -0.0221 0.00225 0.008 -0.0456 -0.0599 -0.0256 -0.0236 -0.0056 -0.0138 0.0144 -0.0309 0.00728 0.05838 -0.0289 0.0618 -0.0215 0.02718 0.04024 -0.0355 0.05041 -0.001 0.01192 0.03501 -0.1059 -0.0287 -0.0317 -0.0618 0.06288

TH IR D IN TE G R A L (2-D ) Usin g 2000 R an d o m D ata S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

File N am e int_1_2 & int_2_2 int_1_2 & int_3_2 int_1_2 & olrr2 int_1_2 & olrorg2 int_1_2 & olgp2 int_2_2 & int_1_2 int_2_2 & int_3_2 int_2_2 & olrr2 int_2_2 & olrorg2 int_2_2 & olgp2 int_3_2 & int_1_2 int_3_2 & int_2_2 int_3_2 & olrr2 int_3_2 & olrorg2 int_3_2 & olgp2 olrr2 & int_1_2 olrr2 & int_2_2 olrr2 & int_3_2 olrr2 & olrorg2 olrr2 & olgp2 olorrg2 & int_1_2 olrorg2 & int_2_2 olrorg2 & int_3_2 olrorg2 & olrr2 olrorg2 & olgp2 olgp2 & int_1_2 olgp2 & int_2_2 olgp2 & int_3_2 olgp2 & olrr2 olgp2 & olrorg2

Tru e v alu e In teg ral 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 Table 6 .6 .2

[160]

Valu e O f In teg ral Usin g

E rro r

R an d o m N o d es 9.447456 9.42229 9.4193 9.39709 9.423319 9.317266 9.336551 9.349521 9.325439 9.328248 9.326523 9.372768 9.364449 9.340219 9.355754 9.322908 9.381931 9.368069 9.351855 9.364408 9.337916 9.403285 9.382279 9.390222 9.392703 9.328907 9.364824 9.363936 9.36267 9.358396

0.08319 0.05803 0.05504 0.03283 0.05906 -0.047 -0.0277 -0.0147 -0.0388 -0.036 -0.0377 0.00851 0.00019 -0.024 -0.0085 -0.0414 0.01767 0.00381 -0.0124 0.00015 -0.0263 0.03902 0.01802 0.02596 0.02844 -0.0354 0.00056 -0.0003 -0.0016 -0.0059

TH IR D IN TE G R A L (2-D ) Usin g 3000 R an d o m D ata S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

File N am e int_1_3 & int_2_3 int_1_3 & int_3_3 int_1_3 & olrr3 int_1_3 & olrorg3 int_1_3 & olgp3 int_2_3 & int_1_3 int_2_3 & int_3_3 int_2_3 & olrr3 int_2_3 & olrorg3 int_2_3 & olgp3 int_3_3 & int_1_3 int_3_3 & int_2_3 int_3_3 & olrr3 int_3_3 & olrorg3 int_3_3 & olgp3 olrr3 & int_1_3 olrr3 & int_2_3 olrr3 & int_3_3 olrr3 & olrorg3 olrr3 & olgp3 olorrg3 & int_1_3 olrorg3 & int_2_3 olrorg3 & int_3_3 olrorg3 & olrr3 olrorg3 & olrr3 olgp3 & int_1_3 olgp3 & int_2_3 olgp3 & int_3_3 olgp3 & olrr3 olgp3 & olrorg3

Tru e v alu e In teg ral 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 Table 6 .6 .3

[161]

Valu e O f In teg ral Usin g

E rro r

R an d o m N o d es 9.400719 9.3655601 9.347464 9.392529 9.366111 9.341566 9.331951 9.32712 9.352968 9.346246 9.401212 9.436951 9.400928 9.406551 9.425275 9.339031 9.37653 9.348746 9.3812 9.37525 9.339586 9.364608 9.313887 9.340745 9.351619 9.33574 9.376961 9.350988 9.358706 9.370641

0.03646 0.0013 -0.0168 0.02827 0.00185 -0.0227 -0.0323 -0.0371 -0.0113 -0.018 0.03695 0.07269 0.03667 0.04229 0.06101 -0.0252 0.01227 -0.0155 0.01694 0.01099 -0.0247 0.00035 -0.0504 -0.0235 -0.0126 -0.0285 0.0127 -0.0133 -0.0056 0.00638

TH IRD IN TEGRA L (2-D ) Usin g 4000 Ran d o m D ata S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

File N am e int_1_4 & int_2_4 int_1_4 & int_3_4 int_1_4 & olrr4 int_1_4 & olrorg4 int_1_4 & olgp4 int_2_4 & int_1_4 int_2_4 & int_3_4 int_2_4 & olrr4 int_2_4 & olrorg4 int_2_4 & olgp4 int_3_4 & int_1_4 int_3_4 & int_2_4 int_3_4 & olrr4 int_3_4 & olrorg4 int_3_4 & olgp4 olrr4 & int_1_4 olrr4 & int_2_4 olrr4 & int_3_4 olrr4 & olrorg4 olrr4 & olgp4 olorrg4 & int_1_4 olrorg4 & int_2_4 olrorg4 & int_3_4 olrorg4 & olrr4 olrorg4 & olgp4 olgp4 & int_1_4 olgp4 & int_2_4 olgp4 & int_3_4 olgp4 & olrr4 olgp4 & olrorg4

Tru e v alu e In teg ral 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 Table 6 .6 .4

[162]

Valu e O f In teg ral Usin g

Erro r

Ran d o m N o d es 9.362626 9.375683 9.354184 9.353345 9.387814 9.365006 9.365537 9.352472 9.369393 9.394846 9.373025 9.358821 9.359627 9.36331 9.372267 9.366014 9.36462 9.375156 9.377719 9.376168 9.33679 9.354339 9.349858 9.346869 9.346869 9.353461 9.359831 9.341652 9.329079 9.371125

-0.0016 0.01142 -0.0101 -0.0109 0.02355 0.00074 0.00127 -0.0118 0.00513 0.03058 0.00876 -0.0054 -0.0046 -0.001 0.00801 0.00175 0.00036 0.01089 0.01346 0.01191 -0.0275 -0.0099 -0.0144 -0.0174 -0.0174 -0.0108 -0.0044 -0.0226 -0.0352 0.00686

TH IRD IN TEGRA L (2-D ) Usin g 5000 Ran d o m D ata S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

File N am e int_1_5 & int_2_5 int_1_5 & int_3_5 int_1_5 & olrr5 int_1_5 & olrorg5 int_1_5 & olgp5 int_2_5 & int_1_5 int_2_5 & int_3_5 int_2_5 & olrr5 int_2_5 & olrorg5 int_2_5 & olgp5 int_3_5 & int_1_5 int_3_5 & int_2_5 int_3_5 & olrr5 int_3_5 & olrorg5 int_3_5 & olgp5 olrr5 & int_1_5 olrr5 & int_2_5 olrr5 & int_3_5 olrr5 & olrorg5 olrr5 & olgp5 olorrg5 & int_1_5 olrorg5 & int_2_5 olrorg5 & int_3_5 olrorg5 & olrr5 olrorg5 & olgp5 olgp5 & int_1_5 olgp5 & int_2_5 olgp5 & int_3_5 olgp5 & olrr5 olgp4 & olrorg4

Tru e v alu e In teg ral 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 9.364262 Table 6 .6 .5

[163]

Valu e O f In teg ral Usin g

Erro r

Ran d o m N o d es 9.368461 9.338088 9.350269 9.345494 9.339171 9.367647 9.334116 9.353012 9.34354 9.339539 9.371835 9.368114 9.372702 9.387006 9.366412 9.379161 9.383882 9.367675 9.375089 9.369307 9.367277 9.365444 9.374842 9.365746 9.361262 9.375604 9.370334 9.365906 9.371795 9.378934

0.0042 -0.0262 -0.014 -0.0188 -0.0251 0.00338 -0.0301 -0.0113 -0.0207 -0.0247 0.00757 0.00385 0.00844 0.02274 0.00215 0.0149 0.01962 0.00341 0.01083 0.00504 0.00301 0.00118 0.01058 0.00148 -0.003 0.01134 0.00607 0.00164 0.00753 0.01467

THIRD INTEGRAL (2-D) (USING EQUISPACED NODES) For the evaluation of our third integral

I

6

By using equispaced nodes, we shall take use of the same program PROG6_1E.BAS with a change in line 20 and 30.The modified forms of line 20 and 30 should be

20

DEF FNI (A,B)= (A/B) + (B/A)

30

CLS: XLO = 1: XUP = 3: YLO = 2: YUP = 4

The PROG6_1E.BAS with above two modifications is being stored by the name of PROG6_3E.BAS.

Just to ease our repeated execution of the program for same limits of integration we have supplied the limits of integration within the program in line 30 On execution of this program PROG6_3E.BAS we are prompted as

No of Equispaced Nodes?

[164]

Inputting 100 for this requirement we get the output as

Divisions = 100

By

repeated

200,300,...,2000

Value = 31.26226

execution divisions

of we

this get

program the

for

following

observations

Here we find that using the files of random number of size 1000 minimum error in the value of integral is corresponding

to

combination

olrorg1

&

int_3_1

and

similarly for the files of size 2000, 3000, 4000 and 5000 the best combinations are olrr2 & olgp2, olrorg3 & int_2_3, olrr4 & int_2_4, olrorg5 & int_2_5.

Observations: Value

of

integral

corresponding

to

the

best

combinations for the files of size 1000 is not giving the same or better accuracy for the files of size 2000, 3000, 4000 and 5000 [see tables of this chapter] which makes our observation as.

[165]

Observation 6.1 Value of all the single integrals doesn't follow any

pattern

combinations

corresponding which

files

of

random

nodes

the

value

steadily

is

best

numbers of

approaches

to for

whereas

integral to

the

any any

exact

size

using

follow

of

a

value

of

the data

equispaced pattern of

and

integral

[see graph 6.4.1, 6.5.1, 6.6.1].

Observation 6.2 True value of integral is almost achieved using only 2000 equispaced points for x and y range.

[166]

CHAPTER -7 M C INTEGRATION (3-DIMENSION)

[167]

INTEGRAL EVALUATION (THREE DIMENSIONAL) (USING RANDOM & EQUISPACED NODES) During the course of this chapter we shall evaluate two 3-D Integrals[31,34]using random as well as equispaced nodes. Our first integral under investigation is

I

7

Whose exact value is 224. [168]

Where as the second integral is

I

8

Whose exact value is 5.073214.

FIRST INTEGRAL (3-D) (USING RANDOM NODES) In order to evaluate the integral

I

7

We

shall

dimension.The

modify

the

modified

program form

of

PROG6_1R.BAS

this

to

program

PROG7_1R.BAS given as below

PROG7_1R.BAS 10 20 30 40 50 60 70 80 90 100

CLS: KEY OFF:DIM F$(30) LOCATE 10,5: INPUT "Give drive letter of data files"; D$ :CLS FOR I = 1 TO 30 :READ F$(I) : NEXT I DATA"INT_1_1.DAT","INT_2_1.DAT", "INT_3_1.DAT","olrr1.DAT", "olrorg1.DAT" ,"olgp1.DAT" DATA "INT_1_2.DAT", "INT_2_2.DAT", INT_3_2.DAT", "olrr2.DAT", "olrorg2.DAT", "olgp2.DAT" DATA "INT_1_3.DAT", "INT_2_3.DAT", "INT_3_3.DAT", "olrr3.DAT","olrorg3.DAT", "olgp3.DAT" DATA "INT_1_4.DAT" ,"INT_2_4.DAT", "INT_3_4.DAT"," olrr4.DAT","olrorg4.DAT", "olgp4.DAT" DATA "INT_1_5.DAT","INT_2_5.DAT", "INT_3_5.DAT", "olrr5.DAT","olrorg5.DAT", "olgp5.DAT" FOR I = 1 TO 30 : F$(I)=D$+":"+F$(I) :NEXT I LOCATE 10,2: PRINT "Choose your DATA FILE size": LOCATE 16,1

[169]

3is

110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 325 330 340 350 360 361 370

380

390

400

410

420

FOR I=1 TO 5: PRINT I; ". ";I*1000, :NEXT I LOCATE 18,2:INPUT "Select choice Number" ; C : CLS IF C=1 THEN LOI = 1:IF C = 1 THEN UPI = 6 IF C=2 THEN LOI =7:IF C = 2 THEN UPI = 12 IF C=3 THEN LOI =13:IF C=3 THEN UPI = 18 IF C=4 THEN LOI =19:IF C=4 THEN UPI = 24 IF C=5 THEN LOI = 25:IF C=5 THEN UPI= 30 DS=C*1000 LOCATE 10,5:PRINT "Select the Data file " : LOCATE 12,1 FOR I= LOI TO UPI : PRINT K+1;". "+F$(I),:K=K+1:NEXT I LOCATE 15,1:INPUT "For x-range type your File Number";C1 IF C1 =< 0 OR C1 > 6 THEN 230 ELSE 240 LOCATE 15,1:PRINT " " : GOTO 210 LOCATE 17,1:INPUT "For y-range type your File Number";C2 IF C2 =< 0 OR C2 > 6 THEN 260 ELSE 270 LOCATE 17,1:PRINT " " : GOTO 240 LOCATE 19,1:INPUT "For z-range type your File Number";C3 IF C3 =< 0 OR C3 > 6 THEN 290 ELSE 300 LOCATE 19,1:PRINT " " : GOTO 240 IF C1=C2 OR C2=C3 OR C3=C1 THEN 310 ELSE 370 LOCATE 22,1 : PRINT"You have to choose distinct files" ANS$=INKEY$:IF ANS$="" THEN 320 ELSE 325 LOCATE 22,1:PRINT" " LOCATE 15,1:PRINT" " LOCATE 17,1:PRINT" " LOCATE 18,1:PRINT" " LOCATE 19,1:PRINT" " : GOTO 210 LOCATE 22,1:PRINT" " : GOTO 210 IF C=1 THEN C1=C1 : IF C=1 THEN C2=C2 : IF C=1 THEN C3=C3 IF C=2 THEN C1=C1+6 : IF C=2 THEN C2=C2+6: IF C=2 THEN C3=C3+6 IF C=3 THEN C1=C1+12 : IF C=3 THEN C2=C2+12 : IF C=3 THEN C3=C3+12 IF C=4 THEN C1=C1+18 : IF C=4 THEN C2=C2+18 : IF C=4 THEN C3=C3+18 IF C=5 THEN C1=C1+24 : IF C=5 THEN C2=C2+24 : IF C=5 THEN C3=C3+24 F1$=F$(C1):F2$=F$(C2):F3$=F$(C3):CLS

[170]

430 440 450 460 470 480 490 500

510 520 530 540 550 560 570 580 590 600 610 620 630

DEF FNI(A,B,C)= A*A+B*B+C*C LOCATE 10,5: INPUT "Lower limit for x-variable ";XLO LOCATE 12,5: INPUT "Upper limit for x-variable ";XUP LOCATE 14,5: INPUT "Lower limit for y-variable ";YLO LOCATE 16,5: INPUT "Upper limit for y-variable ";YUP LOCATE 18,5: INPUT "Lower limit for z-variable ";ZLO LOCATE 20,5: INPUT "Upper limit for z-variable ";ZUP:CLS H=(XUP-XLO)/DS: K=(YUP-YLO)/DS: L=(ZUP-ZLO)/DS OPEN F1$ FOR INPUT AS #1 OPEN F2$ FOR INPUT AS #2 OPEN F3$ FOR INPUT AS #3 INPUT #1,X : X=X*(XUP-XLO) INPUT #2,Y : Y=Y*(YUP-YLO) INPUT #3,Z : Z=Z*(ZUP-ZLO) Y = YLO+Y:X = XLO+X:Z = ZLO+Z: SUM = SUM + FNI(X,Y,Z) IF NOT EOF(1) THEN 540 SUM = SUM/DS : SUM = SUM*(XUP-XLO)*(YUP-YLO)*(ZUP-ZLO) LOCATE 8,10 : PRINT "By Monte-Carlo Integration :-" LOCATE 10,10 : PRINT "Using Random data files: "; F1$;" , ";F2$;" , ";F3$ LOCATE 12,10 : PRINT "Value of integral ";SUM CLOSE:END

On execution of this program we are first required to input the drive letter where the Random Data Files are stored. Then after we are required to choose the size of the DATA FILE by inputting the choice number 1,2,3,4 or 5 corresponding to the sizes of 1000, 2000, 3000, 4000 and 5000 data. Next, all the six data files of the required size are depicted on the screen. Out of these six data files we have to choose one data file for x-series and one data file for y-series and one data files for z-series. [171]

All these three files should be distinct otherwise the program will remind the user to select different data files

and

the

control

will

again

go

to

the

file

selection module. After this selection, limits of integration for xvariable as well as for y-variable and z-variable are to be inputted. Now the INPUT session is complete and finally the evaluated values of the integral by Monte Carlo Method using random nodes are displayed. Corresponding to data size of 1000 and choosing INT_1_1.DAT for x-series INT_2_1.DAT for y-series INT_3_1.DAT for y-series While Limits of integration are inputted as -1 to +1 for x-variable -2 to +2 for y-variable -3 to +3 for z-variable We get the following OUTPUT By Monte Carlo Integration:Using Random Data Files:

[172]

G:INT_1_1.DAT,G:INT_2_1.DAT,G:INT_3_1.DAT Value of Integral = 223.1427

Out of the six data files for 1000 data size there can be 120 different combinations of data files for xseries and y-series and z-series. The execution of this program 120 times is a time consuming

job

coupled

with

a

strain

of

awarding

distinct possible codes for the files of x, y and z series which seems very ludicrous. To avoid this drawback we shall now modify this program to get all the results of 120 combinations of files one by one. PROG7_2R.BAS 10 15 20 25 30 35 40 45 50 55 60 65 70

DIM KC1(120):DIM KC2(120):DIM KC3(120): DIM F$(30):CD=1:CLS:COUNT=1 DEF FNI(A,B,C)= A*A+B*B+C*C XLO=-1:XUP=1:YLO=-2:YUP=2:ZLO=-3:ZUP=3 FOR I=1 TO 6 FOR J=1 TO 6 FOR K=1 TO 6 IF I J AND JK AND K I THEN 45 ELSE 55 KC1(CD)= I:KC2(CD)=J:KC3(CD)=K CD = CD + 1 NEXT K:NEXT J:NEXT I LOCATE 10,5:INPUT "Give drive letter of data files";D$:CLS FOR I = 1 TO 30 :READ F$(I) :NEXT I DATA "INT_1_1.DAT", "INT_2_1.DAT", "INT_3_1.DAT", "olrr1.DAT", "olrorg1.DAT", "olgp1.DAT"

[173]

75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200 205 210 215 220 225 230 235 240

DATA "INT_1_2.DAT", "INT_2_2.DAT", "INT_3_2.DAT", "olrr2.DAT", "olrorg2.DAT", "olgp2.DAT" DATA "INT_1_3.DAT", "INT_2_3.DAT", "INT_3_3.DAT", "olrr3.DAT", "olrorg3.DAT", "olgp3.DAT" DATA "INT_1_4.DAT", "INT_2_4.DAT", "INT_3_4.DAT", "olrr4.DAT", "olrorg4.DAT", "olgp4.DAT" DATA "INT_1_5.DAT", "INT_2_5.DAT", "INT_3_5.DAT", "olrr5.DAT", "olrorg5.DAT", "olgp5.DAT" FOR I = 1 TO 30:F$(I)=D$+":"+F$(I):NEXT I LOCATE 10,2 : PRINT "Choose your DATA FILE Size": LOCATE 16,1 FOR I=1 TO 5: PRINT I;". ";I*1000,:NEXT I LOCATE 18,2: INPUT "Select choice Number";C :CLS IF C=1 THEN LOI=1:IF C=1 THEN UPI=6 IF C=2 THEN LOI=7:IF C=2 THEN UPI=12 IF C=3 THEN LOI=13:IF C=3 THEN UPI=18 IF C=4 THEN LOI=19:IF C=4 THEN UPI=24 IF C=5 THEN LOI=25:IF C=5 THEN UPI=30 DS=C*1000 CLS:LOCATE 10,10: PRINT "You have two choices" LOCATE 12,10: PRINT "1. To evaluate the integral for specific files" LOCATE 14,10: PRINT "2. Auto evaluation for all 120 combinations" LOCATE 18,10 : INPUT "Type your choice no...";CHOICE IF CHOICE>2 OR CHOICE 6 THEN 220 ELSE 225 LOCATE 15,1:PRINT " " :GOTO 210 LOCATE 17,1: INPUT "For y-range type your File Number";C2 IF C2 =< 0 OR C2 > 6 THEN 235 ELSE 240 LOCATE 17,1: PRINT " " : GOTO 225 LOCATE 19,1: INPUT "For z-range type your File Number";C3

[174]

245 250 255 260 265 270 275 280 285 290 295 300 305 310 315 320 325 335 340 345 350 355 360 365 370 375 380 385 390 395 400 405 410 415 420 425 430 435

IF C3 =< 0 OR C3 > 6 THEN 250 ELSE 255 LOCATE 19,1:PRINT " " : GOTO 225 IF C1=C2 OR C2=C3 OR C3=C1 THEN 260 ELSE 300 LOCATE 22,1: PRINT"You have to choose distinct files" ANS$=INKEY$:IF ANS$="" THEN 265 ELSE 270 LOCATE 22,1:PRINT" " LOCATE 15,1:PRINT" " LOCATE 17,1:PRINT" " LOCATE 18,1:PRINT" " LOCATE 19,1:PRINT" " : GOTO 210 LOCATE 22,1:PRINT" " : GOTO 210 IF C=1 THEN C1=C1 :IF C=1 THEN C2=C2 :IF C=1 THEN C3=C3 IF C=2 THEN C1=C1+6 :IF C=2 THEN C2=C2+6 :IF C=2 THEN C3=C3+6 IF C=3 THEN C1=C1+12 : IF C=3 THEN C2=C2+12 : IF C=3 THEN C3=C3+12 IF C=4 THEN C1=C1+18 : IF C=4 THEN C2=C2+18 : IF C=4 THEN C3=C3+18 IF C=5 THEN C1=C1+24 : IF C=5 THEN C2=C2+24 : IF C=5 THEN C3=C3+24 F1$=F$(C1):F2$=F$(C2):F3$=F$(C3):CLS LOCATE 10,5 : INPUT "Lower limit for x-variable ";XLO LOCATE 12,5 : INPUT "Upper limit for x-variable ";XUP LOCATE 14,5 : INPUT "Lower limit for y-variable ";YLO LOCATE 16,5 : INPUT "Upper limit for y-variable ";YUP LOCATE 18,5 : INPUT "Lower limit for z-variable ";ZLO LOCATE 20,5 : INPUT "Upper limit for z-variable ";ZUP:CLS H =(XUP-XLO)/DS : K =(YUP-YLO)/DS : L=(ZUP-ZLO)/DS OPEN F1$ FOR INPUT AS #1 OPEN F2$ FOR INPUT AS #2 OPEN F3$ FOR INPUT AS #3 INPUT #1,X : X=X*(XUP-XLO) INPUT #2,Y : Y=Y*(YUP-YLO) INPUT #3,Z : Z=Z*(ZUP-ZLO) Y = YLO+Y: X = XLO+X: Z = ZLO+Z: SUM=SUM+ FNI(X,Y,Z) IF NOT EOF(1) THEN 385 SUM = SUM/DS : SUM = SUM*(XUP-XLO)*(YUP-YLO)*(ZUP-ZLO) LOCATE 8,10 : PRINT "By Monte-Carlo Integration :-" LOCATE 10,10 : PRINT "Using Random data files: "; F1$;" , ";F2$;" , ";F3$ LOCATE 12,10 : PRINT "Value of integral " ; SUM IF CHOICE =1 THEN 435 ELSE 440 CLOSE #1:CLOSE #2 :CLOSE #3:END

[175]

440 445 455 456 460 465 470 475 480 485 490 495 500 505 510 515 520 525 530 535 540 545 550 555 560

On

CLS LOCATE 10,10: PRINT"You have to press any key for next file combination" ANS$ = INKEY$: IF ANS$="" THEN 455 LOCATE 10,10:PRINT" " : CLS C1=KC1(COUNT):C2= KC2(COUNT):C3=KC3(COUNT) IF C=1 THEN C1=C1 :IF C=1 THEN C2=C2: IF C=1 THEN C3=C3 IF C=2 THEN C1=C1+6 :IF C=2 THEN C2=C2+6: :IF C=2 THEN C3=C3+6 IF C=3 THEN C1=C1+12 :IF C=3 THEN C2=C2+12: IF C=3 THEN C3=C3+12 IF C=4 THEN C1=C1+18:IF C=4 THEN C2=C2+18: IF C=4 THEN C3=C3+18 IF C=5 THEN C1=C1+24:IF C=5 THEN C2=C2+24: IF C=5 THEN C3=C3+24 F1$=F$(C1):F2$=F$(C2):F3$=F$(C3) OPEN F1$ FOR INPUT AS #1 OPEN F2$ FOR INPUT AS #2 OPEN F3$ FOR INPUT AS #3 INPUT #1,X: X=X*(XUP-XLO): X=XLO+X INPUT #2,Y: Y=Y*(YUP-YLO): Y=YLO+Y INPUT #3,Z: Z=Z*(ZUP-ZLO): Z=ZLO+Z SUM = SUM+FNI(X,Y,Z) IF NOT EOF(1) THEN 510 SUM = SUM/DS: SUM = SUM*(XUP-XLO)*(YUP-YLO)*(ZUP-ZLO) PRINT " File Codes:";C1;" ";C2;" ";C3; " Value of Integral= ";SUM SUM = 0:COUNT = COUNT+1: CLOSE #1:CLOSE #2:CLOSE #3 IF COUNT < 121 THEN 555 ELSE END ANS$=INKEY$: IF ANS$="" THEN 555 GOTO 460

execution

of

this

program

the

initial

input

session is same as in the previous program. After which the following message appears on screen You have two choices 1. To evaluate the integral for specific files 2. Auto evaluation for all 120 combinations [176]

The choice 1 will give the same execution as that of previous program. Here we choose the choice number 2 to

get

the

value

of

our

first

3-D

integral

corresponding to all the file combinations for x,y and z variable from the set of six data files of chosen size.

As

a

result

of

this

choice

selection

the

following message appears You have to press any key For next file combination Informing the user to press any key after getting one result Pressing

any

key

one

by

one

we

get

the

output

in

following fashion File Codes:- 1 2 3

Value of Integral = 223.1427

File Codes:- 1 2 4

Value of Integral = 223.3168

File Codes:- 1 2 5

Value of Integral = 228.6895 .... ........................ .... ........................

File Codes:- 6 5 2

Value of Integral = 229.8215

File Codes:- 6 5 3

Value of Integral = 223.5679

File Codes:- 6 5 4

Value of Integral = 223.7418

All the above noted 120 results are tabulated in three tables of 40 results as [177]

FIR S T IN T E G R A L (3 -D ) U S IN G 1 0 0 0 R A N D O M D A T A S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

File Co d e x

y

z

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2

2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 1 1 1 1 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6

3 4 5 6 2 4 5 6 2 3 5 6 2 3 4 6 2 3 4 5 3 4 5 6 1 4 5 6 1 3 5 6 1 3 4 6 1 3 4 5

Va lu e o f In t e g r a l 223.1427 223.3168 228.6895 221.908 226.617 220.5375 225.9102 219.1285 226.6942 220.4405 225.9874 219.2058 229.0823 222.8283 223.0026 221.5936 226.0681 219.8146 219.9887 225.3612 218.4288 218.6027 223.9755 217.194 214.0466 222.1087 227.4816 220.6999 214.1236 222.0119 227.5588 220.7771 216.5118 224.4 224.5739 223.165 213.4977 221.3858 221.5598 226.9325 Tab le 7.7.1

[178]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

- 0.8573 - 0.6832 4.6895 - 2.092 2.617 - 3.4625 1.9102 - 4.8715 2.6942 - 3.5595 1.9874 - 4.7942 5.0823 - 1.1717 - 0.9974 - 2.4064 2.0681 - 4.1854 - 4.0113 1.3612 - 5.5712 - 5.3973 - 0.0245 - 6.806 - 9.9534 - 1.8913 3.4816 - 3.3001 - 9.8764 - 1.9881 3.5588 - 3.2229 - 7.4882 0.4 0.5739 - 0.835 - 10.5023 - 2.6142 - 2.4402 2.9325

FIR S T IN T E G R A L (3-D ) U S IN G 1000 R A N D O M D A T A S .N o . 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

File Co d e x

y

z

3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

1 1 1 1 2 2 2 2 4 4 4 4 5 5 5 5 6 6 6 6 1 1 1 1 2 2 2 2 3 3 3 3 5 5 5 5 6 6 6 6

2 4 5 6 1 4 5 6 1 2 5 6 1 2 4 6 1 2 4 5 2 3 5 6 1 3 5 6 1 2 5 6 1 2 3 6 1 2 3 5

Va lu e o f In t e g r a l 223.988 217.9078 223.2806 216.4992 216.1311 224.193 229.5659 222.7846 213.4289 227.5707 226.8639 220.0823 215.8167 229.9588 223.879 222.4701 212.8027 226.9446 220.8649 226.2379 224.0069 217.7531 223.2999 216.5183 216.1502 224.0383 229.5854 222.8036 213.371 227.5126 226.8058 220.0244 215.8361 229.978 223.7243 222.4897 212.8221 226.9638 220.7104 226.2571 Tab le 7.7.2

[179]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

- 0.012 - 6.0922 - 0.7194 - 7.5008 - 7.8689 0.193 5.5659 - 1.2154 - 10.5711 3.5707 2.8639 - 3.9177 - 8.1833 5.9588 - 0.121 - 1.5299 - 11.1973 2.9446 - 3.1351 2.2379 0.0069 - 6.2469 - 0.7001 - 7.4817 - 7.8498 0.0383 5.5854 - 1.1964 - 10.629 3.5126 2.8058 - 3.9756 - 8.1639 5.978 - 0.2757 - 1.5103 - 11.1779 2.9638 - 3.2896 2.2571

FIR S T IN T E G R A L (3 -D ) U S IN G 1 0 0 0 R A N D O M D A T A S .N o . 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120

File Co d e x

y

z

5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6

1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 6 6 6 6 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5

2 3 4 6 1 3 4 6 1 2 4 6 1 2 3 6 1 2 3 4 2 3 4 5 1 3 4 5 1 2 4 5 1 2 3 5 1 2 3 4

Va lu e o f In t e g r a l 224.604 218.3503 218.5242 217.1152 216.7474 224.6354 224.8096 223.4007 213.968 228.1097 222.0301 220.6213 214.0451 228.1873 221.9332 220.6987 213.4192 227.5608 221.3074 221.4814 223.8503 217.5968 217.7707 223.1435 215.9936 223.882 224.0559 229.4287 213.2145 227.3563 221.2766 226.6496 213.2916 227.4335 221.1799 226.7269 215.6797 229.8215 223.5679 223.7418 Tab le 7.7.3

[180]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

0.604 - 5.6497 - 5.4758 - 6.8848 - 7.2526 0.6354 0.8096 - 0.5993 - 10.032 4.1097 - 1.9699 - 3.3787 - 9.9549 4.1873 - 2.0668 - 3.3013 - 10.5808 3.5608 - 2.6926 - 2.5186 - 0.1497 - 6.4032 - 6.2293 - 0.8565 - 8.0064 - 0.118 0.0559 5.4287 - 10.7855 3.3563 - 2.7234 2.6496 - 10.7084 3.4335 - 2.8201 2.7269 - 8.3203 5.8215 - 0.4321 - 0.2582

FIR S T IN T E G R A L (3-D ) U S IN G 2000 R A N D O M D A T A S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

File Co d e x

y

z

7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8

8 8 8 8 9 9 9 9 10 10 10 10 11 11 11 11 12 12 12 12 7 7 7 7 9 9 9 9 10 10 10 10 11 11 11 11 12 12 12 12

9 10 11 12 8 10 11 12 8 9 11 12 8 9 10 12 8 9 10 11 9 10 11 12 7 10 11 12 7 9 11 12 7 9 10 12 7 9 10 11

Va lu e o f In t e g r a l 226.6495 230.4067 226.804 226.426 228.8221 228.6691 225.0664 224.6883 230.492 226.5815 226.7358 226.3576 228.8908 224.9802 228.7377 224.7568 228.7228 224.8123 228.5699 224.9667 225.3182 229.0758 225.4727 225.0943 225.272 229.1129 225.5095 225.1322 226.9418 227.0251 227.1798 226.8015 225.3407 225.4242 229.1814 225.2003 225.1725 225.2564 229.0135 225.4104 Tab le 7.7.4

[181]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

2.6495 6.4067 2.804 2.426 4.8221 4.6691 1.0664 0.6883 6.492 2.5815 2.7358 2.3576 4.8908 0.9802 4.7377 0.7568 4.7228 0.8123 4.5699 0.9667 1.3182 5.0758 1.4727 1.0943 1.272 5.1129 1.5095 1.1322 2.9418 3.0251 3.1798 2.8015 1.3407 1.4242 5.1814 1.2003 1.1725 1.2564 5.0135 1.4104

FIR S T IN T E G R A L (3 -D ) U S IN G 2 0 0 0 R A N D O M D A T A S .N o . 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

File Co d e x

y

z

9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10

7 7 7 7 8 8 8 8 10 10 10 10 11 11 11 11 12 12 12 12 7 7 7 7 8 8 8 8 9 9 9 9 11 11 11 11 12 12 12 12

8 10 11 12 7 10 11 12 7 8 11 12 7 8 10 12 7 8 10 11 8 9 11 12 7 9 11 12 7 8 11 12 7 8 9 12 7 8 9 11

Va lu e o f In t e g r a l 228.7941 228.6411 225.0382 224.6601 226.5755 230.4161 226.8132 226.4353 226.5075 230.5012 226.7453 226.3676 224.906 228.8999 228.7467 224.766 224.738 228.7318 228.5787 224.9762 229.2116 225.3015 225.4559 225.0777 226.9931 227.0762 227.2306 226.8527 225.2548 229.2488 225.493 225.1151 225.3237 229.3174 225.407 225.1835 225.1555 229.1498 225.239 225.3934 Tab le 7.7.5

[182]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

4.7941 4.6411 1.0382 0.6601 2.5755 6.4161 2.8132 2.4353 2.5075 6.5012 2.7453 2.3676 0.906 4.8999 4.7467 0.766 0.738 4.7318 4.5787 0.9762 5.2116 1.3015 1.4559 1.0777 2.9931 3.0762 3.2306 2.8527 1.2548 5.2488 1.493 1.1151 1.3237 5.3174 1.407 1.1835 1.1555 5.1498 1.239 1.3934

FIR S T IN T E G R A L (3 -D ) U S IN G 2 0 0 0 R A N D O M D A T A S .N o . 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120

File Co d e x

y

z

11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12

7 7 7 7 8 8 8 8 9 9 9 9 10 10 10 10 12 12 12 12 7 7 7 7 8 8 8 8 9 9 9 9 10 10 10 10 11 11 11 11

8 9 10 12 7 9 10 12 7 8 10 12 7 8 9 12 7 8 9 10 8 9 10 11 7 9 10 11 7 8 10 11 7 8 9 11 7 8 9 10

Va lu e o f In t e g r a l 228.8115 224.901 228.6584 224.6775 226.5925 226.6759 230.4335 226.4525 224.8546 228.8486 228.6954 224.7145 226.5248 230.5183 226.608 226.3842 224.7553 228.7492 224.8386 228.596 228.7694 224.859 228.6165 225.0135 226.5507 226.634 230.3915 226.7884 224.8128 228.8063 228.6534 225.0505 226.4827 230.4764 226.5663 226.72 224.8811 228.8752 224.9645 228.7221 Tab le 7.7.6

[183]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

4.8115 0.901 4.6584 0.6775 2.5925 2.6759 6.4335 2.4525 0.8546 4.8486 4.6954 0.7145 2.5248 6.5183 2.608 2.3842 0.7553 4.7492 0.8386 4.596 4.7694 0.859 4.6165 1.0135 2.5507 2.634 6.3915 2.7884 0.8128 4.8063 4.6534 1.0505 2.4827 6.4764 2.5663 2.72 0.8811 4.8752 0.9645 4.7221

FIR S T IN T E G R A L (3 -D ) U S IN G 3 0 0 0 R A N D O M D A T A S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

File Co d e x

y

z

13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14

14 14 14 14 15 15 15 15 16 16 16 16 17 17 17 17 18 18 18 18 13 13 13 13 15 15 15 15 16 16 16 16 17 17 17 17 18 18 18 18

15 16 17 18 14 16 17 18 14 15 17 18 14 15 16 18 14 15 16 17 15 16 17 18 13 16 17 18 13 15 17 18 13 15 16 18 13 15 16 17

Va lu e o f In t e g r a l 227.7389 222.6383 221.3875 224.8448 225.955 224.0657 222.8147 226.2725 223.688 226.8996 220.5478 224.0057 223.1319 226.3432 221.2428 223.4494 224.6689 227.88 222.7796 221.5285 228.0767 222.9759 221.7254 225.1825 226.856 223.9532 222.7025 226.1599 224.5887 226.7866 220.4353 223.893 224.0327 226.231 221.1304 223.3368 225.5695 227.7675 222.667 221.4161 Tab le 7.7.7

[184]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

3.7389 - 1.3617 - 2.6125 0.8448 1.955 0.0657 - 1.1853 2.2725 - 0.312 2.8996 - 3.4522 0.0057 - 0.8681 2.3432 - 2.7572 - 0.5506 0.6689 3.88 - 1.2204 - 2.4715 4.0767 - 1.0241 - 2.2746 1.1825 2.856 - 0.0468 - 1.2975 2.1599 0.5887 2.7866 - 3.5647 - 0.107 0.0327 2.231 - 2.8696 - 0.6632 1.5695 3.7675 - 1.333 - 2.5839

FIR S T IN T E G R A L (3 -D ) U S IN G 3 0 0 0 R A N D O M D A T A S .N o . 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

File Co d e x

y

z

15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

13 13 13 13 14 14 14 14 16 16 16 16 17 17 17 17 18 18 18 18 13 13 13 13 14 14 14 14 15 15 15 15 17 17 17 17 18 18 18 18

14 16 17 18 13 16 17 18 13 14 17 18 13 14 16 18 13 14 16 17 14 15 17 18 13 15 17 18 13 14 17 18 13 14 15 18 13 14 15 17

Va lu e o f In t e g r a l 225.2221 223.3331 222.082 225.5399 225.7851 222.8829 221.6315 225.089 224.9452 223.932 220.7922 224.2496 224.3896 223.3762 221.4874 223.6935 225.9263 224.9127 223.0236 221.7728 224.6554 227.8669 221.5154 224.973 225.2186 227.4162 221.065 224.5227 226.6458 225.6322 222.4922 225.95 223.8226 222.8094 226.0211 223.1269 225.3596 224.3462 227.5574 221.2059 Tab le 7.7.8

[185]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

1.2221 - 0.6669 - 1.918 1.5399 1.7851 - 1.1171 - 2.3685 1.089 0.9452 - 0.068 - 3.2078 0.2496 0.3896 - 0.6238 - 2.5126 - 0.3065 1.9263 0.9127 - 0.9764 - 2.2272 0.6554 3.8669 - 2.4846 0.973 1.2186 3.4162 - 2.935 0.5227 2.6458 1.6322 - 1.5078 1.95 - 0.1774 - 1.1906 2.0211 - 0.8731 1.3596 0.3462 3.5574 - 2.7941

FIR S T IN T E G R A L (3 -D ) U S IN G 3 0 0 0 R A N D O M D A T A S .N o . 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120

File Co d e x

y

z

17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18

13 13 13 13 14 14 14 14 15 15 15 15 16 16 16 16 18 18 18 18 13 13 13 13 14 14 14 14 15 15 15 15 16 16 16 16 17 17 17 17

14 15 16 18 13 15 16 18 13 14 16 18 13 14 15 18 13 14 15 16 14 15 16 17 13 15 16 17 13 14 16 17 13 14 15 17 13 14 15 16

Va lu e o f In t e g r a l 224.5162 227.728 222.6273 224.834 225.0798 227.2774 222.177 224.3836 226.5068 225.4932 223.604 225.8109 224.2399 223.2262 226.4377 223.5441 225.2208 224.207 227.4188 222.3178 224.9007 228.112 223.0117 221.7609 225.4639 227.6613 222.5609 221.3099 226.891 225.8774 223.9879 222.7375 224.6242 223.6103 226.822 220.4707 224.0684 223.0545 226.2661 221.1656 Tab le 7.7.9

[186]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

0.5162 3.728 - 1.3727 0.834 1.0798 3.2774 - 1.823 0.3836 2.5068 1.4932 - 0.396 1.8109 0.2399 - 0.7738 2.4377 - 0.4559 1.2208 0.207 3.4188 - 1.6822 0.9007 4.112 - 0.9883 - 2.2391 1.4639 3.6613 - 1.4391 - 2.6901 2.891 1.8774 - 0.0121 - 1.2625 0.6242 - 0.3897 2.822 - 3.5293 0.0684 - 0.9455 2.2661 - 2.8344

FIR S T IN T E G R A L (3 -D ) U S IN G 4 0 0 0 R A N D O M D A T A S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

File Co d e x

y

z

19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20

20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24 19 19 19 19 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24

21 22 23 24 20 22 23 24 20 21 23 24 20 21 22 24 20 21 22 23 21 22 23 24 19 22 23 24 19 21 23 24 19 21 22 24 19 21 22 23

Va lu e o f In t e g r a l 225.2803 221.1351 221.8344 224.917 224.8623 221.4694 222.1687 225.251 223.0198 223.7728 220.3263 223.4089 223.331 224.0832 219.9381 223.7196 224.7009 225.4528 221.3074 222.0072 224.8898 220.7447 221.4439 224.5262 223.8211 221.5996 222.2989 225.3817 221.9786 223.9026 220.4562 223.5389 222.2895 224.2138 220.068 223.8496 223.6591 225.5831 221.4378 222.1378 Tab le 7.7.10

[187]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

1.2803 - 2.8649 - 2.1656 0.917 0.8623 - 2.5306 - 1.8313 1.251 - 0.9802 - 0.2272 - 3.6737 - 0.5911 - 0.669 0.0832 - 4.0619 - 0.2804 0.7009 1.4528 - 2.6926 - 1.9928 0.8898 - 3.2553 - 2.5561 0.5262 - 0.1789 - 2.4004 - 1.7011 1.3817 - 2.0214 - 0.0974 - 3.5438 - 0.4611 - 1.7105 0.2138 - 3.932 - 0.1504 - 0.3409 1.5831 - 2.5622 - 1.8622

FIR S T IN T E G R A L (3 -D ) U S IN G 4 0 0 0 R A N D O M D A T A S .N o . 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

File Co d e x

y

z

21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 22 22 22 22 22 22 22 22 23 22 22 22 22 22 22 22 22 22 22 22

19 19 19 19 20 20 20 20 22 22 22 22 23 23 23 23 24 24 24 24 19 19 19 19 20 20 20 20 21 21 21 21 23 23 23 23 24 24 24 24

20 22 23 24 19 22 23 24 19 20 23 24 19 20 22 24 19 20 22 23 20 21 23 24 19 21 23 24 19 20 23 24 19 20 21 24 19 20 21 23

Va lu e o f In t e g r a l 224.221 220.8283 221.5274 224.6098 223.57 221.3488 222.0483 225.1304 222.0624 223.2339 220.5402 223.6224 222.3731 223.5446 220.1518 223.9338 223.7425 224.9145 221.5214 222.2211 223.7604 224.5128 221.067 224.1495 223.1097 225.0332 221.5878 224.6697 223.444 224.6155 221.9219 225.004 221.913 223.0837 223.8366 223.4727 223.2826 224.4541 225.2063 221.7602 Tab le 7.7.11

[188]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

0.221 - 3.1717 - 2.4726 0.6098 - 0.43 - 2.6512 - 1.9517 1.1304 - 1.9376 - 0.7661 - 3.4598 - 0.3776 - 1.6269 - 0.4554 - 3.8482 - 0.0662 - 0.2575 0.9145 - 2.4786 - 1.7789 - 0.2396 0.5128 - 2.933 0.1495 - 0.8903 1.0332 - 2.4122 0.6697 - 0.556 0.6155 - 2.0781 1.004 - 2.087 - 0.9163 - 0.1634 - 0.5273 - 0.7174 0.4541 1.2063 - 2.2398

FIR S T IN T E G R A L (3 -D ) U S IN G 4 0 0 0 R A N D O M D A T A S .N o . 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120

File Co d e x

y

z

23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24

19 19 19 19 20 20 20 20 21 21 21 21 22 22 22 22 24 24 24 24 19 19 19 19 20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23

20 21 22 24 19 21 22 24 19 20 22 24 19 20 21 24 19 20 21 22 20 21 22 23 19 21 22 23 19 20 22 23 19 20 21 23 19 20 21 22

Va lu e o f In t e g r a l 223.8382 224.5904 220.4451 224.227 223.1875 225.1109 220.9657 224.7473 223.5217 224.693 221.3006 225.0817 221.6794 222.8508 222.6033 222.2394 223.3598 224.5312 225.284 221.1387 224.1807 224.9333 220.7877 221.4872 223.5299 225.4538 221.3085 222.0081 223.8642 225.0353 221.6427 222.3425 222.0219 223.1931 223.9459 220.4997 222.3328 223.5041 224.2566 220.1115 Tab le 7.7.12

[189]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

- 0.1618 0.5904 - 3.5549 0.227 - 0.8125 1.1109 - 3.0343 0.7473 - 0.4783 0.693 - 2.6994 1.0817 - 2.3206 - 1.1492 - 1.3967 - 1.7606 - 0.6402 0.5312 1.284 - 2.8613 0.1807 0.9333 - 3.2123 - 2.5128 - 0.4701 1.4538 - 2.6915 - 1.9919 - 0.1358 1.0353 - 2.3573 - 1.6575 - 1.9781 - 0.8069 - 0.0541 - 3.5003 - 1.6672 - 0.4959 0.2566 - 3.8885

FIR S T IN T E G R A L (3 -D ) U S IN G 5 0 0 0 R A N D O M D A T A S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

File Co d e x

y

z

25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26

26 26 26 26 27 27 27 27 28 28 28 28 29 29 29 29 30 30 30 30 25 25 25 25 27 27 27 27 28 28 28 28 29 29 29 29 30 30 30 30

27 28 29 30 26 28 29 30 26 27 29 30 26 27 28 30 26 27 28 29 27 28 29 30 25 28 29 30 25 27 29 30 25 27 28 30 25 27 28 29

Va lu e o f In t e g r a l 220.5313 224.2124 225.7165 221.9446 221.4248 223.4985 225.0032 221.2303 223.0604 221.4534 226.6385 222.8663 223.7292 222.1222 225.8033 223.5351 222.0533 220.4451 224.1263 225.6308 220.5481 224.2291 225.7341 221.9607 221.4682 223.4928 224.9974 221.2244 223.1046 221.448 226.6338 222.861 223.7733 222.1166 225.7978 223.5293 222.0966 220.4396 224.1206 225.6253 Tab le 7.7.13

[190]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

- 3.4687 0.2124 1.7165 - 2.0554 - 2.5752 - 0.5015 1.0032 - 2.7697 - 0.9396 - 2.5466 2.6385 - 1.1337 - 0.2708 - 1.8778 1.8033 - 0.4649 - 1.9467 - 3.5549 0.1263 1.6308 - 3.4519 0.2291 1.7341 - 2.0393 - 2.5318 - 0.5072 0.9974 - 2.7756 - 0.8954 - 2.552 2.6338 - 1.139 - 0.2267 - 1.8834 1.7978 - 0.4707 - 1.9034 - 3.5604 0.1206 1.6253

FIR S T IN T E G R A L (3 -D ) U S IN G 5 0 0 0 R A N D O M D A T A S .N o . 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

File Co d e x

y

z

27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28

25 25 25 25 26 26 26 26 28 28 28 28 29 29 29 29 30 30 30 30 25 25 25 25 26 26 26 26 27 27 27 27 29 29 29 29 30 30 30 30

26 28 29 30 25 28 29 30 25 26 29 30 25 26 28 30 25 26 28 29 26 27 29 30 25 27 29 30 25 26 29 30 25 26 27 30 25 26 27 29

Va lu e o f In t e g r a l 221.9768 224.0509 225.5553 221.7823 222.0047 224.0287 225.5335 221.7606 222.9256 222.8765 226.4551 222.6819 223.5948 223.5451 225.6191 223.3509 221.9175 221.8684 223.9423 225.4468 222.3857 220.7785 225.9645 222.1916 222.4133 220.7568 225.9422 222.1692 221.6992 221.6498 225.2277 221.4549 224.0038 223.9543 222.347 223.7596 222.3268 222.2774 220.6703 225.856 Tab le 7.7.14

[191]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

- 2.0232 0.0509 1.5553 - 2.2177 - 1.9953 0.0287 1.5335 - 2.2394 - 1.0744 - 1.1235 2.4551 - 1.3181 - 0.4052 - 0.4549 1.6191 - 0.6491 - 2.0825 - 2.1316 - 0.0577 1.4468 - 1.6143 - 3.2215 1.9645 - 1.8084 - 1.5867 - 3.2432 1.9422 - 1.8308 - 2.3008 - 2.3502 1.2277 - 2.5451 0.0038 - 0.0457 - 1.653 - 0.2404 - 1.6732 - 1.7226 - 3.3297 1.856

FIR S T IN T E G R A L (3-D ) U S IN G 5000 R A N D O M D A T A S .N o . 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120

File Co d e x

y

z

29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30

25 25 25 25 26 26 26 26 27 27 27 27 28 28 28 28 30 30 30 30 25 25 25 25 26 26 26 26 27 27 27 27 28 28 28 28 29 29 29 29

26 27 28 30 25 27 28 30 25 26 28 30 25 26 27 30 25 26 27 28 26 27 28 29 25 27 28 29 25 26 28 29 25 26 27 29 25 26 27 28

Va lu e o f In t e g r a l 222.5529 220.9459 224.627 222.3586 222.5807 220.9236 224.6048 222.3369 221.8663 221.8171 223.8905 221.6222 223.5019 223.4527 221.8461 223.2587 222.4936 222.4447 220.8378 224.5184 222.1336 220.5267 224.2075 225.7124 222.1611 220.5045 224.1865 225.6906 221.4472 221.3977 223.4715 224.9762 223.0834 223.0337 221.4266 226.6124 223.7515 223.702 222.0953 225.7764 Tab le 7.7.15

[192]

E xa c t Va lu e

Erro r

224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224 224

- 3.0541 0.627 - 1.6414 - 1.4193 - 3.0764 0.6048 - 1.6631 - 2.1337 - 2.1829 - 0.1095 - 2.3778 - 0.4981 - 0.5473 - 2.1539 - 0.7413 - 1.5064 - 1.5553 - 3.1622 0.5184 - 1.8664 - 3.4733 0.2075 1.7124 - 1.8389 - 3.4955 0.1865 1.6906 - 2.5528 - 2.6023 - 0.5285 0.9762 - 0.9166 - 0.9663 - 2.5734 2.6124 - 0.2485 - 0.298 - 1.9047 1.7764 - 224

FIRST INTEGRAL (3-D) (USING EQUISPACED NODES) For the evaluation of our first 3-D integral is

I

7

By Monte Carlo Integration using equispaced nodes we now present the following program PROG7_3E.BAS(PRGEQ1) 10 20 30 40 41 50 60 70 80 90 100 110 130 140 150

CLS : KEY OFF : DEF FNI(A,B,C)=A*A+B*B+C*C XLO = -1 : YLO = -2 : ZLO = -3 : XUP =1 : YUP = 2 : ZUP =3 LOCATE 10,10 : INPUT "No of Divisions";N DIM X(N+1) : DIM Y(N+1) : DIM Z(N+1) X(0)= XLO : Y(0) = YLO : Z(0) = ZLO H =(XUP - XLO)/N : K =(YUP - YLO)/N : L=(ZUP - ZLO)/N FOR I = 1 TO N X(I)= X(I-1)+ H : Y(I)= Y(I-1)+ K : Z(I)= Z(I-1)+ L NEXT I FOR I = 1 TO N : FOR J = 1 TO N : FOR M = 1 TO N SUM = SUM + FNI(X(I),Y(J),Z(M)) NEXT M : NEXT J : NEXT I SUM = SUM*H*K*L LOCATE 12,10: PRINT "No of Divisions = "; N ; " Integral Value = ";SUM END

As a result of execution of this program we are first required to input the number of divisions of x, y and

z

ranges.

Here

we

are

making

equal

numbers

of

divisions in x, y and z range. If we desire to make different numbers of division of x-range, y-range and [193]

z-range then we should modify this program by allowing two inputs for y-range division and z-range division separately.

Corresponding

to

different

numbers

of

division starting from 25 up to 250 with step of 25 we get the following observations. FIR S T IN T E G R A L (3 -D )-B Y E Q U IS P A CE D N O D E S N o. of S. N o.

Eq u isp ace d

V alu e O f In te g ral

Tru e V alu e

Erro r

224 224 224 224 224 224 224 224 224 224

0.7172 0.1805 0.0768 0.0409 0.0107 - 0.0178 - 0.0877 - 0.6685 - 1.6516 - 3.1458

N ode s 1 2 3 4 5 6 7 8 9 10

25 50 75 100 125 150 175 200 225 250

224.7172 224.1805 224.0768 224.0409 224.0107 223.9822 223.9123 223.3315 222.3484 220.8542 Tab le 7.7.16

The graphic display of these observations is as

Value Of Integral

under.

No. of Nodes

[194]

It should be noted that as we increase the number of divisions (i.e increasing the number of equispaced nodes)

the

time

sufficiently

of

execution

increased.

For

of

250

this

program

divisions,

it

gets takes

more than one minute. For higher divisions it will increase exponentially e.g. for 1000 nodes the time of execution is more than 8 minutes. Here we find that using the files of random number of size 1000, minimum error in the value of integral is corresponding to combination of files code as (4,1,2) and similarly for the files of size 2000, 3000, 4000 and

5000

(9,7,12),

the

best

combinations

of

files

code

(13,16,18), (24,22,21) and (28,29,25)

[195]

as

SECOND INTEGRAL (3-D) (USING RANDOM NODES) Our

second

integral

(3-dimension)

under

investigation is

I

8

Whose exact value is 5.073214 For

the

evaluation

utilize

the

same

of

program

this

integral

PROG7_1R.BAS

but

we

shall

with

a

difference in line 430 which is corresponding to the integrand of our integral. The modified form of this line should be 430

DEF FNI(A,B,C)= EXP(A + B + C)

The program PROG7_1R.BAS with above modification is stored by the name of PROG7_4R.BAS. On execution of the program PROG7_2R.BAS, we observe that corresponding to data size of 1000 and choosing INT_1_1.DAT for x-series INT_2_1.DAT for y-series INT_3_1.DAT for y-series While

Limits of integration are inputted as 0 to +1 for x-variable [196]

0 to +1 for y-variable 0 to +1 for z-variable The final OUTPUT is By Monte Carlo Integration :Using Random Data Files: G:INT_1_1.DAT, G:INT_2_1.DAT, G:INT_3_1.DAT Value of Integral

=

5.085666

Out of the six data files for 1000 data size there can be 120 different combinations of data files for xseries and y-series and z-series. For

different

data

sizes

and

different

file

combinations for x, y and z variable we have to use the program PROG7_1.BAS with proper modifications in line 15 and 20 which are corresponding to the integrand and limits of integration respectively.

For

the

integrand

line

15

and

20

in

modified

should be 15

DEF FNI(A,B,C)= EXP( A + B + C)

20

XLO =0:XUP =1:YLO =0:YUP =1:ZLO =0:ZUP =1

[197]

form

The

program

PROG7_1R.BAS

with

above

two

modifications is stored by the name of PROG7_5.BAS Execution

of

the

program

PROG7_5.BAS

will

give

the

output as File Codes:- 1 2 3

Value of Integral = 5.085666

File Codes:- 1 2 4

Value of Integral = 5.066642

File Codes:- 1 2 5

Value of Integral = 5.118641

File Codes:- 1 2 6

Value of Integral = 5.132347

File Codes:- 1 3 2

Value of Integral = 5.085666 .... .... .... .... .... .... ... .... .... .... .... .... .... ... .... .... .... .... .... .... ...

File Codes:- 6 4 3

Value of Integral = 5.114694

File Codes:- 6 4 5

Value of Integral = 5.148062

File Codes:- 6 5 1

Value of Integral = 5.117213

File Codes:- 6 5 2

Value of Integral = 5.237199

File Codes:- 6 5 3

Value of Integral = 5.143739

File Codes:- 6 5 4

Value of Integral = 5.148062

All the above noted 120 results are tabulated in three tables of 40 results as

[198]

S E CO N D IN T E G R A L (3 -D ) U S IN G 1 0 0 0 R A N D O M D A T A S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

File Co d e x

y

z

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2

2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 1 1 1 1 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6

3 4 5 6 2 4 5 6 2 3 5 6 2 3 4 6 2 3 4 5 3 4 5 6 1 4 5 6 1 3 5 6 1 3 4 6 1 3 4 5

Va lu e o f In t e g r a l 5.085666 5.066642 5.118641 5.132347 5.085666 5.029499 5.04979 5.048343 5.066642 5.029498 5.054847 5.075778 5.118641 5.04979 5.054847 5.117213 5.132347 5.048343 5.075778 5.117213 5.085666 5.066642 5.118641 5.132347 5.085666 5.172802 5.183777 5.189154 5.066642 5.172802 5.167766 5.174385 5.118641 5.183777 5.167766 5.237199 5.132348 5.189154 5.174385 5.237199 Tab le 7.8.1

[199]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

0.012452 - 0.006572 0.045427 0.059133 0.012452 - 0.043715 - 0.023424 - 0.024871 - 0.006572 - 0.043716 - 0.018367 0.002564 0.045427 - 0.023424 - 0.018367 0.043999 0.059133 - 0.024871 0.002564 0.043999 0.012452 - 0.006572 0.045427 0.059133 0.012452 0.099588 0.110563 0.11594 - 0.006572 0.099588 0.094552 0.101171 0.045427 0.110563 0.094552 0.163985 0.059134 0.11594 0.101171 0.163985

S E CO N D IN T E G R A L (3 -D ) U S IN G 1 0 0 0 R A N D O M D A T A S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

File Co d e x

y

z

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2

2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6 1 1 1 1 3 3 3 3 4 4 4 4 5 5 5 5 6 6 6 6

3 4 5 6 2 4 5 6 2 3 5 6 2 3 4 6 2 3 4 5 3 4 5 6 1 4 5 6 1 3 5 6 1 3 4 6 1 3 4 5

Va lu e o f In t e g r a l 5.085666 5.066642 5.118641 5.132347 5.085666 5.029499 5.04979 5.048343 5.066642 5.029498 5.054847 5.075778 5.118641 5.04979 5.054847 5.117213 5.132347 5.048343 5.075778 5.117213 5.085666 5.066642 5.118641 5.132347 5.085666 5.172802 5.183777 5.189154 5.066642 5.172802 5.167766 5.174385 5.118641 5.183777 5.167766 5.237199 5.132348 5.189154 5.174385 5.237199 Tab le 7.8.1

[200]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

0.012452 - 0.006572 0.045427 0.059133 0.012452 - 0.043715 - 0.023424 - 0.024871 - 0.006572 - 0.043716 - 0.018367 0.002564 0.045427 - 0.023424 - 0.018367 0.043999 0.059133 - 0.024871 0.002564 0.043999 0.012452 - 0.006572 0.045427 0.059133 0.012452 0.099588 0.110563 0.11594 - 0.006572 0.099588 0.094552 0.101171 0.045427 0.110563 0.094552 0.163985 0.059134 0.11594 0.101171 0.163985

S E CO N D IN T E G R A L (3 -D ) U S IN G 1 0 0 0 R A N D O M D A T A S .N o . 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

File Co d e x

y

z

3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4

1 1 1 1 2 2 2 2 4 4 4 4 5 5 5 5 6 6 6 6 1 1 1 1 2 2 2 2 3 3 3 3 5 5 5 5 6 6 6 6

2 4 5 6 1 4 5 6 1 2 5 6 1 2 4 6 1 2 4 5 2 3 5 6 1 3 5 6 1 2 5 6 1 2 3 6 1 2 3 5

Va lu e o f In t e g r a l 5.085666 5.029499 5.04979 5.048343 5.085666 5.172802 5.183777 5.189154 5.029498 5.172802 5.123346 5.114694 5.04979 5.183777 5.123346 5.143739 5.048343 5.189154 5.114694 5.143739 5.066642 5.029498 5.054847 5.075778 5.066642 5.172802 5.167766 5.174385 5.029498 5.172802 5.123346 5.114694 5.054847 5.167766 5.123346 5.148062 5.075778 5.174385 5.114694 5.148062 Tab le 7.8.2

[201]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

0.012452 - 0.043715 - 0.023424 - 0.024871 0.012452 0.099588 0.110563 0.11594 - 0.043716 0.099588 0.050132 0.04148 - 0.023424 0.110563 0.050132 0.070525 - 0.024871 0.11594 0.04148 0.070525 - 0.006572 - 0.043716 - 0.018367 0.002564 - 0.006572 0.099588 0.094552 0.101171 - 0.043716 0.099588 0.050132 0.04148 - 0.018367 0.094552 0.050132 0.074848 0.002564 0.101171 0.04148 0.074848

S E CO N D IN T E G R A L (3-D ) U S IN G 1000 R A N D O M D A T A S .N o . 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120

File Co d e x

y

z

5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6

1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 6 6 6 6 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 4 5 5 5 5

2 3 4 6 1 3 4 6 1 2 4 6 1 2 3 6 1 2 3 4 2 3 4 5 1 3 4 5 1 2 4 5 1 2 3 5 1 2 3 4

Va lu e o f In t e g r a l 5.118641 5.04979 5.054847 5.117213 5.118641 5.183777 5.167766 5.237199 5.04979 5.183777 5.123346 5.143739 5.054847 5.167766 5.123346 5.148062 5.117213 5.237199 5.143739 5.148062 5.132347 5.048343 5.075778 5.117213 5.132348 5.189154 5.174385 5.237199 5.048343 5.189154 5.114694 5.143739 5.075778 5.174385 5.114694 5.148062 5.117213 5.237199 5.143739 5.148062 Tab le 7.8.3

[202]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

0.045427 - 0.023424 - 0.018367 0.043999 0.045427 0.110563 0.094552 0.163985 - 0.023424 0.110563 0.050132 0.070525 - 0.018367 0.094552 0.050132 0.074848 0.043999 0.163985 0.070525 0.074848 0.059133 - 0.024871 0.002564 0.043999 0.059134 0.11594 0.101171 0.163985 - 0.024871 0.11594 0.04148 0.070525 0.002564 0.101171 0.04148 0.074848 0.043999 0.163985 0.070525 0.074848

S E CO N D IN T E G R A L (3 -D ) U S IN G 2 0 0 0 R A N D O M D A T A S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

File Co d e x

y

z

7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8

8 8 8 8 9 9 9 9 10 10 10 10 11 11 11 11 12 12 12 12 7 7 7 7 9 9 9 9 10 10 10 10 11 11 11 11 12 12 12 12

9 10 11 12 8 10 11 12 8 9 11 12 8 9 10 12 8 9 10 11 9 10 11 12 7 10 11 12 7 9 11 12 7 9 10 12 7 9 10 11

Va lu e o f In t e g r a l 5.128258 5.155837 5.114981 5.129356 5.128258 5.09828 5.062138 5.076116 5.155837 5.09828 5.096472 5.100609 5.114981 5.062138 5.096472 5.057083 5.129356 5.076116 5.100609 5.057083 5.128258 5.155837 5.114981 5.129356 5.128259 5.22187 5.17632 5.21138 5.155836 5.22187 5.199028 5.221964 5.114981 5.17632 5.199027 5.172807 5.129356 5.21138 5.221964 5.172807 Tab le 7.8.4

[203]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

0.055044 0.082623 0.041767 0.056142 0.055044 0.025066 - 0.011076 0.002902 0.082623 0.025066 0.023258 0.027395 0.041767 - 0.011076 0.023258 - 0.016131 0.056142 0.002902 0.027395 - 0.016131 0.055044 0.082623 0.041767 0.056142 0.055045 0.148656 0.103106 0.138166 0.082622 0.148656 0.125814 0.14875 0.041767 0.103106 0.125813 0.099593 0.056142 0.138166 0.14875 0.099593

S E CO N D IN T E G R A L (3 -D ) U S IN G 2 0 0 0 R A N D O M D A T A S .N o . 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

File Co d e x

y

z

9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10

7 7 7 7 8 8 8 8 10 10 10 10 11 11 11 11 12 12 12 12 7 7 7 7 8 8 8 8 9 9 9 9 11 11 11 11 12 12 12 12

8 10 11 12 7 10 11 12 7 8 11 12 7 8 10 12 7 8 10 11 8 9 11 12 7 9 11 12 7 8 11 12 7 8 9 12 7 8 9 11

Va lu e o f In t e g r a l 5.128258 5.09828 5.062138 5.076116 5.128259 5.22187 5.17632 5.21138 5.09828 5.22187 5.146701 5.160304 5.062138 5.17632 5.146701 5.113843 5.076116 5.21138 5.160304 5.113843 5.155837 5.09828 5.096472 5.100609 5.155836 5.22187 5.199028 5.221964 5.09828 5.22187 5.146701 5.160304 5.096472 5.199028 5.146701 5.146989 5.100609 5.221964 5.160304 5.146989 Tab le 7.8.5

[204]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

0.055044 0.025066 - 0.011076 0.002902 0.055045 0.148656 0.103106 0.138166 0.025066 0.148656 0.073487 0.08709 - 0.011076 0.103106 0.073487 0.040629 0.002902 0.138166 0.08709 0.040629 0.082623 0.025066 0.023258 0.027395 0.082622 0.148656 0.125814 0.14875 0.025066 0.148656 0.073487 0.08709 0.023258 0.125814 0.073487 0.073775 0.027395 0.14875 0.08709 0.073775

S E CO N D IN T E G R A L (3-D ) U S IN G 2000 R A N D O M D A T A S .N o . 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120

File Co d e x

y

z

11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12

7 7 7 7 8 8 8 8 9 9 9 9 10 10 10 10 12 12 12 12 7 7 7 7 8 8 8 8 9 9 9 9 10 10 10 10 11 11 11 11

8 9 10 12 7 9 10 12 7 8 10 12 7 8 9 12 7 8 9 10 8 9 10 11 7 9 10 11 7 8 10 11 7 8 9 11 7 8 9 10

Va lu e o f In t e g r a l 5.114981 5.062138 5.096472 5.057083 5.114981 5.17632 5.199027 5.172807 5.062138 5.17632 5.146701 5.113843 5.096472 5.199028 5.146701 5.146989 5.057083 5.172807 5.113843 5.146989 5.129356 5.076116 5.100609 5.057083 5.129356 5.21138 5.221964 5.172807 5.076116 5.21138 5.160304 5.113843 5.100609 5.221964 5.160304 5.146989 5.057083 5.172807 5.113843 5.146989 Tab le 7.8.6

[205]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

0.041767 - 0.011076 0.023258 - 0.016131 0.041767 0.103106 0.125813 0.099593 - 0.011076 0.103106 0.073487 0.040629 0.023258 0.125814 0.073487 0.073775 - 0.016131 0.099593 0.040629 0.073775 0.056142 0.002902 0.027395 - 0.016131 0.056142 0.138166 0.14875 0.099593 0.002902 0.138166 0.08709 0.040629 0.027395 0.14875 0.08709 0.073775 - 0.016131 0.099593 0.040629 0.073775

S E CO N D IN T E G R A L (3 -D ) U S IN G 3 0 0 0 R A N D O M D A T A S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

File Co d e x

y

z

13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14

14 14 14 14 15 15 15 15 16 16 16 16 17 17 17 17 18 18 18 18 13 13 13 13 15 15 15 15 16 16 16 16 17 17 17 17 18 18 18 18

15 16 17 18 14 16 17 18 14 15 17 18 14 15 16 18 14 15 16 17 15 16 17 18 13 16 17 18 13 15 17 18 13 15 16 18 13 15 16 17

Va lu e o f In t e g r a l 5.065516 5.11569 5.100337 5.133231 5.065516 5.051322 5.057026 5.054974 5.11569 5.051322 5.086244 5.095438 5.100337 5.057026 5.086244 5.096504 5.133231 5.054973 5.095438 5.096504 5.065516 5.11569 5.100337 5.133231 5.065516 5.069314 5.083435 5.079914 5.11569 5.069314 5.1005 5.112329 5.100337 5.083436 5.1005 5.121818 5.133231 5.079914 5.112329 5.121819 Tab le 7.8.7

[206]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

- 0.007698 0.042476 0.027123 0.060017 - 0.007698 - 0.021892 - 0.016188 - 0.01824 0.042476 - 0.021892 0.01303 0.022224 0.027123 - 0.016188 0.01303 0.02329 0.060017 - 0.018241 0.022224 0.02329 - 0.007698 0.042476 0.027123 0.060017 - 0.007698 - 0.0039 0.010221 0.0067 0.042476 - 0.0039 0.027286 0.039115 0.027123 0.010222 0.027286 0.048604 0.060017 0.0067 0.039115 0.048605

S E CO N D IN T E G R A L (3 -D ) U S IN G 3 0 0 0 R A N D O M D A T A S .N o . 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

File Co d e x

y

z

15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16

13 13 13 13 14 14 14 14 16 16 16 16 17 17 17 17 18 18 18 18 13 13 13 13 14 14 14 14 15 15 15 15 17 17 17 17 18 18 18 18

14 16 17 18 13 16 17 18 13 14 17 18 13 14 16 18 13 14 16 17 14 15 17 18 13 15 17 18 13 14 17 18 13 14 15 18 13 14 15 17

Va lu e o f In t e g r a l 5.065516 5.051322 5.057026 5.054974 5.065516 5.069314 5.083435 5.079914 5.051322 5.069314 5.056247 5.040864 5.057026 5.083435 5.056247 5.069862 5.054974 5.079914 5.040864 5.069862 5.11569 5.051322 5.086244 5.095438 5.11569 5.069314 5.1005 5.112329 5.051322 5.069314 5.056247 5.040864 5.086244 5.1005 5.056247 5.074502 5.095438 5.112329 5.040865 5.074502 Tab le 7.8.8

[207]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

- 0.007698 - 0.021892 - 0.016188 - 0.01824 - 0.007698 - 0.0039 0.010221 0.0067 - 0.021892 - 0.0039 - 0.016967 - 0.03235 - 0.016188 0.010221 - 0.016967 - 0.003352 - 0.01824 0.0067 - 0.03235 - 0.003352 0.042476 - 0.021892 0.01303 0.022224 0.042476 - 0.0039 0.027286 0.039115 - 0.021892 - 0.0039 - 0.016967 - 0.03235 0.01303 0.027286 - 0.016967 0.001288 0.022224 0.039115 - 0.032349 0.001288

S E CO N D IN T E G R A L (3 -D ) U S IN G 3 0 0 0 R A N D O M D A T A S .N o . 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120

File Co d e x

y

z

17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18

13 13 13 13 14 14 14 14 15 15 15 15 16 16 16 16 18 18 18 18 13 13 13 13 14 14 14 14 15 15 15 15 16 16 16 16 17 17 17 17

14 15 16 18 13 15 16 18 13 14 16 18 13 14 15 18 13 14 15 16 14 15 16 17 13 15 16 17 13 14 16 17 13 14 15 17 13 14 15 16

Va lu e o f In t e g r a l 5.100337 5.057026 5.086244 5.096504 5.100337 5.083436 5.1005 5.121818 5.057026 5.083435 5.056247 5.069862 5.086244 5.1005 5.056247 5.074502 5.096504 5.121819 5.069862 5.074502 5.133231 5.054973 5.095438 5.096504 5.133231 5.079914 5.112329 5.121819 5.054974 5.079914 5.040864 5.069862 5.095438 5.112329 5.040865 5.074502 5.096504 5.121819 5.069862 5.074502 Tab le 7.8.9

[208]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

0.027123 - 0.016188 0.01303 0.02329 0.027123 0.010222 0.027286 0.048604 - 0.016188 0.010221 - 0.016967 - 0.003352 0.01303 0.027286 - 0.016967 0.001288 0.02329 0.048605 - 0.003352 0.001288 0.060017 - 0.018241 0.022224 0.02329 0.060017 0.0067 0.039115 0.048605 - 0.01824 0.0067 - 0.03235 - 0.003352 0.022224 0.039115 - 0.032349 0.001288 0.02329 0.048605 - 0.003352 0.001288

S E CO N D IN T E G R A L (3 -D ) U S IN G 4 0 0 0 R A N D O M D A T A S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

File Co d e x

y

z

19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20

20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24 19 19 19 19 21 21 21 21 22 22 22 22 23 23 23 23 24 24 24 24

21 22 23 24 20 22 23 24 20 21 23 24 20 21 22 24 20 21 22 23 21 22 23 24 19 22 23 24 19 21 23 24 19 21 22 24 19 21 22 23

Va lu e o f In t e g r a l 5.03309 5.023766 5.056416 5.056689 5.03309 5.011062 5.051912 5.069182 5.023766 5.011062 5.030187 5.050992 5.056416 5.051912 5.030187 5.063813 5.056689 5.069181 5.050992 5.063813 5.03309 5.023766 5.056416 5.056689 5.03309 5.025306 5.055874 5.069605 5.023766 5.025306 5.024117 5.051709 5.056416 5.055874 5.024117 5.044433 5.056689 5.069605 5.051709 5.044434 Tab le 7.8.10

[209]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

- 0.040124 - 0.049448 - 0.016798 - 0.016525 - 0.040124 - 0.062152 - 0.021302 - 0.004032 - 0.049448 - 0.062152 - 0.043027 - 0.022222 - 0.016798 - 0.021302 - 0.043027 - 0.009401 - 0.016525 - 0.004033 - 0.022222 - 0.009401 - 0.040124 - 0.049448 - 0.016798 - 0.016525 - 0.040124 - 0.047908 - 0.01734 - 0.003609 - 0.049448 - 0.047908 - 0.049097 - 0.021505 - 0.016798 - 0.01734 - 0.049097 - 0.028781 - 0.016525 - 0.003609 - 0.021505 - 0.02878

S E CO N D IN T E G R A L (3 -D ) U S IN G 4 0 0 0 R A N D O M D A T A S .N o . 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

File Co d e x

y

z

21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 21 22 22 22 22 22 22 22 22 23 22 22 22 22 22 22 22 22 22 22 22

19 19 19 19 20 20 20 20 22 22 22 22 23 23 23 23 24 24 24 24 19 19 19 19 20 20 20 20 21 21 21 21 23 23 23 23 24 24 24 24

20 22 23 24 19 22 23 24 19 20 23 24 19 20 22 24 19 20 22 23 20 21 23 24 19 21 23 24 19 20 23 24 19 20 21 24 19 20 21 23

Va lu e o f In t e g r a l 5.03309 5.011062 5.051912 5.069182 5.03309 5.025306 5.055874 5.069605 5.011062 5.025306 5.020749 5.064091 5.051912 5.055874 5.020749 5.072349 5.069182 5.069605 5.064091 5.072349 5.023766 5.011062 5.030187 5.050992 5.023766 5.025306 5.024117 5.051709 5.011062 5.025306 5.020749 5.064091 5.030188 5.024117 5.020749 5.041605 5.050993 5.051709 5.064091 5.041605 Tab le 7.8.11

[210]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

- 0.040124 - 0.062152 - 0.021302 - 0.004032 - 0.040124 - 0.047908 - 0.01734 - 0.003609 - 0.062152 - 0.047908 - 0.052465 - 0.009123 - 0.021302 - 0.01734 - 0.052465 - 0.000865 - 0.004032 - 0.003609 - 0.009123 - 0.000865 - 0.049448 - 0.062152 - 0.043027 - 0.022222 - 0.049448 - 0.047908 - 0.049097 - 0.021505 - 0.062152 - 0.047908 - 0.052465 - 0.009123 - 0.043026 - 0.049097 - 0.052465 - 0.031609 - 0.022221 - 0.021505 - 0.009123 - 0.031609

S E CO N D IN T E G R A L (3 -D ) U S IN G 4 0 0 0 R A N D O M D A T A S .N o . 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120

File Co d e x

y

z

23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24

19 19 19 19 20 20 20 20 21 21 21 21 22 22 22 22 24 24 24 24 19 19 19 19 20 20 20 20 21 21 21 21 22 22 22 22 23 23 23 23

20 21 22 24 19 21 22 24 19 20 22 24 19 20 21 24 19 20 21 22 20 21 22 23 19 21 22 23 19 20 22 23 19 20 21 23 19 20 21 22

Va lu e o f In t e g r a l 5.056416 5.051912 5.030187 5.063813 5.056416 5.055874 5.024117 5.044433 5.051912 5.055874 5.020749 5.072349 5.030188 5.024117 5.020749 5.041605 5.063813 5.044434 5.072349 5.041605 5.056689 5.069181 5.050992 5.063813 5.056689 5.069605 5.051709 5.044434 5.069182 5.069605 5.064091 5.072349 5.050993 5.051709 5.064091 5.041605 5.063813 5.044434 5.072349 5.041605 Tab le 7.8.12

[211]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

- 0.016798 - 0.021302 - 0.043027 - 0.009401 - 0.016798 - 0.01734 - 0.049097 - 0.028781 - 0.021302 - 0.01734 - 0.052465 - 0.000865 - 0.043026 - 0.049097 - 0.052465 - 0.031609 - 0.009401 - 0.02878 - 0.000865 - 0.031609 - 0.016525 - 0.004033 - 0.022222 - 0.009401 - 0.016525 - 0.003609 - 0.021505 - 0.02878 - 0.004032 - 0.003609 - 0.009123 - 0.000865 - 0.022221 - 0.021505 - 0.009123 - 0.031609 - 0.009401 - 0.02878 - 0.000865 - 0.031609

S E CO N D IN T E G R A L (3 -D ) U S IN G 5 0 0 0 R A N D O M D A T A S .N o . 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

File Co d e x

y

z

25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26

26 26 26 26 27 27 27 27 28 28 28 28 29 29 29 29 30 30 30 30 25 25 25 25 27 27 27 27 28 28 28 28 29 29 29 29 30 30 30 30

27 28 29 30 26 28 29 30 26 27 29 30 26 27 28 30 26 27 28 29 27 28 29 30 25 28 29 30 25 27 29 30 25 27 28 30 25 27 28 29

Va lu e o f In t e g r a l 5.068664 5.084953 5.119282 5.086981 5.068664 5.062157 5.068712 5.049951 5.084952 5.062157 5.10236 5.075117 5.119282 5.068712 5.10236 5.100452 5.086981 5.049951 5.075117 5.100452 5.068664 5.084953 5.119282 5.086981 5.068664 5.068774 5.083639 5.065771 5.084952 5.068774 5.104379 5.082748 5.119282 5.083639 5.104379 5.106157 5.086981 5.065771 5.082748 5.106157 Tab le 7.8.13

[212]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

- 0.00455 0.011739 0.046068 0.013767 - 0.00455 - 0.011057 - 0.004502 - 0.023263 0.011738 - 0.011057 0.029146 0.001903 0.046068 - 0.004502 0.029146 0.027238 0.013767 - 0.023263 0.001903 0.027238 - 0.00455 0.011739 0.046068 0.013767 - 0.00455 - 0.00444 0.010425 - 0.007443 0.011738 - 0.00444 0.031165 0.009534 0.046068 0.010425 0.031165 0.032943 0.013767 - 0.007443 0.009534 0.032943

S E CO N D IN T E G R A L (3 -D ) U S IN G 5 0 0 0 R A N D O M D A T A S .N o . 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

File Co d e x

y

z

27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28

25 25 25 25 26 26 26 26 28 28 28 28 29 29 29 29 30 30 30 30 25 25 25 25 26 26 26 26 27 27 27 27 29 29 29 29 30 30 30 30

26 28 29 30 25 28 29 30 25 26 29 30 25 26 28 30 25 26 28 29 26 27 29 30 25 27 29 30 25 26 29 30 25 26 27 30 25 26 27 29

Va lu e o f In t e g r a l 5.068664 5.062157 5.068712 5.049951 5.068664 5.068774 5.083639 5.065771 5.062157 5.068774 5.054073 5.039469 5.068713 5.083639 5.054073 5.044781 5.049951 5.065771 5.039469 5.044781 5.084952 5.062157 5.10236 5.075117 5.084952 5.068774 5.104379 5.082748 5.062157 5.068774 5.054073 5.039469 5.10236 5.104379 5.054073 5.075595 5.075117 5.082748 5.039469 5.075595 Tab le 7.8.14

[213]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

- 0.00455 - 0.011057 - 0.004502 - 0.023263 - 0.00455 - 0.00444 0.010425 - 0.007443 - 0.011057 - 0.00444 - 0.019141 - 0.033745 - 0.004501 0.010425 - 0.019141 - 0.028433 - 0.023263 - 0.007443 - 0.033745 - 0.028433 0.011738 - 0.011057 0.029146 0.001903 0.011738 - 0.00444 0.031165 0.009534 - 0.011057 - 0.00444 - 0.019141 - 0.033745 0.029146 0.031165 - 0.019141 0.002381 0.001903 0.009534 - 0.033745 0.002381

S E CO N D IN T E G R A L (3 -D ) U S IN G 5 0 0 0 R A N D O M D A T A S .N o . 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120

File Co d e x

y

z

29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 29 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30

25 25 25 25 26 26 26 26 27 27 27 27 28 28 28 28 30 30 30 30 25 25 25 25 26 26 26 26 27 27 27 27 28 28 28 28 29 29 29 29

26 27 28 30 25 27 28 30 25 26 28 30 25 26 27 30 25 26 27 28 26 27 28 29 25 27 28 29 25 26 28 29 25 26 27 29 25 26 27 28

Va lu e o f In t e g r a l 5.119282 5.068712 5.10236 5.100452 5.119282 5.083639 5.104379 5.106157 5.068713 5.083639 5.054073 5.044781 5.10236 5.104379 5.054073 5.075595 5.100452 5.106157 5.044781 5.075595 5.086981 5.049951 5.075117 5.100452 5.086981 5.065771 5.082748 5.106157 5.049951 5.065771 5.039469 5.044781 5.075117 5.082748 5.039469 5.075595 5.100452 5.106157 5.044781 5.075595 Tab le 7.8.15

[214]

E xa c t Va lu e

Erro r

5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214 5.073214

0.046068 - 0.004502 0.029146 0.027238 0.046068 0.010425 0.031165 0.032943 - 0.004501 0.010425 - 0.019141 - 0.028433 0.029146 0.031165 - 0.019141 0.002381 0.027238 0.032943 - 0.028433 0.002381 0.013767 - 0.023263 0.001903 0.027238 0.013767 - 0.007443 0.009534 0.032943 - 0.023263 - 0.007443 - 0.033745 - 0.028433 0.001903 0.009534 - 0.033745 0.002381 0.027238 0.032943 - 0.028433 0.002381

SECOND INTEGRAL (3-D) (USING EQUISPACED NODES) For the evaluation of our second 3-D integral

I

8

By Monte Carlo Integration using equispaced nodes we shall take use of the same program PROG7_3E.BAS with following modifications in line 10 and 20 10

CLS : KEY OFF : DEF FNI(A,B,C)= EXP(A + B + C)

20

XLO = 0 : YLO = 0 : ZLO = 0 : XUP = 1 : YUP = 1 : ZUP = 1

With these two modifications the program is stored by the name PROG7_6E.BAS. As

a

result

of

execution

of

this

program

PROG7_6E.BAS we are first required to input the number

of divisions of x, y and z ranges. Here we are making equal numbers of divisions in x, y and z range. If we desire to make different numbers of division of xrange, y-range and z-range then we should modify this program by allowing two inputs for y-range division and z-range division separately. Corresponding to different numbers of division starting from 25 up to 250 with step of 25 we get the following observations. [215]

S E CO N D IN T E G R A L (3 -D )-B Y E Q U IS P A CE D N O D E S N o. of S. N o .

Eq u isp ace d

V alu e O f In te gral

Tru e V alu e

Erro r

N ode s 1

25

5.385863

5.073214

0.312649

2

50

5.227309

5.073214

0.154095

3

75

5.175625

5.073214

0.102411

4

100

5.148397

5.073214

0.075183

5

125

5.134983

5.073214

0.061769

6

150

5.125162

5.073214

0.051948

7

175

5.117739

5.073214

0.044525

8

200

5.110171

5.073214

0.036957

9

225

5.099688

5.073214

0.026474

10

250

5.162626

5.073214

0.089412

Tab le 7.7.17

The graphic display of these observations is as under.

Value Of Integral

5 .4 5 5 .4 5 .3 5 5 .3 5 .2 5 5 .2 5 .1 5 5 .1 5 .0 5 0

50

100

150 No. of Nodes

V a lu e O f I n t e g r a l U s in g E q u is p c e d N o d e s

200

250

300

T r u e V a lu e O f I n t e g r a l

G rap h 7 .7 .2

Here we find that using the files of random number of size 1000, minimum error in the value of integral is corresponding to combination of files code as (1,4,6) and similarly for the files of size 2000, 3000, 4000 and

5000

the

best

combinations

of

files

code

(7,9,12), (16,17,18), (21,23,24) and (28,25,30). [216]

as

Observations: Value

of

integral

corresponding

to

the

best

combinations of files code for the files of size 1000 is not giving the same or better accuracy for the files of size 2000, 3000, 4000 and 5000 [see tables of this chapter] which makes our observation as.

Observation 7.1 Value of all the single integrals doesn't follow any

pattern

combinations

corresponding which

files

of

random

nodes

the

value

steadily

is

best

numbers of

approaches

for

whereas

integral to

the

to

any any

exact

size

using

follow

of

a

value

of

the data

equispaced pattern of

and

integral

[see graph 7.7.1, 7.8.1].

Observation 7.2 True value of integral is almost achieved using only 250 equispaced points for x, y and z range.

[217]

CHAPTER -8 ANALYSIS AND CONCLUSION

[218]

We first took two sets of random numbers. One is obtained through the online available software and sites which claims to provide true random numbers and the other set is obtained through a computer program in GWBASIC which actually happens to be pseudo in nature.

To check the randomness of these numbers we apply test to check the two most important attributes i.e. independence and uniformity of random numbers given by Knuth.

[219]

We

applied

POKER

and

RUN

test

to

test

the

independence and FREQUENCY and FREQUENCY MONOBIT test to test the uniformity of these random numbers [see chapter 3].

We evaluated different integrals of One, Two and Three dimensions and analyze the following points

Analysis for Single Integral We

evaluated

three

different

single

integrals

using random numbers as well as equispaced nodes and observe that

Value of all the single integrals doesn't follow any pattern corresponding to different size of random numbers [see graph 5.1.1, 5.2.1 ,5.3.1] and also seems to be random in nature whereas using equispaced nodes the value of integral follow a pattern and steadily approaches to the exact value of integral [see graph 5.1.2, 5.2.2, 5.3.2].

Also

true

value

of

integral

using only 5000 equispaced points.

[220]

is

almost

achieved

Analysis for Double Integral We

evaluated

three

different

double

integrals

using random numbers as well as equispaced nodes and observe that

Value of all the double integrals doesn't follow any pattern corresponding to any of the combinations which is best for any size of data files of random numbers [see tables 6.4.1 - 6.4.5, 6.5.1 - 6.5.5, 6.6.1 - 6.6.5] whereas using equispaced nodes the value of integral follow a pattern and steadily approaches to the exact value of integral [see graph 6.4.1, 6.5.1, 6.6.1].

Also

true

value

of

integral

is

almost

achieved

using only 2000 equispaced points.

Analysis for Triple Integral We evaluated two different triple integrals using random numbers as well as equispaced nodes and observe that

[221]

Value of all the triple integrals doesn't follow any pattern corresponding to any of the combinations which is best for any size of data files of random numbers [see table 7.7.1 - 7.7.15, 7.8.1 - 7.8.15] whereas using equispaced nodes the value of integral follow a pattern and steadily approaches to the exact value of integral [see graph 7.7.1, 7.8.1].

Also

true

value

of

integral

is

almost

achieved

using only 250 equispaced points.

Conclusion However random the numbers (True or Pseudo) are used in Monte Carlo integration it is not necessary that the set of random numbers which gives the best approximation of one integral (single or multiple) will also yield the same accuracy in the evaluation of other integral whereas if we use equispaced numbers in a given range of integration then we get almost smooth curve corresponding to the values of integral having a regular

decrement

in

the

error

integral.

[222]

of

the

value

of

It

is

different

also

not

number

of

necessary random

that

numbers

corresponding obtained

to

through

same source will give the value of integral more and more approximated i.e. increase in the random numbers doesn't give the assurance for regular decrement in error whereas using equispaced nodes we get a regular decrement in the error of value of integral.

It

seems

that

as

the

dimension

of

integral

increases the requirement of equispaced nodes decreases whereas in case of random numbers no such type of logic holds good. But the fact is some what different. In case of three dimensional integral if x ,y and z are taken from random files then the triplets (x, y, z)so formed will not be uniformly distributed in the range of integration whereas if x , y and z are taken from equispaced nodes then the class of triplets so formed will be uniformly distributed in the range of integration.

This

is

the

reason

for

getting

better

approximation by equispaced nodes.

In view of the above observations coupled with our proposal we are in position to agree with following facts.

[223]

As far as the first requirement "Sample should be random" of Monte Carlo method is concerned, we totally disagree with it in numerical integration only. Instead of taking random nodes if we take equispaced nodes then numerical

integration

is

more

accurate

which

is

established for each of three 1-dimensional, three 2dimensional and two 3-dimension integrals in this work.

In

respect

of

second

requirement

"Sample

size

should be large" we have partial agreement. We admit the fact that by increasing the sample size the error decreases but upto certain limits. Beyond which the integral deviates significantly from its exact value.

The

random

nodes

created

by

the

random

numbers

from any data files ( either self generated or online generated )are not uniformly distributed in the range of

integration

while

the

equispaced

nodes

form

a

network of uniform distribution. The division of x and y range in 10 equal parts will form a network of 10x10 i.e. 100 equispaced nodes in case of double integral while the division of x,y and z range in 10 equal parts will form 10x10x10 i.e. 1000 nodes. These 1000 nodes are uniformly distributed in the range of integration while 1000 random nodes created from data files are not [224]

as much uniform as equispaced nodes. This is the main reason for getting better approximation by equispaced nodes.

Hence we conclude that for Monte Carlo integration equispaced

nodes

play

a

better

role

than

random

nodes(true or pseudo).

The

only

drawback

in

using

equispaced

nodes

is

that of time of execution of the computer program, which can be tolerated as the precision in the integral value is our main requirement.

[225]

CHAPTER -9 BIBLIOGRAPHY

[226]

BIBLIOGRAPHY 1.

Andrew Rukhin,Juan Soto,James Nechvatal,Miles Smid,Elaine Barker,Stefan Leigh,Mark Levenson, Mark Vangel,David Banks,

Alan

Heckert,James

Dray,San Vo (2001) A

statistical

test

suite

for

random

and

pseudorandom number generators for cryptographic applications. NIST, Special Publication 800-22 with dated May 15,2001)

[227]

revisions

2.

Caflisch, R. E. (1998). Monte Carlo and quasi-Monte Carlo methods. Acta Numerica7.Cambridge University-Press.pp.1-49

3.

Carter, Everett F. (1996): Markov Chains and the Monte Carlo Method. Random Walks,Monterey, California :Taygeta. (www.taygeta.com/rwalks/rwalks.html)

4.

Chaitin, Gregory J. (1975) Randomness and mathematical proof. Scientific American 232 (5), 47-52, May 1975.

5.

Compagner,Aaldert (1995) Operational

conditions

for

random-number

generation. Physics Review E 52, 5634-5645.

6.

Computational Science Education Project (1995) Introduction to Monte Carlo Methods. Oak

Ridge,Tennessee:

Oak

Ridge

National

laboratory.(csep1.phy.ornl.gov/mc/mc.html)

7.

Davis, P.J. & Rabinowitz, P. (1984). Methods of Numerical Integration. Academic Press, New York.

8.

Eckhardt, Roger (1987). "Stan Ulam, John von Neumann, and the Monte Carlo method". Los Alamos Science, Special Issue (15): 131-137.

[228]

9.

Eddelbuettel, D (2007) Random: True random numbers using random.org. URL: http://www.random.org

10. Evans, A.; Swartz. T (2000) Approximating

Integrals

via

Monte

Carlo

and

deterministic methods. Oxford University Press, 2000, Oxford, UK

11. Evans, G. (1993). Practical Numerical Integration. Wiley, New York.

12. Fishman, G. S. (1995). Monte

Carlo:

Concepts,

Algorithms,

and

Applications. New York: Springer. ISBN 0-387-94527-X.

13. Gentle, J. E. (2003) Random Number Generation and Monte Carlo Methods Springer, New York, second edition.

14. Gordon K.(1998) Numerical Integration, (ISBN 0471 975761) Edited

by,

Peter

Armitage

and

Theodore

John Wiley & Sons, Ltd, Chichester,1998

15. Guan Yang (2002) A Monte Carlo Method of Integration, Extended Essay in Mathematics,

16. Harvey Gould,Jan Tobochnik, [229]

Denmark.

Colton,

& Wolfgang Christian,(2001) Numerical Integration and Monte Carlo Methods 10 April 2001

17. Hammersley, J. M.; Handscomb, D. C.(1975). Monte Carlo Methods. London: Methuen. ISBN 0-416-52340-4.

18. Hellekalek, Peter (1998) Good random number generators are (not so) easy to find. Mathematics and Computers in Simulation 46,485-505

19. J. M. Hammersley and D. C. Handscomb,(1964) Monte Carlo Methods Chapman and Hall, London & New York, .

20. Kalos, Malvin H.; Whitlock, Paula A. (2008). Monte Carlo Methods. Wiley-VCH. ISBN 978-3-527-40760-6.

21. Kroese, D. P.; Taimre, T.; Botev, Z.I. (2011). Handbook of Monte Carlo Methods. New York: John Wiley & Sons. p. 772. ISBN 0-470-17793-4. http://www.montecarlohandbook.org.

22. Lalmohan, Bhar Non-parametric Test Indian Agricultural Statistics Research Institute, LIbrary Avenue, New Delhi

23. Lindholm, J. H. (1968) [230]

An analysis of the pseudo-randomness properties of subsequences of long m-sequences. IEEE Trans. Inform. Theory IT-14, 569-576.

24. L. Devroye,(1986) Nonuniform Variate Generation. Springer-Verlag, Berlin, Heidelberg, New York,

25. L'Ecuyer, P. Pseudorandom Number Generators. Encyclopedia

of

Quantitative

Finance,

pp.1431-

1437.

26. L'Ecuyer, P (1994) Uniform random number generation Ann.Oper.Res.53, 77-120.

27. M. H. Kalos and P. A. Whitlock,(1986) Monte Carlo Methods Volume I:Basics, Wiley-Interscience Publications, John Wiley and Sons, New York, 1986.

28. Metropolis, N. (1987). "The beginning of the Monte Carlo method". Los Alamos Science (1987 Special Issue dedicated to Stanis?aw Ulam): 125-130. http://iibrary.lanl.gov/la-pubs/00326866.pdf.

29. Metropolis, N.C. & Ulam, S.M. (1949). The Monte Carlo method Journal of the American Statistical Association

[231]

44, 335-341. montecarlomod.html

30. Park S. K. and Miller K. W.(1988) Random number generators: Good ones are hard to find Communications of the ACM,31(1988),pp. 1192-1201.

31. Stroud, A.H. (1971). Approximate Calculation of Multiple Integrals. Prentice-Hall, Englewood Cliffs.

32. TODD J

AND TAUSSKY O (1956)

Generation of pseudo-random numbers In Symposium on Monte Carlo Methods (H.A.Meyer,Ed.) (John Wiley and Sons, New York, 1956),pp.15-28

33. Vattulainen,I.,Ala-Nissila,T. & Kankaala, K.(1994) Physical tests for random numbers in simulations Phys. Rev. Lett. 73, 2513-2516.

34. Van Dooren, P. & de Ridder, L. (1976). An adaptive algorithm for numerical integration over an N-dimensional cube, Journal

of

Computational

Applied

Mathematics

2,207-217.

35. Von Neumann, John (1951) Various techniques used in connection with random digits.

[232]

Proceedings of Symposium on "Monte Carlo Method" held June-July,1949,in Los Angeles),chapter 13.

36. Wegenkittl, S.and Matsumoto, M.(1999) Getting

rid

of

correlations

among

pseudorandom

numbers: discarding versus tempering ACMTrans. On Modeling & Computer Simulation 9,282294.

Site References 37. For Error Function evaluation http://en.wikipedia.org/wiki/Error_function

38. Error with mid point method http://farside.ph.utexas.edu/teaching/329/lectures node109.html

39. Frequency Monobit Test csrc.nist.gov/publications/nistpubs/800-22... SP80022rev1a.pdf

40. Graph Pad calci softwere for online Random Numbers http://graphpad.com/quickcalcs/randomn1.cfm

41. LCG and other generator. http://crypto.mat.sbg.ac.at/results/karl/server node3.html

42. Research Randomizer for online Random Numbers [233]

http://www.randomizer.org/form.htm

43. Run test www.cse.msu.edu/~cse808/note/lecture6.ppt

44. Run test: test statistic. www.iasri.res.in/ebook/EB_SMAR/e.../4-Non Parametric_test.pdf

45. Monte Carlo module http://math.fullerton.edu/mathews/n2003 montecarlomod.html

46. Monte carlo Method http://math.fullerton.edu/mathews/n2003/

47. Poker Test www.cse.msu.edu/~cse808/note/lecture6.pp

48. Random number generator www.cse.msu.edu/~cse808/note/lecture6.pp

49. The Basics of Monte Carlo Simulations http://www.chem.unl.edu/zeng/joy/mclab/mcintro.hml

50. Uniformity test www.lix.polytechnique.fr/~catuscia/teaching/... pseudo_random.ppt

51. Use of monte carlo methods in mathematics http://en.wikipedia.org/wiki/Monte_Carlo_method

[234]

Suggest Documents