Random walk theory and application

This project presents an overview of Random Walk Theory and its applications, as discussed in the provided project work. Random Walk Theory posits that changes in elements like stock prices follow a distribution independent of past movements, making future predictions challenging. Originating from the work of French mathematician Louis Bachelier and later popularized by economist Burton Markiel, the theory finds extensive applications beyond finance, spanning fields such as psychology, economics, and physics. The project delves into various types of random walks, including symmetric random walks, and explores their implications in different spaces, from graphs to higher-dimensional vector spaces. It provides definitions, examples, and graphical representations to elucidate random walk concepts, highlighting their relevance in practical scenarios like particle movement and stock price fluctuations. Key concepts such as the reflection principle and the main lemma are discussed to provide a comprehensive understanding of random walks and their properties. Through examples and lemmas, the project elucidates the mathematical foundations of random walks, offering insights into their behavior and applications across diverse disciplines. In summary, this project contributes to a deeper comprehension of Random Walk Theory, serving as a fundamental framework for understanding stochastic processes and their real-world implications.


Introduction 1.Background of the study
Random walk theory was first authored by French mathematician Louise Bachelier, who accepted that share price movement resemble the means taking by a drunk (has an unpredictable walk).However, the theory became famous through the work of Economist Burton Markiel who took it to the stock market and concurred that stock costs follow a totally irregular way, that is, random path.Random walk theory can be a financial or monetary model which accepts that the stock exchange moves in a totally eccentric unpredictable manner.The speculation recommends that the future stock is free of its own authentic development.Random walk theory accepts that types of stock investigation, both technical and fundamental, are reliable.The probability of a share cost expanding at some random time is actually equivalent to the probability that it will diminish.
i.e.Probability of increase in cost = Probability of decrease in cost Truth to be told, Burton contented that a blind folded animal, say monkey to be precise could also randomly choose an arrangement of stocks that would do similar as well as a portfolio carefully chosen by an expert.Random walk theory is a fundamental concept in finance and mathematics, postulating that the movement of asset prices over time is akin to the random steps of a drunkard staggering randomly along a path.This theory suggests that future price movements cannot be predicted based on past movements, as each step in the sequence is independent of the previous one.
Developed by mathematician Karl Pearson in the early 20th century and later refined by French mathematician Louis Bachelier in his doctoral thesis in 1900, random walk theory serves as a cornerstone in understanding the behavior of financial markets (Bachelier, 2011).A "random walk" refers to a statistical occurrence in which a variable demonstrates no identifiable pattern and appears to move unpredictably.In the context of trading, the random walk theory, notably articulated by Burton Malkiel, an economics professor at Princeton University, suggests that the price of securities moves randomly, hence the theory's name.Consequently, according to this theory, any endeavor to forecast future price movements, whether through fundamental analysis or technical analysis, is deemed futile (CFI Team, 2015).
Figure 1 Example of Random Walk Theory from a garment company perspective (Sinha, 2024).
The Adams-Bashforth method, a numerical technique for solving first-order ordinary differential equations, and Random Walk Theory share a fundamental principle: unpredictability.While the Adams-Bashforth method iteratively estimates the future behavior of a differential equation based on past data points, Random Walk Theory asserts that in an efficient market, stock prices move randomly due to their unpredictable nature.Both concepts acknowledge the limitations of prediction, with the Adams-Bashforth method recognizing the inherent uncertainty in extrapolating future values from historical data, and Random Walk Theory asserting that attempts to forecast stock prices are futile due to their stochastic nature.Thus, both frameworks underscore the importance of acknowledging and navigating unpredictability in their respective domains (Balogun et al, 2024).

