SlideShare a Scribd company logo
Introduction of calculus
in programming
Is it possible to write calculus function for c.
It would be very useful, I am sure it is possible because
there are math programs out there today
Use of calculus in programming
 A program in a functional language is a set of function definitions and an
expression usually
 formed using the defined functions. The Interpreter of the language evaluates this
expression by
 means of a discrete number of computation steps, in such a way its meaning turns
out to be
 represented in an explicit way. In general in programming we have not to produce
anything; in
 functional programming, in particular, what we modify is only the representation
of the
 information.
 A function can be defined in several ways.
Example:
 f: R -> R , g: R -> R
 f '' - 6g' = 6 sin x
 6g'' + a2 f ' = 6 cos x
 f(0) = 0, f '(0) = 0, g(0) = 1, g'(0) = 1
 This set of equations precisely identify two precise f and g.
To evaluate an expression in Scheme
 the application of a function to some arguments and then to evaluate the body of the
function
 in which the formal parameter is replaced by the actual parameter. In this way, in a
sense, we
 make the meaning of such sub-expression more explicit.
Example: let us evaluate Inctwo 3
 Inctwo 3 Inctwo is a user defined function, and it is applied to an argument, so we take
the
 body of the function, replace the formal parameter n by the actual parameter 3,
obtaining
 3+2, and then we evaluate 3+2 obtaining 5
evaluation strategy
 a policy enabling to decide on which sub-expression we shall perform the next
evaluation step.
 Some evaluation strategies could led me in a never ending path (this fact is
unavoidable)
Uses of calculus in
‘c++’ Language
#include<iostream.h>
Using name space std;
Int a,x,n,derivative;
Int main()
{
Cout<<”hellow.i am a computer program.I can calculate
the derivative of an expression using power rule.”;
Cout<<”n please type the values of a and n for use exp”;
Cout<<”n y=ax^n”;
Cin get();
Cout<<”a=?n”;
Cin>>a;
Cout<<”x=?,n=?n”
Cin>>x,n;
Derivative=a*n*(x^(n-1));
Cout<<”dy/dx=”<<derivative;
Return 0;
}
Thanks…………….
…………………………………………………………

More Related Content

What's hot

Programming with matlab session 4
Programming with matlab session 4Programming with matlab session 4
Programming with matlab session 4
Infinity Tech Solutions
 
Programming with matlab session 3 notes
Programming with matlab session 3 notesProgramming with matlab session 3 notes
Programming with matlab session 3 notes
Infinity Tech Solutions
 
Data structures Lecture no. 4
Data structures Lecture no. 4Data structures Lecture no. 4
Data structures Lecture no. 4
AzharIqbal710687
 
Pointers operation day2
Pointers operation day2Pointers operation day2
Pointers operation day2
Bhuvana Gowtham
 
16 subroutine
16 subroutine16 subroutine
16 subroutinefyjordan9
 
Arrays and Pointers
Arrays and PointersArrays and Pointers
Arrays and Pointers
SimoniShah6
 
Python recursion
Python recursionPython recursion
Python recursion
ToniyaP1
 
Pointers in C Language
Pointers in C LanguagePointers in C Language
Pointers in C Language
madan reddy
 
10. array & pointer
10. array & pointer10. array & pointer
10. array & pointer웅식 전
 
Use Of Calculus In Programming
Use Of Calculus In ProgrammingUse Of Calculus In Programming
Use Of Calculus In Programming
Afaq Siddiqui
 
DBMS CS3
DBMS CS3DBMS CS3
Pointers - DataStructures
Pointers - DataStructuresPointers - DataStructures
Pointers - DataStructures
Omair Imtiaz Ansari
 
Pointers
PointersPointers
Pointers
NabishaAK
 
LAB 1 Report.docx
LAB 1 Report.docxLAB 1 Report.docx
LAB 1 Report.docx
AhamedMusharaf1
 
Translation of expression(copmiler construction)
Translation of expression(copmiler construction)Translation of expression(copmiler construction)
Translation of expression(copmiler construction)
IrtazaAfzal3
 
