SlideShare a Scribd company logo
1 of 8
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

16 subroutine
16 subroutine16 subroutine
16 subroutine
fyjordan9
 
10. array & pointer
10. array & pointer10. array & pointer
10. array & pointer
웅식 전
 
Effective Java - Always override toString() method
Effective Java - Always override toString() methodEffective Java - Always override toString() method
Effective Java - Always override toString() method
Ferdous 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
 
Functional Paradigm.pptx
Functional Paradigm.pptxFunctional Paradigm.pptx
Functional Paradigm.pptx
FurretMaster
 

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 language Functions in c language
Functions in c language
 
Functions in c language
Functions in c languageFunctions 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 (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

Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
nirzagarg
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
gajnagarg
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
gajnagarg
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
HyderabadDolls
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
wsppdmt
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
chadhar227
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
Health
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 

Recently uploaded (20)

Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
High Profile Call Girls Service in Jalore { 9332606886 } VVIP NISHA Call Girl...
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Indore [ 7014168258 ] Call Me For Genuine Models We...
 
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
Top profile Call Girls In dimapur [ 7014168258 ] Call Me For Genuine Models W...
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
 
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...Top Call Girls in Balaghat  9332606886Call Girls Advance Cash On Delivery Ser...
Top Call Girls in Balaghat 9332606886Call Girls Advance Cash On Delivery Ser...
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Purnia [ 7014168258 ] Call Me For Genuine Models We...
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 

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; }