Aims and objective of Random Walk Theory
Random walk theory also has applications to designing, and numerous logical fields including nature, psychology, software engineering, economics, physics, chemistry and also sociology.Random walk clarifies the noticed behavior many cycles in these fields and hence fill in as a principal model for the recorded stochastic action.As a more numerical application the value of pi (π) can be used by the utilization of random walk in a specialist bases random walk.Random walk theory also suggests that changes of stock cost have a similar distribution and are autonomous or independent of one another.Along this line, it expects the previous development or movement or pattern of a stock cost can't be used to foresee its future development.
Various kind of random walk are of interest which can vary in more than one way.The term itself most often refers to an extraordinary class of Markov chain.Random Walk can actually take place in variety of spaces, usually concentrated ones include graphs, on the integer or the real line in the plane and higher dimensional vector space on curved surfaces or higher dimensional Riemannian manifolds and furthermore on groups limited and limited produced.The time boundary can likewise be controlled or manipulator.In the least difficult setting, the random Walk is in discrete time, that is a group of random variables Xt = x1, x2, ... Ordered by normal numbers.Notwithstanding, it is likewise possible to characterized random walk which takes their steps at irregular times, and all things considered, the position X(t) must be characterized for all times, that's 0 ≤ t ≤ ≤ ∞ Explicitly, cases or limit of random walk incorporate the levy flight and dispersion models, for example is the Brownian movement, linked to the Brownian motion in physics.Random walks are crucial point of conversations of Markov process as well as gamblers ruin.Their numerical review has been broad, which will be later discussed on this scheme.A few properties including dispersal appropriations, first entry or heating times, experienced rates, recurrence or transience have been introduced to measure their conduct.

Real Life Application of Random Walk Theory
The application of Random Walk Theory to real-life scenarios is widespread, especially in fields such as finance, economics, biology, physics, and even sociology.Here's how random walk theory is applied in various contexts: a. Financial Markets: Stock Prices: Random walk theory suggests that stock prices follow a random path and cannot be predicted based on past movements.This concept forms the basis of the efficient market hypothesis (EMH), which states that it's impossible to consistently outperform the market by using past price data.b.Foreign Exchange Markets: Exchange rates are often modeled as random walks, especially in the short term.This has implications for currency trading strategies and risk management.c.Econometrics: Random walk models are used to analyze time series data in economics.For example, in macroeconomics, random walk models are applied to study variables like GDP, inflation, and unemployment rates.d.Biological Sciences: In population biology, random walk models are used to describe the movement patterns of organisms.For instance, the foraging behavior of animals or the dispersion of seeds can be modeled as random walks.e. Physics: Brownian motion, a fundamental concept in physics, is a type of random walk where particles undergo random movements.This concept has applications in understanding diffusion processes, molecular motion, and other phenomena.f.Sociology: Random walk models have been applied to study social interactions and information diffusion in social networks.For example, the spread of rumors or the adoption of new technologies can be modeled as random walks on networks.g.Computer Science: Random walk algorithms are used in various computer science applications, such as graph traversal, network analysis, and Monte Carlo simulations.h.Urban Planning: Random walk models are employed to simulate pedestrian movement in urban areas, helping urban planners design more efficient transportation systems and public spaces.

Application of Random Walk Theory in Artificial Intelligence (AI)
Random walk theory finds several applications in the field of artificial intelligence (AI), particularly in algorithms and models designed for decision-making, optimization, and problem-solving.

Other Applications of Random Walk Theory
In the context of temperature programmed desorption (TPD), Random Walk Theory finds application in understanding the stochastic behavior of desorbing molecules from a surface.TPD is a technique used to study the desorption kinetics of molecules adsorbed on a surface by heating the sample at a constant rate and monitoring the desorbed species as a function of temperature.Random Walk Theory suggests that the desorption of molecules from the surface follows a random process, akin to the movement of particles in a random walk.This theory helps in interpreting the desorption profiles obtained from TPD experiments, as it implies that the desorption behavior is influenced by factors such as the adsorption energy distribution, surface coverage, and thermal fluctuations.By considering the randomness inherent in desorption processes, researchers can better analyze TPD data and extract valuable information about surface properties, such as binding energies, diffusion kinetics, and surface coverage, which are crucial for various applications including catalysis, surface science, and materials research (Onivefu, 2023(Onivefu, , 2024)).Solution: There are exactly 6 steps in the work with four positive move (forward i.e. 1) and two backward movements i.e. -1.
The figure below shows the path of the random walk.
Where the double line in figure one denotes the path of length k=6 from (0,0) to (6,S6).