R Functions
R FunctionsR Functions
R Functions
DataminingTools Inc
 
LAB 2 Report.docx
LAB 2 Report.docxLAB 2 Report.docx
LAB 2 Report.docx
AhamedMusharaf1
 
Code Optimizatoion
Code OptimizatoionCode Optimizatoion
Code Optimizatoion
rajuvermadsvv
 
Effective Java - Always override toString() method
Effective Java - Always override toString() methodEffective Java - Always override toString() method
Effective Java - Always override toString() methodFerdous Mahmud Shaon
 

What's hot (19)

Programming with matlab session 4
Programming with matlab session 4Programming with matlab session 4
Programming with matlab session 4
 
Programming with matlab session 3 notes
Programming with matlab session 3 notesProgramming with matlab session 3 notes
Programming with matlab session 3 notes
 
Data structures Lecture no. 4
Data structures Lecture no. 4Data structures Lecture no. 4
Data structures Lecture no. 4
 
Pointers operation day2
Pointers operation day2Pointers operation day2
Pointers operation day2
 
16 subroutine
16 subroutine16 subroutine
16 subroutine
 
Arrays and Pointers
Arrays and PointersArrays and Pointers
Arrays and Pointers
 
Python recursion
Python recursionPython recursion
Python recursion
 
Pointers in C Language
Pointers in C LanguagePointers in C Language
Pointers in C Language
 
10. array & pointer
10. array & pointer10. array & pointer
10. array & pointer
 
Use Of Calculus In Programming
Use Of Calculus In ProgrammingUse Of Calculus In Programming
Use Of Calculus In Programming
 
DBMS CS3
DBMS CS3DBMS CS3
DBMS CS3
 
Pointers - DataStructures
Pointers - DataStructuresPointers - DataStructures
Pointers - DataStructures
 
Pointers
PointersPointers
Pointers
 
LAB 1 Report.docx
LAB 1 Report.docxLAB 1 Report.docx
LAB 1 Report.docx
 
Translation of expression(copmiler construction)
Translation of expression(copmiler construction)Translation of expression(copmiler construction)
Translation of expression(copmiler construction)
 
R Functions
R FunctionsR Functions
R Functions
 
LAB 2 Report.docx
LAB 2 Report.docxLAB 2 Report.docx
LAB 2 Report.docx
 
Code Optimizatoion
Code OptimizatoionCode Optimizatoion
Code Optimizatoion
 
Effective Java - Always override toString() method
Effective Java - Always override toString() methodEffective Java - Always override toString() method
Effective Java - Always override toString() method
 

Similar to Introduction of calculus in programming

JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
vrickens
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
ziyadaslanbey
 
Unit 4.pdf
Unit 4.pdfUnit 4.pdf
Unit 4.pdf
thenmozhip8
 
Functionincprogram
FunctionincprogramFunctionincprogram
Functionincprogram
Sampath Kumar
 
Inroduction to r
Inroduction to rInroduction to r
Inroduction to r
manikanta361
 
cp Module4(1)
cp Module4(1)cp Module4(1)
cp Module4(1)
Amarjith C K
 
[ITP - Lecture 13] Introduction to Pointers
[ITP - Lecture 13] Introduction to Pointers[ITP - Lecture 13] Introduction to Pointers
[ITP - Lecture 13] Introduction to Pointers
Muhammad Hammad Waseem
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
Vikram Nandini
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
ethiouniverse
 
Book management system
Book management systemBook management system
Book management system
SHARDA SHARAN
 
Functions in c language
Functions in c languageFunctions in c language
Functions in c language
Tanmay Modi
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
tanmaymodi4
 
unit_2.pptx
unit_2.pptxunit_2.pptx
unit_2.pptx
Venkatesh Goud
 
Unit-III.pptx
Unit-III.pptxUnit-III.pptx
Unit-III.pptx
Mehul Desai
 
Functional Paradigm.pptx
Functional Paradigm.pptxFunctional Paradigm.pptx
Functional Paradigm.pptx
FurretMaster
 
