SlideShare a Scribd company logo
1 of 20
Online Algorithms
And their Applications
Definition
• In computer science, an online algorithm is one that can process its
input piece-by-piece in a serial fashion, i.e., in the order that the input
is fed to the algorithm, without having the entire input available from
the start.
• Online algorithms may produce the results that are not optimal as it
doesn’t have the complete input.
Offline Algorithms
• An offline algorithm is one which is given the whole problem data
from the beginning and is required to output an answer which solves
the problem at hand.
• Offline algorithms produce the optimal solution as it is given the
complete input.
Competitive Analysis
• Competitive analysis is a method of analyzing online algorithms, in
which the performance of an online algorithm is compared to the
performance of an optimal offline algorithm.
• The competitive ratio of an algorithm, is defined as the worst-case
ratio of its cost divided by the optimal cost, over all possible inputs.
• The competitive ratio of an online problem is the best competitive
ratio achieved by an online algorithm.
Secretary Problem
• The secretary problem is one of many names for a famous problem of the
optimal stopping theory. The problem has been studied extensively in the fields
of applied probability, statistics, and decision theory. It is also known as the
marriage problem, the sultan's dowry problem, the best choice problem, etc.
Formulation:
• Although there are many variations, the basic problem can be stated as
follows:
• There is a single secretarial position to fill.
• There are n applicants for the position, and the value of n is known.
• The applicants, if seen altogether, can be ranked from best to worst
unambiguously.
Secretary Problem
• The applicants are interviewed sequentially in random order, with each order
being equally likely.
• Immediately after an interview, the interviewed applicant is either accepted or
rejected, and the decision is irrevocable.
• The decision to accept or reject an applicant can be based only on the relative
ranks of the applicants interviewed so far.
• The objective of the general solution is to have the highest probability of
selecting the best applicant of the whole group. This is the same as maximizing
the expected payoff, with payoff defined to be one for the best applicant and zero
otherwise.
Terminology: A candidate is defined as an applicant who, when interviewed, is better than all
the applicants interviewed previously. Skip is used to mean "reject immediately after the
interview".
Secretary Problem
Strategy to solve:
One strategy could be-
Always pick the ith candidate from some predetermined i ϵ [1,N]
P(Success) = 1/N
We can do much better than 1/N by applying the following rule, which yields the
optimal solution:
Interview and reject the first r applicants, for r < N. Accept the very next applicant
that is better than all the first r you interviewed.
P(Success) =P(r)
We will now show that the optimal solution is found by optimizing P(r) by the
standard route of solving:
P’(r) = 0
Secretary Problem
• Solution:
The following diagram will be helpful to visualize the problem:
Let R be the last applicant you will see before you actually start considering
hiring anyone (the last one you're going to reject no matter what). Let the
best applicant of all N, i* occur arbitrarily at n + 1, and N is the total number
of applicants you have the potential to interview. We then can say that i* will
not be chosen unless both of the following conditions are met:
Secretary Problem
1. n ≥ r
2. The highest applicant in [1, n] is the same highest applicant in [1, r]
The probability of this happening for some given n is
This basically stems from the fact that the probability of i* occuring at
n+1 is 1/N and the probability of condition (2) is r/n . We can obtain
P(r) by summing over all possible n ≥ r :
Secretary Problem
By inspecting the expression in the limit as N → ∞, letting
and , we find the following:
So in the limit as N grows in infinitely large, we find that the ratio of
applicants reviewed and rejected to the number of total applicants
approaches x. We see then that solving P’( r ) = 0 for r gives us the
optimal ratio and the probability of success P(roptimal).
Secretary Problem
The ratio of r to N is optimal at 1/e yielding a probability of success of,
coincidentally, 1/e as well. So for N >> 1 the roptimal is nearly N/e,
otherwise it can be found by computing P(r) directly.
Secretary Problem
All Together Now
• The secretary problem is the problem of deciding whether or not one should stick with
what they have or take their chances on something new.
• Examples of secretary problems include finding a husband or wife, hiring a secretary, and
alligator hunting.
• The solution to the secretary problem suggests that the optimal dating strategy is to
estimate the maximum number of people you’re willing to date, (N), and then date
(sqrt{N}) people and marry the next person who is better than all of those.
• In laboratory experiments, people often stop searching too soon when solving secretary
problems. This suggests that the average person doesn’t date enough people prior to
marriage.
• At the end of the day, the secretary problem is a mathematical abstraction and there is
more to finding the “right” person than dating a certain number of people.
Applications: Stock Market
Stock Market
• The market in which shares of publicly held companies are issued and
traded either through exchanges or over-the-counter markets. Also
known as the equity market, the stock market is one of the most vital
components of a free-market economy, as it provides companies with
access to capital in exchange for giving investors a slice of ownership
in the company.
• The stock market makes it possible to grow small initial sums of
money into large ones, and to become wealthy without taking the risk
of starting a business or making the sacrifices that often accompany a
high-paying career.
Stock Market
• Today, most stock market trades are executed electronically, and even
the stocks themselves are almost always held in electronic form, not
as physical certificates.
Stock Market Prediction
• Stock market prediction is the act of trying to determine the future
value of a company stock or other financial instrument traded on an
exchange. The successful prediction of a stock's future price could
yield significant profit. The efficient-market hypothesis suggests that
stock price movements are governed by the random walk hypothesis
and thus are inherently unpredictable. Others disagree and those
with this viewpoint possess myriad methods and technologies which
purportedly allow them to gain future price information.
• Some believe that the prediction of share price is pure speculation
but some believe that there is some mathematics involved.
Use of Algorithm in Stock Prediction
• Online algorithms play an important role in stock prediction.
• We can develop algorithms which can predict future price of stocks to
some extent with some probability of error in prediction.
• Believing that history repeats itself, a potential algorithm for stock
prediction could be developed which gives the output based on the
previous data of stock prices available and generate results.
Use of Algorithm in Stock Prediction
• Is there any algorithm available which could predict the stock price
with 100% accuracy??
Portfolio Management
• The term portfolio refers to any collection of financial assets such as
cash, shares. Portfolios may be held by individual investors and/or
managed by financial professionals, hedge funds, banks and other
financial institutions.
• Portfolio Management is the art and science of making decisions
about investment mix and policy, matching investments to objectives,
asset allocation for individuals and institutions, and balancing risk
against performance.
Vikas Jindal
B.Tech., CSE
IIT Patna
vikasjindal.iitp@gmail.com
Thank You!

More Related Content

What's hot

Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...Simplilearn
 
Online Algorithms - An Introduction
Online Algorithms - An IntroductionOnline Algorithms - An Introduction
Online Algorithms - An IntroductionAmrinder Arora
 
Mathematics Foundation Course for Machine Learning & AI By Eduonix
Mathematics Foundation Course for Machine Learning & AI By Eduonix Mathematics Foundation Course for Machine Learning & AI By Eduonix
Mathematics Foundation Course for Machine Learning & AI By Eduonix Nick Trott
 
Genetic algorithms vs Traditional algorithms
Genetic algorithms vs Traditional algorithmsGenetic algorithms vs Traditional algorithms
Genetic algorithms vs Traditional algorithmsDr. C.V. Suresh Babu
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm AnalysisMary Margarat
 
Bayesian networks in AI
Bayesian networks in AIBayesian networks in AI
Bayesian networks in AIByoung-Hee Kim
 
Singular Value Decompostion (SVD)
Singular Value Decompostion (SVD)Singular Value Decompostion (SVD)
Singular Value Decompostion (SVD)Isaac Yowetu
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysissumitbardhan
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notationsEhtisham Ali
 
Recurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRURecurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRUananth
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic NotationsRishabh Soni
 
Foundations of Machine Learning
Foundations of Machine LearningFoundations of Machine Learning
Foundations of Machine Learningmahutte
 

What's hot (20)

Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
 
Online Algorithms - An Introduction
Online Algorithms - An IntroductionOnline Algorithms - An Introduction
Online Algorithms - An Introduction
 
Mathematics Foundation Course for Machine Learning & AI By Eduonix
Mathematics Foundation Course for Machine Learning & AI By Eduonix Mathematics Foundation Course for Machine Learning & AI By Eduonix
Mathematics Foundation Course for Machine Learning & AI By Eduonix
 
Genetic algorithms vs Traditional algorithms
Genetic algorithms vs Traditional algorithmsGenetic algorithms vs Traditional algorithms
Genetic algorithms vs Traditional algorithms
 
Analysis of algorithm
Analysis of algorithmAnalysis of algorithm
Analysis of algorithm
 
Data Structures and Algorithm Analysis
Data Structures  and  Algorithm AnalysisData Structures  and  Algorithm Analysis
Data Structures and Algorithm Analysis
 
Greedy algorithm
Greedy algorithmGreedy algorithm
Greedy algorithm
 
Artificial Neural Networks for Data Mining
Artificial Neural Networks for Data MiningArtificial Neural Networks for Data Mining
Artificial Neural Networks for Data Mining
 
Bayesian networks in AI
Bayesian networks in AIBayesian networks in AI
Bayesian networks in AI
 
asymptotic notation
asymptotic notationasymptotic notation
asymptotic notation
 
Singular Value Decompostion (SVD)
Singular Value Decompostion (SVD)Singular Value Decompostion (SVD)
Singular Value Decompostion (SVD)
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
 
Density based clustering
Density based clusteringDensity based clustering
Density based clustering
 
Dbscan algorithom
Dbscan algorithomDbscan algorithom
Dbscan algorithom
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Principal Component Analysis
Principal Component AnalysisPrincipal Component Analysis
Principal Component Analysis
 
Recurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRURecurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRU
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
Decision Tree Learning
Decision Tree LearningDecision Tree Learning
Decision Tree Learning
 
Foundations of Machine Learning
Foundations of Machine LearningFoundations of Machine Learning
Foundations of Machine Learning
 

Viewers also liked

5 + 1 ingrediente pentru o prezentare de succes
5 + 1 ingrediente pentru o prezentare de succes5 + 1 ingrediente pentru o prezentare de succes
5 + 1 ingrediente pentru o prezentare de succesNosco Learning
 
All_Care's_PowerPoint_Presentation (1)
All_Care's_PowerPoint_Presentation (1)All_Care's_PowerPoint_Presentation (1)
All_Care's_PowerPoint_Presentation (1)Maria Foxhall
 
David J. Alder Resume
David J. Alder ResumeDavid J. Alder Resume
David J. Alder ResumeDavid Alder
 
Indiabankingsectorreportaugust2013 140201021707-phpapp01
Indiabankingsectorreportaugust2013 140201021707-phpapp01Indiabankingsectorreportaugust2013 140201021707-phpapp01
Indiabankingsectorreportaugust2013 140201021707-phpapp01Supa Buoy
 
0601044 icici prudential life insurance
0601044 icici prudential life insurance0601044 icici prudential life insurance
0601044 icici prudential life insuranceSupa Buoy
 
0601021 equity research
0601021 equity research 0601021 equity research
0601021 equity research Supa Buoy
 
0601054 commodity market
0601054 commodity market0601054 commodity market
0601054 commodity marketSupa Buoy
 
Study of market potential for enterprise messaging solution
Study of market potential for enterprise messaging solutionStudy of market potential for enterprise messaging solution
Study of market potential for enterprise messaging solutionSupa Buoy
 
0601080 ales promotion activities in patna urban market
0601080 ales promotion activities in patna urban market0601080 ales promotion activities in patna urban market
0601080 ales promotion activities in patna urban marketSupa Buoy
 
Software requirements specification of Library Management System
Software requirements specification of Library Management SystemSoftware requirements specification of Library Management System
Software requirements specification of Library Management SystemSoumili Sen
 
Leading Jordanian Company Integrated Technology Group showcases its innovativ...
Leading Jordanian Company Integrated Technology Group showcases its innovativ...Leading Jordanian Company Integrated Technology Group showcases its innovativ...
Leading Jordanian Company Integrated Technology Group showcases its innovativ...learnafrica2
 
Tugas 2
Tugas 2Tugas 2
Tugas 2cinjy
 
OTDK_Kémiai reakciók Raman-jel alapú szabályozásának fejlesztése
OTDK_Kémiai reakciók Raman-jel alapú szabályozásának fejlesztéseOTDK_Kémiai reakciók Raman-jel alapú szabályozásának fejlesztése
OTDK_Kémiai reakciók Raman-jel alapú szabályozásának fejlesztéseHenrik Bata
 
CV via pic
CV via picCV via pic
CV via picEng Nk
 

Viewers also liked (18)

5 + 1 ingrediente pentru o prezentare de succes
5 + 1 ingrediente pentru o prezentare de succes5 + 1 ingrediente pentru o prezentare de succes
5 + 1 ingrediente pentru o prezentare de succes
 
All_Care's_PowerPoint_Presentation (1)
All_Care's_PowerPoint_Presentation (1)All_Care's_PowerPoint_Presentation (1)
All_Care's_PowerPoint_Presentation (1)
 
Blended learning
Blended learningBlended learning
Blended learning
 
David J. Alder Resume
David J. Alder ResumeDavid J. Alder Resume
David J. Alder Resume
 
Libro el caballero de la armada oxidada
Libro el caballero de la armada oxidadaLibro el caballero de la armada oxidada
Libro el caballero de la armada oxidada
 
Indiabankingsectorreportaugust2013 140201021707-phpapp01
Indiabankingsectorreportaugust2013 140201021707-phpapp01Indiabankingsectorreportaugust2013 140201021707-phpapp01
Indiabankingsectorreportaugust2013 140201021707-phpapp01
 
0601044 icici prudential life insurance
0601044 icici prudential life insurance0601044 icici prudential life insurance
0601044 icici prudential life insurance
 
0601021 equity research
0601021 equity research 0601021 equity research
0601021 equity research
 
0601054 commodity market
0601054 commodity market0601054 commodity market
0601054 commodity market
 
Study of market potential for enterprise messaging solution
Study of market potential for enterprise messaging solutionStudy of market potential for enterprise messaging solution
Study of market potential for enterprise messaging solution
 
0601080 ales promotion activities in patna urban market
0601080 ales promotion activities in patna urban market0601080 ales promotion activities in patna urban market
0601080 ales promotion activities in patna urban market
 
Software requirements specification of Library Management System
Software requirements specification of Library Management SystemSoftware requirements specification of Library Management System
Software requirements specification of Library Management System
 
Leading Jordanian Company Integrated Technology Group showcases its innovativ...
Leading Jordanian Company Integrated Technology Group showcases its innovativ...Leading Jordanian Company Integrated Technology Group showcases its innovativ...
Leading Jordanian Company Integrated Technology Group showcases its innovativ...
 
Sprains
SprainsSprains
Sprains
 
Tugas 2
Tugas 2Tugas 2
Tugas 2
 
OTDK_Kémiai reakciók Raman-jel alapú szabályozásának fejlesztése
OTDK_Kémiai reakciók Raman-jel alapú szabályozásának fejlesztéseOTDK_Kémiai reakciók Raman-jel alapú szabályozásának fejlesztése
OTDK_Kémiai reakciók Raman-jel alapú szabályozásának fejlesztése
 
CV via pic
CV via picCV via pic
CV via pic
 
CIA 4 COMS 1010
CIA 4 COMS 1010CIA 4 COMS 1010
CIA 4 COMS 1010
 

Similar to Online Algorithms Guide to Stock Prediction

Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniquesAshutosh Garg
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniques2PiRTechnologies
 
Supervised learning
Supervised learningSupervised learning
Supervised learningJohnson Ubah
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxkitsenthilkumarcse
 
Numerical Analysis And Linear Algebra
Numerical Analysis And Linear AlgebraNumerical Analysis And Linear Algebra
Numerical Analysis And Linear AlgebraGhulam Murtaza
 
Fundamentals of Quantitative Analysis
Fundamentals of Quantitative AnalysisFundamentals of Quantitative Analysis
Fundamentals of Quantitative AnalysisJubayer Alam Shoikat
 
introduction to Numerical Analysis
introduction to Numerical Analysisintroduction to Numerical Analysis
introduction to Numerical AnalysisGhulam Mehdi Sahito
 
Unit 3 – AIML.pptx
Unit 3 – AIML.pptxUnit 3 – AIML.pptx
Unit 3 – AIML.pptxhiblooms
 
Rinse and Repeat : The Spiral of Applied Machine Learning
Rinse and Repeat : The Spiral of Applied Machine LearningRinse and Repeat : The Spiral of Applied Machine Learning
Rinse and Repeat : The Spiral of Applied Machine LearningAnna Chaney
 
Dowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceDowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceAmit Sharma
 
Analytical thinking &amp; creativity
Analytical thinking &amp; creativityAnalytical thinking &amp; creativity
Analytical thinking &amp; creativityAbhishek Gupta
 
Machine Learning Methods 2.pptx
Machine Learning Methods 2.pptxMachine Learning Methods 2.pptx
Machine Learning Methods 2.pptxDOUGLASBILLY
 
9th Comp Ch 1 LQ.pdf
9th Comp Ch 1 LQ.pdf9th Comp Ch 1 LQ.pdf
9th Comp Ch 1 LQ.pdfNaeem Mughal
 
An introduction to machine learning and statistics
An introduction to machine learning and statisticsAn introduction to machine learning and statistics
An introduction to machine learning and statisticsSpotle.ai
 
unit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptxunit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptxDr.Shweta
 
Assignment oprations research luv
Assignment oprations research luvAssignment oprations research luv
Assignment oprations research luvAshok Sharma
 

Similar to Online Algorithms Guide to Stock Prediction (20)

Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniques
 
Test case design techniques
Test case design techniquesTest case design techniques
Test case design techniques
 
Business idea
Business ideaBusiness idea
Business idea
 
Supervised learning
Supervised learningSupervised learning
Supervised learning
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
 
Numerical Analysis And Linear Algebra
Numerical Analysis And Linear AlgebraNumerical Analysis And Linear Algebra
Numerical Analysis And Linear Algebra
 
Machine_Learning.pptx
Machine_Learning.pptxMachine_Learning.pptx
Machine_Learning.pptx
 
Fundamentals of Quantitative Analysis
Fundamentals of Quantitative AnalysisFundamentals of Quantitative Analysis
Fundamentals of Quantitative Analysis
 
introduction to Numerical Analysis
introduction to Numerical Analysisintroduction to Numerical Analysis
introduction to Numerical Analysis
 
Unit 3 – AIML.pptx
Unit 3 – AIML.pptxUnit 3 – AIML.pptx
Unit 3 – AIML.pptx
 
Rinse and Repeat : The Spiral of Applied Machine Learning
Rinse and Repeat : The Spiral of Applied Machine LearningRinse and Repeat : The Spiral of Applied Machine Learning
Rinse and Repeat : The Spiral of Applied Machine Learning
 
Operations Research
Operations ResearchOperations Research
Operations Research
 
5. Selecting samples.pdf
5. Selecting samples.pdf5. Selecting samples.pdf
5. Selecting samples.pdf
 
Dowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceDowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inference
 
Analytical thinking &amp; creativity
Analytical thinking &amp; creativityAnalytical thinking &amp; creativity
Analytical thinking &amp; creativity
 
Machine Learning Methods 2.pptx
Machine Learning Methods 2.pptxMachine Learning Methods 2.pptx
Machine Learning Methods 2.pptx
 
9th Comp Ch 1 LQ.pdf
9th Comp Ch 1 LQ.pdf9th Comp Ch 1 LQ.pdf
9th Comp Ch 1 LQ.pdf
 
An introduction to machine learning and statistics
An introduction to machine learning and statisticsAn introduction to machine learning and statistics
An introduction to machine learning and statistics
 
unit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptxunit 1.2 supervised learning.pptx
unit 1.2 supervised learning.pptx
 
Assignment oprations research luv
Assignment oprations research luvAssignment oprations research luv
Assignment oprations research luv
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Online Algorithms Guide to Stock Prediction

  • 2. Definition • In computer science, an online algorithm is one that can process its input piece-by-piece in a serial fashion, i.e., in the order that the input is fed to the algorithm, without having the entire input available from the start. • Online algorithms may produce the results that are not optimal as it doesn’t have the complete input.
  • 3. Offline Algorithms • An offline algorithm is one which is given the whole problem data from the beginning and is required to output an answer which solves the problem at hand. • Offline algorithms produce the optimal solution as it is given the complete input.
  • 4. Competitive Analysis • Competitive analysis is a method of analyzing online algorithms, in which the performance of an online algorithm is compared to the performance of an optimal offline algorithm. • The competitive ratio of an algorithm, is defined as the worst-case ratio of its cost divided by the optimal cost, over all possible inputs. • The competitive ratio of an online problem is the best competitive ratio achieved by an online algorithm.
  • 5. Secretary Problem • The secretary problem is one of many names for a famous problem of the optimal stopping theory. The problem has been studied extensively in the fields of applied probability, statistics, and decision theory. It is also known as the marriage problem, the sultan's dowry problem, the best choice problem, etc. Formulation: • Although there are many variations, the basic problem can be stated as follows: • There is a single secretarial position to fill. • There are n applicants for the position, and the value of n is known. • The applicants, if seen altogether, can be ranked from best to worst unambiguously.
  • 6. Secretary Problem • The applicants are interviewed sequentially in random order, with each order being equally likely. • Immediately after an interview, the interviewed applicant is either accepted or rejected, and the decision is irrevocable. • The decision to accept or reject an applicant can be based only on the relative ranks of the applicants interviewed so far. • The objective of the general solution is to have the highest probability of selecting the best applicant of the whole group. This is the same as maximizing the expected payoff, with payoff defined to be one for the best applicant and zero otherwise. Terminology: A candidate is defined as an applicant who, when interviewed, is better than all the applicants interviewed previously. Skip is used to mean "reject immediately after the interview".
  • 7. Secretary Problem Strategy to solve: One strategy could be- Always pick the ith candidate from some predetermined i ϵ [1,N] P(Success) = 1/N We can do much better than 1/N by applying the following rule, which yields the optimal solution: Interview and reject the first r applicants, for r < N. Accept the very next applicant that is better than all the first r you interviewed. P(Success) =P(r) We will now show that the optimal solution is found by optimizing P(r) by the standard route of solving: P’(r) = 0
  • 8. Secretary Problem • Solution: The following diagram will be helpful to visualize the problem: Let R be the last applicant you will see before you actually start considering hiring anyone (the last one you're going to reject no matter what). Let the best applicant of all N, i* occur arbitrarily at n + 1, and N is the total number of applicants you have the potential to interview. We then can say that i* will not be chosen unless both of the following conditions are met:
  • 9. Secretary Problem 1. n ≥ r 2. The highest applicant in [1, n] is the same highest applicant in [1, r] The probability of this happening for some given n is This basically stems from the fact that the probability of i* occuring at n+1 is 1/N and the probability of condition (2) is r/n . We can obtain P(r) by summing over all possible n ≥ r :
  • 10. Secretary Problem By inspecting the expression in the limit as N → ∞, letting and , we find the following: So in the limit as N grows in infinitely large, we find that the ratio of applicants reviewed and rejected to the number of total applicants approaches x. We see then that solving P’( r ) = 0 for r gives us the optimal ratio and the probability of success P(roptimal).
  • 11. Secretary Problem The ratio of r to N is optimal at 1/e yielding a probability of success of, coincidentally, 1/e as well. So for N >> 1 the roptimal is nearly N/e, otherwise it can be found by computing P(r) directly.
  • 12. Secretary Problem All Together Now • The secretary problem is the problem of deciding whether or not one should stick with what they have or take their chances on something new. • Examples of secretary problems include finding a husband or wife, hiring a secretary, and alligator hunting. • The solution to the secretary problem suggests that the optimal dating strategy is to estimate the maximum number of people you’re willing to date, (N), and then date (sqrt{N}) people and marry the next person who is better than all of those. • In laboratory experiments, people often stop searching too soon when solving secretary problems. This suggests that the average person doesn’t date enough people prior to marriage. • At the end of the day, the secretary problem is a mathematical abstraction and there is more to finding the “right” person than dating a certain number of people.
  • 14. Stock Market • The market in which shares of publicly held companies are issued and traded either through exchanges or over-the-counter markets. Also known as the equity market, the stock market is one of the most vital components of a free-market economy, as it provides companies with access to capital in exchange for giving investors a slice of ownership in the company. • The stock market makes it possible to grow small initial sums of money into large ones, and to become wealthy without taking the risk of starting a business or making the sacrifices that often accompany a high-paying career.
  • 15. Stock Market • Today, most stock market trades are executed electronically, and even the stocks themselves are almost always held in electronic form, not as physical certificates.
  • 16. Stock Market Prediction • Stock market prediction is the act of trying to determine the future value of a company stock or other financial instrument traded on an exchange. The successful prediction of a stock's future price could yield significant profit. The efficient-market hypothesis suggests that stock price movements are governed by the random walk hypothesis and thus are inherently unpredictable. Others disagree and those with this viewpoint possess myriad methods and technologies which purportedly allow them to gain future price information. • Some believe that the prediction of share price is pure speculation but some believe that there is some mathematics involved.
  • 17. Use of Algorithm in Stock Prediction • Online algorithms play an important role in stock prediction. • We can develop algorithms which can predict future price of stocks to some extent with some probability of error in prediction. • Believing that history repeats itself, a potential algorithm for stock prediction could be developed which gives the output based on the previous data of stock prices available and generate results.
  • 18. Use of Algorithm in Stock Prediction • Is there any algorithm available which could predict the stock price with 100% accuracy??
  • 19. Portfolio Management • The term portfolio refers to any collection of financial assets such as cash, shares. Portfolios may be held by individual investors and/or managed by financial professionals, hedge funds, banks and other financial institutions. • Portfolio Management is the art and science of making decisions about investment mix and policy, matching investments to objectives, asset allocation for individuals and institutions, and balancing risk against performance.
  • 20. Vikas Jindal B.Tech., CSE IIT Patna vikasjindal.iitp@gmail.com Thank You!