DEFINITION 2: length of a random walk
In a random walk of length k, we have k steps in which at each epoch there are two options of moving according to Fig. 1, either to the positive or the negative axis.And since we are presented with two options e have 2 k paths of k length.Let's then take the probability of moving to the left and to the right is q and p respectively, therefore the probability of each path is; p m q (k-m) when there are (k-m) steps to the negative axis and m steps to the positive axis.And the if p is equal to q the probability at each path is Definition: A random walk said to be symmetric one if p=q=½

DEFINITION 3: A path from the origin to an arbitrary point (k,x)
To be able to have a path from the origin to an arbitrary point (k,x), we must have the value of k on the positive integer line and we must have the value of Sk =X in the case where k is a positive integer and Sk ≠ X, therefore we conclude there is no path from the origin to (k,x), but in the case where is a positive integer and Sk = X then there is clearly a path from the origin to (k,x).
Assume there exist a path from the origin to the point (k,x).Then k is the length of the path and there exist 2k paths of length k.Take x1, x2, x3, ..., xk to be the step of the k random walk and Which implies that; X= p-q and also, k= p + q.

General orientation
Let us consider the movement of a particle along a straight line.Let xi denote the steps taken by the particle at a particular time i, where i= 1,2,3, ..... Since the value of xi does not have to follow an already made pattern or unpredictable, we say the movement is a Random walk.A Random walk is a good model use for many practical cases such as in chemistry (movement of particles), physics (Brownian motion), Foraging (animal moving randomly n search of food), share price (such as the price of petroleum in Nigeria), gamblers ruin etc.
Then it is represented mathematically by the assignment of values and probabilities to xi.Where xi can take the value of the positive one or the negative one with the probability of p and q=1-p respectively.And let, Sn denotes the random walk and xi, i=1( 1) n is called the step while n is the total number of steps taken.Let us consider the tossing of a fair coin where by when the head is shown is +1 and the tail attracts -1 or alternatively we can consider rolling of a die whereby assigning +1 to odd numbers and -1 to even numbers, and clearly Sk+1= Sk+Xk+1 A graphical representation of random walk can be in form of one dimension or two dimensions, just in the case of random walk of integers.Xn 0 -

The reflection principle
According to the conventional perspective, we will be worried about the courses of action or arrangements of finitely addition of ones or subtraction of ones.Considering n=p+q symbols a1, a2, ..., an, each representing positive or negative one; suppose p represent +1 and q represents -1.The partial sum Sk= a1+a2+...+ak represents the difference between the number of addition and subtraction that took place at the first terms.So,

.(2)
A path from the origin to any out of all possible point (n,x) exist only if n and x obeys equation ( 2).Concerning this case, the p places for the positive ak can be chosen from the n=p+q available places in N(n,x) different ways, For the case of conveniences, we define N(n,x) equals zero whenever n and x does not go with equation (2).In relation to this gathering, there exists N(n,x) different routes or paths from the origin to an arbitrary point (n,x).

LEMMA (REFLECTION PRINCIPLE)
The number of paths from A to B which touches the x-axis equals the number of all paths from A' to B.
PROOF: Considering a path from A to B having more than one or more vertices on the t-axis (Sa, Sa+1 …, Sb).Let t be the abscissa of the first of the vertices; therefore, we choose t so that Sa>0, …, St-1>0, St=0.Then (-Sa, -Sa+1, …, -St-1, St=0,St+1,St+2,…,Sb) is a path starting from A' to B and having T=(t,0) as it initial vertex on the t-axis.The part AT and A'T being reflections of each other, and there exist a balance correspondence between all paths from A' to B and such paths from A to B that have a vertex on the axis.