Recursion
RecursionRecursion
Recursion
Nikxjon
 
Preprocessor directives
Preprocessor directivesPreprocessor directives
Preprocessor directives
Vikash Dhal
 
C function presentation
C function presentationC function presentation
C function presentation
Touhidul Shawan
 
Functions
Functions Functions
Functions
Dr.Subha Krishna
 

Similar to Introduction of calculus in programming (20)

JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
 
Presentation 2 (1).pdf
Presentation 2 (1).pdfPresentation 2 (1).pdf
Presentation 2 (1).pdf
 
Unit 4.pdf
Unit 4.pdfUnit 4.pdf
Unit 4.pdf
 
Function
FunctionFunction
Function
 
Functionincprogram
FunctionincprogramFunctionincprogram
Functionincprogram
 
Inroduction to r
Inroduction to rInroduction to r
Inroduction to r
 
cp Module4(1)
cp Module4(1)cp Module4(1)
cp Module4(1)
 
[ITP - Lecture 13] Introduction to Pointers
[ITP - Lecture 13] Introduction to Pointers[ITP - Lecture 13] Introduction to Pointers
[ITP - Lecture 13] Introduction to Pointers
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
 
Book management system
Book management systemBook management system
Book management system
 
Functions in c language
Functions in c languageFunctions in c language
Functions in c language
 
Functions in c language
Functions in c language Functions in c language
Functions in c language
 
unit_2.pptx
unit_2.pptxunit_2.pptx
unit_2.pptx
 
Unit-III.pptx
Unit-III.pptxUnit-III.pptx
Unit-III.pptx
 
Functional Paradigm.pptx
Functional Paradigm.pptxFunctional Paradigm.pptx
Functional Paradigm.pptx
 
Recursion
RecursionRecursion
Recursion
 
Preprocessor directives
Preprocessor directivesPreprocessor directives
Preprocessor directives
 
C function presentation
C function presentationC function presentation
C function presentation
 
Functions
Functions Functions
Functions
 

More from Afaq Siddiqui

Introduction of storage devices(Brief Knowledge)
Introduction of storage devices(Brief Knowledge)Introduction of storage devices(Brief Knowledge)
Introduction of storage devices(Brief Knowledge)
Afaq Siddiqui
 
Components of System Unit
Components of System UnitComponents of System Unit
Components of System Unit
Afaq Siddiqui
 
Why We Need To Study Calculus
Why We Need To Study CalculusWhy We Need To Study Calculus
Why We Need To Study Calculus
Afaq Siddiqui
 
Introduction to lambda calculus
Introduction to lambda calculusIntroduction to lambda calculus
Introduction to lambda calculus
Afaq Siddiqui
 
Wireless Personal Area Network(WPAN)
Wireless Personal Area Network(WPAN)Wireless Personal Area Network(WPAN)
Wireless Personal Area Network(WPAN)
Afaq Siddiqui
 
WPAN According To ZIGBEE
WPAN According To ZIGBEEWPAN According To ZIGBEE
WPAN According To ZIGBEE
Afaq Siddiqui
 
Job analysis
Job analysisJob analysis
Job analysis
Afaq Siddiqui
 
World wide web with multimedia
World wide web with multimediaWorld wide web with multimedia
World wide web with multimediaAfaq Siddiqui
 

More from Afaq Siddiqui (8)

Introduction of storage devices(Brief Knowledge)
Introduction of storage devices(Brief Knowledge)Introduction of storage devices(Brief Knowledge)
Introduction of storage devices(Brief Knowledge)
 
Components of System Unit
Components of System UnitComponents of System Unit
Components of System Unit
 
Why We Need To Study Calculus
Why We Need To Study CalculusWhy We Need To Study Calculus
Why We Need To Study Calculus
 
Introduction to lambda calculus
Introduction to lambda calculusIntroduction to lambda calculus
Introduction to lambda calculus
 