The main lemma
To act in accordance with the notations to be later used in this scheme, we shall denote the individual steps comprehensively by x1, x2, … and the positions of the particle by S1, S2, … Thus, Sn=x1+x2+…+xn, where S0=0 ..........( 4) From any particular path one can read off the corresponding values of x1, x2, … ; that is, Xk are functions of the path.
For example: given the diagram Clearly X1, X2 and X4 can be classified as positive one and X3, X5 and X6 as negative one, that is X1=X2=X4=1 and X3=X5=X6= -1 Generally, we shall describe all events by listing by listing the appropriate conditions of the sum Sk.Thus, the event "at specified time n, the particle is at the point x" will be represented by {Sn=x}.Then for the probability we have Pn,r.The number Nn,r having paths from the origin to the point (n,r) is given by equation Simplified from equation (5).
And looking at the return to the origin, the first turn command special attention to itself.A first return occurs at epoch 2v if S1 ≠ 0, …, S2v-1≠0, but S2v = 0 F0 is usually taken to be zero by definition, and the probability for this event is denoted by F2v.The probabilities F2v and U2v are related in a notable manner.A visit to the origin at epoch 2v may be the first return, or else the first return occurs at epoch 2k<2v, and it is followed closely by a renewed return 2v-2k time units later.The probability of the later contingency is F2kU2v-2k because there are 2 2k F2k paths of length 2k ending with a first return, and 2 2v-2k U2v-2k paths from the point (2k,0) to (2v,0).It then implies that, The equation (10) will be an integer only when both n and Xn are both even or both odd, that is to move from the origin to X=9, it is a must we take an odd number of steps.Now, we let Pn,x be the probability that the work is at state x for n steps assuming that x is a positive integer.Therefore, Pn,x = P(Xn=x) Rn is given as a binomial random variable with index n with probability P.since the walker can either move to the right or not at every step, and the steps are independent, then Pn,x = (  + 2 ) P ½(n+x) q n-½(n+x) .. )P ½(n+x) q ½(n-x) Where (n,x) are both even or both odd and -n ≤ x ≥ n.Note that a similar argument can be constructed if x is a negative integer.
For symmetric case p=½.Starting from the origin, there are 2n different paths of length n since there is a choice of right or left move at each step.Since the number of steps in the right direction must be ½(n+x) and the total number of paths must also equal the number of ways in which ½(n+x) can be chosen from n.
That is; Where, n=p+q and x=p-q Nn,x= Provided that ½(n+x) is an integer By counting rule, the probability that the walker ends at x after n steps is given by the ratio of this number and the total number of paths (since all paths are equally likely).Therefore, The probability Pn,x is the probability that the walk ends at state x after n steps.The work should have overshot x before returning there.

Probability of first return
A related probability d the probability that the first visit of position x happens at the nth step coming up next is expressive determination of the related probability generating functions of the symmetric random walk, in which the walker starts at the origin, and we consider the probability that it returns to the origin.
From equation (11) the probability that a walker.isat the origin at step n is, ) ½n ( ) ½n = (   2 ) 2 -n =pn , (n=2,4,6, …) ………………………… (12) Therefore, on is the probability that after n steps the position of walker is at origin.And it is therefore assumed that Pn equals zero if n is odd.From equation (12), generating function can be constructed; Note that P0=1, and G(s) is not equal to1, for it is not a probability generating function.
Therefore, the binomial coefficient can be re-arranged as follows; Then using equation ( 12) and (13) By binomial theorem, provided |s|<1.Note that these expansions guarantee that Pn = 0 if n is odd.We should also be informed that the equation ( 14) does not sum to one.This is called defective distribution which still gives the probability that the walker is at the origin at step n.
We can also estimate the behavior of Pn for n by using the Stirling's formula (asymptotic estimate for n! for large n), that is as n → ∞.
As n becomes so large, therefore nPn→0, support supporting the notion that series ∑   ∞ =0 must diverge.

=0.2592
And the probability of returning to the origin is given by P5=0, because n is odd and the probability is zero (that is, it can never return to the origin), and if we had to calculate the probability will be greater than 1, which declaims the law of probability.

EXAMPLE 2:
Also consider a random walk on an integer number line from Xk=0, calculate the probability of returning to the origin after 4 steps?

SOLUTION:
For probability of returning to the origin And n=4, which is the number of steps =0.375

The ballot theorem
Suppose that in an election having contestant's F and G.In a ballot where candidate F scores f votes and candidate G scores g votes in a total of H accredited voters, where g<f.The probability that throughout the voting, candidate F will always be strictly ahead of G equals (f-g)/(f+g).
The outcome was first published by W.A. WHITWORT in the year 1878, but was later named JOSEPH LOUISE BERTRAND, who rediscovered it in 1887.This theorem is proved by reflection, induct induction and permutation.

Proof by reflection
For F to be strictly ahead of G all through the counting of the votes, there can be no ties.Separate the counting successions as per the primary vote.Any arrangement that starts with a vote in favor of G must arrive at a tie sooner or later, in light to the fact that F wins eventually.For any grouping that starts F and arrive at a tie reflects the vote up to the point of the first tie (so any F turns G, as well as the other way round) to acquire a succession or sequence that starts with G. Henceforth, every grouping that starts with F and arrives at a tie is unbalanced correspondence with an arrangement that starts with G, and the probability that a sequence starts with G is g/(f+g), so the probability that F always leads the votes equals, = 1-(the probability of sequences that tie at some point) =1-(the probability of sequence that tie at some point and begin with either F or G) =1-2(q/p+q) =(p-q)/(p+q)

PROOF BY INDUCTION: By mathematical Induction.
We release the condition g<f to g≤f.Obviously, the theorem is correct when f=g, since for this situation, the first candidate will not be strictly or totally ahead after every one of the votes have been counted (so the probability is zero).
Clearly, the theorem is valid if f>0 and g=0 when the probability is 1, considering that is first candidate gets every one of the votes; it is likewise true when f=g>0 as we have recently seen.
Accept it is also valid when f=a-1 and q=b, and when f=a and q=b-1, with a>b>0.Then looking through the case f=a and g=b, the last vote counted is either for the principal candidate i.e first candidate with probability a/(a+b) or for the second with probability b/(a+b).So the probability of the first being ahead all through the build up to the penultimate vote counted (and furthermore after the last vote) is given by ; And so it is true for all f and g with p>q>0.

Proof by permutation
A straightforward proof depends on an excellent cycle lemma of DVORETZKY and MOTZKIN, call a ballot sequence overwhelming.Assuming F is strictly in front of throughout the counting of the votes.The cycle lemma declares that any sequence of f F's and g G's, where g<f has definitely f-g ruling cyclic changes.To see this, simply arrange the given sequence of f+g F's and G's all around and, over and again eliminate nearby matches FG until just f-g F's remain.Every one of these F's was the beginning of a ruling cyclic change prior to anything was eliminated.So f-g out of the f+g cyclic changes of any arrangement of f F's votes and g G's votes.

EXAMPLE
Suppose there are five voters, of whom 3 votes for candidate F and 2 votes for candidate G which implies p=3 and q=2.There are ten possibilities for the order of the cast, getting this from the combinatorial analysis i.e 5 C2 =10 √FFFGG √FFGGF √GFGFF

Candidate
For every selection the count for F is bigger all the time than the count of G, so F is bigger all the time than the count of G, so F is strictly ahead of G.For the arrangement FFGGF, the count of the votes as the political race advances is; For this arrangement, G is tied with G after the fourth vote, so F is not strictly or totally ahead of G all the time.And of the ten potential arrangements, F is ahead of G all the time only for FFFGG and FFGFG, so the probability that F will constantly be strictly ahead of G is ⅕ And looking at the formula the theorem predicts, which is; Then it is indeed equal.
So, rather than figuring the probability that the random vote counting arrangement as the ideal property, one can rather register the quantity of good counting orders, then divide by the total number of ways in which the votes might have been counted.The absolute number of ways is the binomial coefficient ( +  ) ; The proof shows that the number of good arrangement in which the vote is supposed to be counted is; Then after solving explicitly and divided, we have; Using A2k,2n= U2kU2n-2k, k=0,1,2 Which implies that the three values when n=2 that is k=0,1,2 are ⅜, ¼ and ⅜ For n=10, it is shown in the table below, and note the central term is always the smallest A2k,20 0.1767 0.0927 0.0736 0.0655 0.0627 0.0606

Continuous arc sine distribution
The main features of the arc sine distribution are best explained by means of the graph of the function; Using Stirling's formula it is seen that U2n is approximately (πn) -½ except when the graph of F(x)= .The construction shed light on the approximation n quite small.This results to; A2k,2n≈ n -1 f(xk), where xk=n -1 k; The error encountered is ignorable except when k is very much closer to zero or n.
For 0<p<q<1 and large n, the sum of the probabilities A2k,2n with pn<k<qn is there for close to or equal to the area under the graph of F and above the interval p<x<q.This remains right also for p=0, which means it is right also for q=1, since p+q=1.Because the total area beneath the graph equals one which is also true for the sum overall A2k,2n lastly, F(x)=