Wireless Personal Area Network(WPAN)
Wireless Personal Area Network(WPAN)Wireless Personal Area Network(WPAN)
Wireless Personal Area Network(WPAN)
 
WPAN According To ZIGBEE
WPAN According To ZIGBEEWPAN According To ZIGBEE
WPAN According To ZIGBEE
 
Job analysis
Job analysisJob analysis
Job analysis
 
World wide web with multimedia
World wide web with multimediaWorld wide web with multimedia
World wide web with multimedia
 

Recently uploaded

SOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape ReportSOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape Report
SOCRadar
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
enxupq
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
ewymefz
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
axoqas
 
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Subhajit Sahu
 
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
vcaxypu
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
Opendatabay
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
John Andrews
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
haila53
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
tapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive datatapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive data
theahmadsaood
 
Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
benishzehra469
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Boston Institute of Analytics
 
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
AbhimanyuSinha9
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
ewymefz
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
ewymefz
 
FP Growth Algorithm and its Applications
FP Growth Algorithm and its ApplicationsFP Growth Algorithm and its Applications
FP Growth Algorithm and its Applications
MaleehaSheikh2
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP
 

Recently uploaded (20)

SOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape ReportSOCRadar Germany 2024 Threat Landscape Report
SOCRadar Germany 2024 Threat Landscape Report
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
 
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
Levelwise PageRank with Loop-Based Dead End Handling Strategy : SHORT REPORT ...
 
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
 
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...
 
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdfCh03-Managing the Object-Oriented Information Systems Project a.pdf
Ch03-Managing the Object-Oriented Information Systems Project a.pdf
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
tapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive datatapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive data
 
Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
 
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...Best best suvichar in gujarati english meaning of this sentence as Silk road ...
Best best suvichar in gujarati english meaning of this sentence as Silk road ...
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
 
FP Growth Algorithm and its Applications
FP Growth Algorithm and its ApplicationsFP Growth Algorithm and its Applications
FP Growth Algorithm and its Applications
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 

Introduction of calculus in programming

  • 1. Introduction of calculus in programming Is it possible to write calculus function for c. It would be very useful, I am sure it is possible because there are math programs out there today
  • 2. Use of calculus in programming  A program in a functional language is a set of function definitions and an expression usually  formed using the defined functions. The Interpreter of the language evaluates this expression by  means of a discrete number of computation steps, in such a way its meaning turns out to be  represented in an explicit way. In general in programming we have not to produce anything; in  functional programming, in particular, what we modify is only the representation of the  information.  A function can be defined in several ways.
  • 3. Example:  f: R -> R , g: R -> R  f '' - 6g' = 6 sin x  6g'' + a2 f ' = 6 cos x  f(0) = 0, f '(0) = 0, g(0) = 1, g'(0) = 1  This set of equations precisely identify two precise f and g.
  • 4. To evaluate an expression in Scheme  the application of a function to some arguments and then to evaluate the body of the function  in which the formal parameter is replaced by the actual parameter. In this way, in a sense, we  make the meaning of such sub-expression more explicit.
  • 5. Example: let us evaluate Inctwo 3  Inctwo 3 Inctwo is a user defined function, and it is applied to an argument, so we take the  body of the function, replace the formal parameter n by the actual parameter 3, obtaining  3+2, and then we evaluate 3+2 obtaining 5
  • 6. evaluation strategy  a policy enabling to decide on which sub-expression we shall perform the next evaluation step.  Some evaluation strategies could led me in a never ending path (this fact is unavoidable)
  • 7. Uses of calculus in ‘c++’ Language #include<iostream.h> Using name space std; Int a,x,n,derivative; Int main() { Cout<<”hellow.i am a computer program.I can calculate the derivative of an expression using power rule.”; Cout<<”n please type the values of a and n for use exp”; Cout<<”n y=ax^n”; Cin get(); Cout<<”a=?n”; Cin>>a; Cout<<”x=?,n=?n” Cin>>x,n; Derivative=a*n*(x^(n-1)); Cout<<”dy/dx=”<<derivative; Return 0; }