Changes of sign
The practical study of chance fluctuations challenges us with a lot of paradoxes, for example one should naively expect that in a lengthy coin-tossing game, the observed number of changes of lead should increase roughly in proportion to the duration of the game.Peter should lead about twice as often in a game that lasts twice as long, this spontaneous reasoning is false.This will be shown that, in a sense to be made precise, there should be √ trials in the number of changes of lead in n-trials, that is in 100n trials one should expect only 10times as many changes as lead as in n-trials.Which clearly proves that once more that the waiting times amidst successive equalizations are likely to be very long.
We recall to random walk terminology, a change of sign is said to occur at a particular time n if Sn-1 and Sn+1 are of opposite signs.That is in the cases Sn=0, where n is necessarily an even (Positive) integer.
In situations like this, we say the maximum is less than "a" but greater than or equals zero since S0=0.Let T= (n, f) be a vertex with ordinate f≤ a.A path from equation (1) to T touches or crosses the line x = a if it violates equation (1).
Recalling the reflexion principle the number of such paths equals the number of paths from the origin to the point T'=(n,2a-f) which is the reflexion of T of the line x=a.
LEMMA1: let f ≥ a, the probability that a path of length n leads to T= (n, k) and has a maximum less than or equals, Pn,2af = P{Sn=2a-f}.
The probability that the maximum equals "a" is given by the difference Pn,2a-f-Pn,2a+2-f Summing over all f≤ a we result to the probability that an arbitrary part of length n has a maximum exactly equal to a.The sum reduces to Pn, a+ Pn, a+1.Now Pn, a disappears unless n and a have the same thing and in this case Pn, a+1=0, we therefore have,
We therefore come to a notion that plays a very crucial role in the general theory of stochastic processes.A first passages through the point a>0 is said to take place at epoch n if; S1<a, …, Sn-1<a, Sn=a .................... (3).
Looking closely at the present context, it would be preferable to speak of the first visit, but the term first passage is well produced; furthermore, the term visit is not at all related to continuous process.
Clearly, a path satisfying equation (2) must pass through (n-1, a-1) and its maximum up to epoch n-1 must equal a-1.
It is then clear that the probability for this event equals Pn-1, a-1-Pn-1, a+1, and we also have Note: the value of n and must be even or two of them must be odd so that (n+2)/a will be an integer, if the above condition is not satisfied, the binomial coefficient will always be interpreted as zero.
The distribution in equation in equation ( 5) is most interesting when "a" is large.To obtain the probability that the first passage through "a" occurs before epoch N, we must sum Qa, n overall n≤ N. It then follows from the normal approximation that only those terms will contribute significantly to the sum for which a 2 /n is neither very large nor very small to zero.That is, the approximation is; In summation, it must be put in mind that "n" must be treated in the same equality as "a".

Randomwork and ruin problems
In this particular chapter, we shall be focusing on the Bernoulli trials, and again the clear picture of betting and how random walk is being implemented and used to simplify and enliven the data.Let us take a gambler for instance, wins a dollar with probability of "p" and losses a dollar with probability of "q".Let "z" represents his initial capital and let him play against an opponent with initial capital "a-z", making "a" the total capital of both the gambler and his opponent.The game will never stop until either one of the gambler or opponent is ruined, that is the gambler's capital is reduced to zero or increased to "a".Our interest here on this scheme is the probability of the gambler's ultimate ruin and the probability distribution of the duration of the game.This is referred to as the real classical ruin problem.
Real life applications and analogies brought about the more flexible interpretation in term of the notion of a variable point or "particle" on the x-axis.This suppose particle commence from the initial position "z", and accelerates at regular time intervals with a unit movement to the positive or negative x-axis, depending on whether the corresponding trial out resulted in either success or failure.The position of the particle after n-steps stands for the gambler's capital at the end of the nth trial.The particle therefore performs a random walk with absorbing barriers at "0" and "a", that is the trial automatically when for the first time reaches "0" or "a", which means the random walk is restricted to the possible positions 1,2,3, …, a-1; which implies the random walk is called unrestricted because of the absence of the absorbing state "0" and "a".
Note: Random walk is labelled symmetric when p=q= 1 2

The classical ruin problem
After denoting "z" as the gambler's capital; "a-z" as the opponent capital and "a" as their combine capital from the beginning of this chapter.We therefore go ahead and denote qz as probability of gamblers ultimate ruin and pz as the probability of him winning.In random walk theory terminologies, qz is the probability that the particle starting a + z will reach an absorbing state at zero and pz reaching an absorbing state at "a".We shall therefore show that pz + qz =1, so that the probability of an unending game will not be will not be considered.
After the first trial; The above argument will be baseless if p=q= We have therefore successfully proved the probability of gambler's ruin when p≠q and when p=q.To therefore get the probability of the gambler's winning which also mean the probability of the opponent's ruin, we replace p, q and z by q, p and a-z respectively.Then we have; We can again formulate our result differently as follows; Let a gambler with an initial capital z, play against an infinitely rich opponent who is always ready who is always ready to play, and then the gamblers given opportunity to stop at his  At the beginning of the series of a series of games, Peter as a gambler had $90 when there is nothing in the machine and there is $10 in the machine from the onset.Peter then decided to play until either he is ruined or there is no money in the machine, was the game fair?And what was is expected gain?Inputting the value of p, q, z and a into   yields; =0.86556937966 Which implies;   = 0.1344306234 The game can only be fair if p=q, and since 0.45≠0.55,then the game is not fair.And for expected gain; Which implies lost since it has negative.
The limiting case a=∞ in relating to a game against infinitely rich adversary.Letting a→∞ in equation (4.7) and (4.9), yields; Where   represents the probability of the gambler`s ultimate ruin with z as the initial capital playing against an infinitely rich adversary.That is the gambler will always be ruin when playing an infinitely rich adversary, given that p ≤ q (just as the case of bet9ja).In the case of random walk terminology,   is the probability that a particle starting at z > 0 will never get to the origin, that is, in the case of a walker starting at the origin, the probability of ever getting to the position z > 0 is 1 if p ≤ q and equals (   )  when p > q.

Expected duration of the game
The probability distribution of the duration of the game will be proved in the following section, therefore the expected value can be derived by a much easier way.We shall therefore assume that the game duration has a finite expectation "D".
If the initial trial results in success, we continue the game as if the initial position is already z+1.Then the conditional expected duration assuming success at the first trial is Dz+1.The proof of the above affirmation shows that the expected duration Dz satisfies the difference equation.Here again, the method stop working when p=q= NOTE: This game duration is considered longer than we might have imagined.Taking a look into two players with 300 dollars each, engaging in a coin tossing game until one is ruined, the average duration of this game is 9000 dollars.And if a gambler with just 1 dollar is playing against an adversary with 1000 dollar the average duration is 1000 trials using equation (4.18) Let us also consider a game against an infinitely rich adversary, whereby a tends to infinity, if p >q, the game may last forever, and considering this case there will be nothing like expected duration, and when p is < q, we use the formula  − to get the expected duration, but in the case when p=q, the expected duration is said to be infinite.

Conclusion
According to this project, Random Walk Theory as far as this project is concerned is more applicable in ballot theorem; and in gambler`s ruin, whereby the gambler`s initial capital is "z", with "a" total capital.The probability of the gamblers ultimate ruin when playing against an infinitely rich opponent is one, and in a situation where both the gambler and the adversary are both infinitely rich, and p = q, the game might last forever, unless the game is stopped.The Gambler`s ruin problem is a great example of how you can take a complex situation and derive an easy general form from it using statistical tools.It might be difficult to believe that, given a fair game (where p = q).The probability of someone winning enough games to claim the total capital of both players is determined by their initial and total capital.This conclusion that we arrived at was enhanced by the use of an additional view.Additionally, its not advisable for a gambler who is not infinitely rich playing and locking horns with an infinitely rich opponent in an unfair game.
The Random Walk Theory posits that within an efficient market, stock prices exhibit randomness due to their inherent unpredictability and the influence of financial demands.Responses to market movements are driven by financial necessities and individual decisions.According to the Random Walk Theory, entrusting fund managers to navigate the unpredictable nature of stock prices may not guarantee sustained success, as luck plays a significant role and achieving alpha returns in subsequent years remains uncertain.Passive investors, adhering to the principles of the Random Walk Theory, tend to favor passive ETF investments over actively managed funds.This preference arises from the observation that fund managers often fail to surpass the market index, leading to a desire to avoid high fees associated with active management (Sinha, 2024).

Disclosure of conflict of interest
No conflict of interest to be disclosed.

1 .
Last visit and long leads3.1.1.Theorem: (Arc sine law of last visits)The probability that up to and including epoch 2n the last visit to the origin occurs epoch 2k is given by A2k,2n = U2kU2n-2k, k=0,1,2, …, n PROOF: We are majorly concerned with paths satisfying the conditions S2k=0 and S2k-1≠0.The first 2k vertices can be selected in 2 2k U2k different ways.Taking the points (2k,0) as new origin using P {S1≠0, …, S2n≠0} = P{S2n=0} =U2n, we see that the next (2n-2k) vertices can be chosen in 2 2n-2k U2n-2k ways.Divided by 2 2n we get; Ak2,2n= U2kU2n-2k, k=0,1, …, n.It follows from the theorem in the above equation add to one.Then the probability distribution which attaches weight A2k,2n to the point 2k is referred to as THE DISCRETE ARC SINE DISTRIBUTION OF ORDER n, because Arcsine function provides excellent numerical approximations.The distribution is symmetric in the sense that;

1 𝜋√𝑥( 1 1 √𝑥 2 𝜋sin − 1 √𝑥
−), 0<x<1 can be integrated explicitly and we conclude that for fixed 0<x<1 and n trending to infinite.Which implies that the continuous Arc sine distribution denoted by; B(x)= And when the value of x is greater than half, we take B(1-x) = B(x) Which implies that B(1-x) =

1 2 2 ,
Therefore, the equation (4.7) is meaningless because in this case the two formal particular solutions qz =1 and qz= ( we have a second solution in qz =z, which implies; the value of A and B into equation (4.8) makes it becomes

.
+1 +  −1 + 1 , 0<z<a ……………………………………(4.14)The significant of one in the equation makes it non-homogeneous.If it`s in the case of  ≠ , we will have   =  (−) , which is a formal solution of the above equation with boundary condition D0 = 0, and Da = 0The difference  of any two solutions of equation (4.14) also satisfies the homogeneous equation;  =  +1 +  −1 , and we already know from the beginning of the chapter that every solution of this equation are of the form; It implies that when p ≠ q, every solution of equation (4.14) are of the form;

1 2 1 2
to do away with the breakdown, we replace  − by -Z 2, And then it implies that all solution of the form 4.14 with P=q= are of the form; |Dz = -Z 2 +A + Bz ………..(4.17)Working the boundary condition D0 = 0 and Da =0, we have that A= 0 A 2 + Ba =0 B=a Impute the value of A and B with (4.17) yields, Dz =-Z 2 + az Dz = Z (a-z) ………(4.18)Thisimplies that equation (4.16) and (4.18) gives us the expected duration of the game in classical ruin problem of when p ≠ q and when p = q =

. Markov Chain Monte Carlo (MCMC) Methods: MCMC methods, which include random walk Metropolis-Hastings and Gibbs sampling, are widely used in AI for sampling from complex probability distributions. These methods are employed in tasks such as Bayesian inference, parameter estimation, and generative modeling. d. Randomized Algorithms: Random walk techniques are utilized in randomized algorithms to efficiently solve
Here are some key applications of random walk theory in AI: a. Graph Search Algorithms: Random walk algorithms are used in graph-based search algorithms like Random Walk Monte Carlo (RWMC) and Random Walks on Graphs (RWG).These algorithms explore large graphs efficiently by randomly traversing nodes and edges, making them useful

Table 1
Example of Random Walk

Table 3
Discrete Arc Sine Distribution of Order 10 Let us assume a game played by Joshua who owns 80dollar and John 20dollar, letting p=0.45, with the game being unfair to Joshua.If the stake is 1dollar at each trial, find the probability of Joshua ruin?If the stake is then increased to 10dollars in the same game, we will now see what the probability of Joshua turns out to be.