SlideShare a Scribd company logo
Algorithms and Their Explanations
CiE 2014 — History and Philosophy of Computing
24th June 2014
M Benini1 F Gobbo2
1Università degli Studi dell’Insubria
marco.benini@uninsubria.it
2Universiteit van Amsterdam
F.Gobbo@uva.nl
Introduction
The purpose of this talk is to speak about explanations of algorithms.
The term explanation is understood in the following sense:
the verb to explain has the paradigmatic form “A explains B to C”;
the noun explanation denote the act of explaining where the subject A is
hidden, i.e., “explanation of B to C”;
the explanation is proposed on a given level of abstraction M set by A,
living in a given context.
Therefore, an explanation lives in a context where the explanandum, i.e., the
explained object B, as well as the beneficiary C are clearly defined.
On the contrary, the explaining agent A remains implicit, and also the level
of abstraction M.
(2 of 18)
The Method of the Levels of Abstraction
In Floridi’s approach to the Philosophy of Information, an explanation is
always understood on one or more Levels of Abstraction (LoAs), clearly
defined. In other words, the explanation of B to be grasped:
has to be implemented by the agent C;
over another LoA N;
N is, again, part of the context, like M.
The subject A provides the purpose of the implementation to B; in turn, the
agent C has to “understand” the purpose, and he has also to use an amount
of knowledge and information to build the new LoA N. Collectively, the
purpose and the used information are called Level of Explanation (LoE).
Evidently, the LoE is (at least in part) implicit and so it should be elicited by
B in order to construct the LoA N.
(3 of 18)
Minimal information
So, fixed a context, the question we want to address is:
What amount of information the agent needs in order to construct the
required level of abstraction N over the given one M?
This is best understood looking at a concrete example: the Heapsort
algorithm. It has been chosen because it is simple although not trivial, and
it illustrates in a nutshell all the fundamental aspects of the above question.
Also, since it is classical, there is no need to explain it in the first place: we
can focus just on the analysis of explanations.
(4 of 18)
The scenario
A software house has to produce a program to solve some given problem. Its
employees are
the programmer who has to convert a given specification to a working
code in some programming language;
the software designer who has to analyse the problem and to describe an
algorithmic solution which becomes the set of specifications;
the algorithm designer who takes the general specifications from the
software designer and convert them into precise descriptions of what the
programmer must implement.
Each of these agents are part of an informational organism (inforg) which is
given by the agent and the computer where the program has to be
implemented. In turn, each of these inforgs has an appropriate LoA the
agent acts upon.
(5 of 18)
The programmer’s view
The programmer receives a specification, in the form of an algorithm. His
purpose is to code this into an executable piece of code. In our example, the
specification is the Heapsort algorithm.
The programmer’s LoA is given by the programming language, in a broad
sense, and by the view of the machine he has through the language.
Our question becomes:
What “explains” the Heapsort algorithm to the programmer, enabling
him to successfully achieve his purpose?
(6 of 18)
The Heapsort algorithm
Heapsort(A : array) ≡
BuildMaxHeap(A)
for i ←len(A) downto 2 do
exchange(A[1],A[i])
heapsize(A)←heapsize(A)−1
MaxHeapify(A,1)
BuildMaxHeap(A : array) ≡
heapsize(A)←len(A)
for i ← len(A)/2 downto 1 do
MaxHeapify(A,i)
left(i : N) ≡ 2i
right(i : N) ≡ 2i +1
MaxHeapify(A: array,i : N) ≡
m←i
l ←left(i)
r ←right(i)
if l ≤ heapsize(A) & A[l] A[m]
then m←l
if r ≤ heapsize(A) & A[r] A[m]
then m←r
if m = i then
exchange(A[i],A[m])
MaxHeapify(A,m)
exchange(a: element,b: element) ≡
x ←a;
a←b;
b ←x
(7 of 18)
The programmer’s explanation
The programmer needs to know how to read the specification and to
correctly convert it into an executable piece of code in the programming
language. In other words, he has to build a new LoA, which extends the
programming language with a new function, Heapsort.
Thus, the minimal explanation the programmer needs of the above
pseudo-code is the one which allows him to fulfil his task. This explanation
reduces to know how to correctly interpret the pseudo-code into the
programming language construction. E.g., he needs to know that ← stands
for assignment.
This amount of explanation suffices to show that the implementation exactly
matches the pseudo-code, and so, it is correct with respect to the
specification the programmer is given.
(8 of 18)
The software designer’s view
The purpose of the software designer is to construct a set of specifications
that collectively allows to write a program that solves the problem.
The software designer, in our example, has reduced a part of the solution to
the need of sorting an array. So, he has to understand what are the features
this sorting algorithm must have. For example, he has to decide that
stability does not matter, while efficiency is important.
For a software designer, an algorithm is not a procedure, but a collection of
properties. He has to decide what properties are relevant to solve the
problem, and to pass them to the algorithm designer, who converts them
into pieces of pseudo-code, and then, to the programmer, who convert the
pseudo-code into an executable program.
(9 of 18)
The software designer’s explanation
After identifying sorting as a (sub-)problem to be solved, the software
designer has to decide what the sorting procedure should actually do. For
him, the “right” sorting procedure must exhibit some features, while it may
not have others because irrelevant to the solution he designs.
Thus, the explanation of HeapSort is, for him, a collection of properties:
it sorts an array;
it rearranges the input, instead of generating a sorted copy;
it is not stable;
it is efficient among comparison-based sorting algorithms.
This explanation allows the software designer to show that the solution he
provides is correct, i.e., it solves the original problem within the given
constraints.
Note how the software designer does not need to know how Heapsort
operates!
(10 of 18)
The algorithm designer’s view
As the software designer is interested in “what” an algorithm does, the
algorithm designer focuses on “how” an algorithm achieves its result.
In our example, the algorithm designer may think that sorting data in a tree
is more efficient than sorting data in a random-access sequence. Of course,
this is true when the tree satisfies some conditions, like that each node’s key
is less than the parent’s.
Understanding that an array can be interpreted as a tree, allows to write an
algorithm that does not use an additional data structure.
In this way, eventually, the algorithm designer will be able to prove that the
designed pseudo-code, which is the previously shown Heapsort procedure, is
correct, that is, it sorts an array. Also, destructive manipulation of the input
and lack of stability immediately follow from the correctness proof.
Showing that Heapsort is efficient requires to reduce the execution time,
measured as number of computational steps, to a set of mutually recursive
equations. And the solution of these equations clearly shows that Heapsort
operates in O(nlogn) with n the length of the array.
(11 of 18)
The algorithm designer’s explanation
So, the algorithm designer is able to show that his pseudo-code, the LoA he
constructed, satisfies the specification he received. To provide this evidence,
he has
to show that the pseudo-code sorts an array and do it within the
constraints put by the software designer, which amounts to explain how
the computational process he designed eventually produces the output;
to calculate the complexity of the algorithm, which amounts to deduce
from the algorithm and to solve a set of recurrence equations.
The knowledge and information to obtain these two goals are essential to
justify his work, so this is the minimal explanation which suits the algorithm
designer’s purpose.
(12 of 18)
The Minimal Levels of Abstraction
When the purpose has been accomplished, the resulting machine shows (at
least) two levels of abstraction:
1. the LoA which has been used to implement Heapsort over it;
2. the LoA which has Heapsort as a primitive.
Each of these LoAs can be described within Floridi’s framework, thus being
in strict interaction with a corresponding level of observation, which enables
us to measure information.
Although very simple, these two LoAs provide a gradient of abstractions: the
description of the system used by the software house of our example is,
really, the gradient, i.e., the sum of the two LoAs together with their mutual
interactions.
(13 of 18)
The Levels of Explanation of an Algorithm
The Heapsort procedure as implemented can be explained in, at least, four
different ways:
1. to the machine, it is explained by the operational semantics, encoded in
the computer machinery, which allows to execute the code.
2. to the programmer, it is explained as the adherence to the pseudo-code;
3. to the system designer, it is explained as a set of properties that allows
the procedure to take its role inside the program;
4. to the algorithm designer, it is explained as an algorithm which solves a
useful problem, and which enjoys a number of “good” properties;
Each Level of Explanation (LoE) allows to fulfil a specific purpose, the one
of the explaining agent. In the last three cases this has been already
illustrated, while in the first, the purpose is simply to execute the procedure
on a given input.
(14 of 18)
A gradient of explanation
In Floridi’s terms, each complex, structured information, is understood on
one of more Levels of Abstractions (LoAs), where each one presumes a Level
of Explanation (LoE) that is used to construct what we informally called
explanation.
And, the four explanations are strictly linked one to the others, together
providing an explanation for (part of) the purpose of the software house: to
provide a program that solves a specific problem.
(15 of 18)
Minimal explanations and measures
A gradient of explanations allows for a very simple way to measure distance
between explanations: we say that the machine “understands” the code less
than the software designer because the explanation of the machine is at
level 1 in the gradient, while the software designer’s is at level 3.
It is important to remark that this measure is relative to a gradient and a
LoA: it does not make sense to use it outside this context.
Nevertheless, this measure can be made more “objective” when we consider
minimal explanations — as we tried to do — because any other gradient of
explanations on the same LoA and inforgs would become an extension of the
minimal one.
(16 of 18)
Conclusion
The concept of the Gradient of Explanations (GoE) presented here was
naturally derived within the Method of the LoAs. It is important to note,
that the GoE has a different epistemological status compared to the
Gradient of Abstractions (GoA).
The consequences of the introduction of the GoE are not yet fully explored,
and its formalisation is still preliminary. However, the Heapsort example will
act as a concrete guideline so to apply the GoE in other cases.
(17 of 18)
Thank you for your attention!
(18 of 18)

More Related Content

What's hot

OOP in C++
OOP in C++OOP in C++
OOP in C++
ppd1961
 
SYNTAX AND SEMANTICS FOR CINNAMON PROGRAMMING
SYNTAX AND SEMANTICS FOR CINNAMON PROGRAMMINGSYNTAX AND SEMANTICS FOR CINNAMON PROGRAMMING
SYNTAX AND SEMANTICS FOR CINNAMON PROGRAMMING
AIRCC Publishing Corporation
 
Towards Practical Homomorphic Encryption with Efficient Public key Generation
Towards Practical Homomorphic Encryption with Efficient Public key GenerationTowards Practical Homomorphic Encryption with Efficient Public key Generation
Towards Practical Homomorphic Encryption with Efficient Public key Generation
IDES Editor
 
C programming notes
C programming notesC programming notes
C programming notes
Prof. Dr. K. Adisesha
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
Andrew Raj
 
UNIT III POINTERS IN C
UNIT III POINTERS IN C UNIT III POINTERS IN C
UNIT III POINTERS IN C
Sanjay Kale
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
Sangharsh agarwal
 
Pointers and call by value, reference, address in C
Pointers and call by value, reference, address in CPointers and call by value, reference, address in C
Pointers and call by value, reference, address in C
Syed Mustafa
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
K Durga Prasad
 
2010 bristol q1_formal-property-checkers
2010 bristol q1_formal-property-checkers2010 bristol q1_formal-property-checkers
2010 bristol q1_formal-property-checkers
Obsidian Software
 
C Programming
C ProgrammingC Programming
C Programming
Adil Jafri
 
Report on c and c++
Report on c and c++Report on c and c++
Report on c and c++
oggyrao
 
26 Jo P Feb 09
26 Jo P Feb 0926 Jo P Feb 09
26 Jo P Feb 09
Ganesh Samarthyam
 
Problem solving
Problem solvingProblem solving
Problem solving
hamza239523
 
C language (Collected By Dushmanta)
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)
Dushmanta Nath
 
Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2
Iffat Anjum
 
BREAKING MIGNOTTE’S SEQUENCE BASED SECRET SHARING SCHEME USING SMT SOLVER
BREAKING MIGNOTTE’S SEQUENCE BASED SECRET SHARING SCHEME USING SMT SOLVERBREAKING MIGNOTTE’S SEQUENCE BASED SECRET SHARING SCHEME USING SMT SOLVER
BREAKING MIGNOTTE’S SEQUENCE BASED SECRET SHARING SCHEME USING SMT SOLVER
ijcsit
 

What's hot (17)

OOP in C++
OOP in C++OOP in C++
OOP in C++
 
SYNTAX AND SEMANTICS FOR CINNAMON PROGRAMMING
SYNTAX AND SEMANTICS FOR CINNAMON PROGRAMMINGSYNTAX AND SEMANTICS FOR CINNAMON PROGRAMMING
SYNTAX AND SEMANTICS FOR CINNAMON PROGRAMMING
 
Towards Practical Homomorphic Encryption with Efficient Public key Generation
Towards Practical Homomorphic Encryption with Efficient Public key GenerationTowards Practical Homomorphic Encryption with Efficient Public key Generation
Towards Practical Homomorphic Encryption with Efficient Public key Generation
 
C programming notes
C programming notesC programming notes
C programming notes
 
C programming | Class 8 | III Term
C programming  | Class 8  | III TermC programming  | Class 8  | III Term
C programming | Class 8 | III Term
 
UNIT III POINTERS IN C
UNIT III POINTERS IN C UNIT III POINTERS IN C
UNIT III POINTERS IN C
 
Introduction Of C++
Introduction Of C++Introduction Of C++
Introduction Of C++
 
Pointers and call by value, reference, address in C
Pointers and call by value, reference, address in CPointers and call by value, reference, address in C
Pointers and call by value, reference, address in C
 
Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
2010 bristol q1_formal-property-checkers
2010 bristol q1_formal-property-checkers2010 bristol q1_formal-property-checkers
2010 bristol q1_formal-property-checkers
 
C Programming
C ProgrammingC Programming
C Programming
 
Report on c and c++
Report on c and c++Report on c and c++
Report on c and c++
 
26 Jo P Feb 09
26 Jo P Feb 0926 Jo P Feb 09
26 Jo P Feb 09
 
Problem solving
Problem solvingProblem solving
Problem solving
 
C language (Collected By Dushmanta)
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)
 
Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2
 
BREAKING MIGNOTTE’S SEQUENCE BASED SECRET SHARING SCHEME USING SMT SOLVER
BREAKING MIGNOTTE’S SEQUENCE BASED SECRET SHARING SCHEME USING SMT SOLVERBREAKING MIGNOTTE’S SEQUENCE BASED SECRET SHARING SCHEME USING SMT SOLVER
BREAKING MIGNOTTE’S SEQUENCE BASED SECRET SHARING SCHEME USING SMT SOLVER
 

Viewers also liked

Frequent english words
Frequent english wordsFrequent english words
Frequent english words
Prince Soni
 
Compututer Graphics - Color Modeling And Rendering
Compututer Graphics - Color Modeling And RenderingCompututer Graphics - Color Modeling And Rendering
Compututer Graphics - Color Modeling And Rendering
Prince Soni
 
10CSL67 CG LAB PROGRAM 5
10CSL67 CG LAB PROGRAM 510CSL67 CG LAB PROGRAM 5
10CSL67 CG LAB PROGRAM 5
Vanishree Arun
 
Region filling and object removal by exemplar based image inpainting
Region filling and object removal by exemplar based image inpaintingRegion filling and object removal by exemplar based image inpainting
Region filling and object removal by exemplar based image inpainting
Woonghee Lee
 
Area filling algo
Area filling algoArea filling algo
Area filling algo
Prince Soni
 
Polygon filling
Polygon fillingPolygon filling
Fill area algorithms
Fill area algorithmsFill area algorithms
Fill area algorithms
Kumar
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
Nanhen Verma
 
Lecture filling algorithms
Lecture  filling algorithmsLecture  filling algorithms
Lecture filling algorithms
avelraj
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUAL
Vivek Kumar Sinha
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c version
Marwa Al-Rikaby
 
Clipping Algorithm In Computer Graphics
Clipping Algorithm In Computer GraphicsClipping Algorithm In Computer Graphics
Clipping Algorithm In Computer Graphics
student(MCA)
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
Griffinder VinHai
 
region-filling
region-fillingregion-filling
region-filling
Kumar
 

Viewers also liked (14)

Frequent english words
Frequent english wordsFrequent english words
Frequent english words
 
Compututer Graphics - Color Modeling And Rendering
Compututer Graphics - Color Modeling And RenderingCompututer Graphics - Color Modeling And Rendering
Compututer Graphics - Color Modeling And Rendering
 
10CSL67 CG LAB PROGRAM 5
10CSL67 CG LAB PROGRAM 510CSL67 CG LAB PROGRAM 5
10CSL67 CG LAB PROGRAM 5
 
Region filling and object removal by exemplar based image inpainting
Region filling and object removal by exemplar based image inpaintingRegion filling and object removal by exemplar based image inpainting
Region filling and object removal by exemplar based image inpainting
 
Area filling algo
Area filling algoArea filling algo
Area filling algo
 
Polygon filling
Polygon fillingPolygon filling
Polygon filling
 
Fill area algorithms
Fill area algorithmsFill area algorithms
Fill area algorithms
 
Computer graphics
Computer graphicsComputer graphics
Computer graphics
 
Lecture filling algorithms
Lecture  filling algorithmsLecture  filling algorithms
Lecture filling algorithms
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUAL
 
Output primitives computer graphics c version
Output primitives   computer graphics c versionOutput primitives   computer graphics c version
Output primitives computer graphics c version
 
Clipping Algorithm In Computer Graphics
Clipping Algorithm In Computer GraphicsClipping Algorithm In Computer Graphics
Clipping Algorithm In Computer Graphics
 
Computer Graphics
Computer GraphicsComputer Graphics
Computer Graphics
 
region-filling
region-fillingregion-filling
region-filling
 

Similar to Algorithms and Their Explanations

Aad introduction
Aad introductionAad introduction
Aad introduction
Mr SMAK
 
Design & Analysis Of Algorithm
Design & Analysis Of AlgorithmDesign & Analysis Of Algorithm
Design & Analysis Of Algorithm
Computer Hardware & Trouble shooting
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
Rohit Shrivastava
 
Daa chapter 1
Daa chapter 1Daa chapter 1
Daa chapter 1
B.Kirron Reddi
 
Algoritmos
AlgoritmosAlgoritmos
Algoritmos
Fab Lab LIMA
 
DATA STRUCTURE.pdf
DATA STRUCTURE.pdfDATA STRUCTURE.pdf
DATA STRUCTURE.pdf
ibrahim386946
 
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURE
RobinRohit2
 
Modeling Aspects with AP&P Components
Modeling Aspects with AP&P ComponentsModeling Aspects with AP&P Components
Modeling Aspects with AP&P Components
mukhtarhudaya
 
Types of Algorithms.ppt
Types of Algorithms.pptTypes of Algorithms.ppt
Types of Algorithms.ppt
ALIZAIB KHAN
 
How to Analyze the Results of LinearPrograms—Part 1 Prelimi.docx
How to Analyze the Results of LinearPrograms—Part 1 Prelimi.docxHow to Analyze the Results of LinearPrograms—Part 1 Prelimi.docx
How to Analyze the Results of LinearPrograms—Part 1 Prelimi.docx
pooleavelina
 
Program concep sequential statements
Program concep sequential statementsProgram concep sequential statements
Program concep sequential statements
ankurkhanna
 
Introduction to Algorithms & flow charts
Introduction to Algorithms & flow chartsIntroduction to Algorithms & flow charts
Introduction to Algorithms & flow charts
Yash Gupta
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptx
skilljiolms
 
My Research Poster
My Research Poster My Research Poster
My Research Poster
Jackson Beauregard Miller
 
Turbo prolog 2.0 basics
Turbo prolog 2.0 basicsTurbo prolog 2.0 basics
Turbo prolog 2.0 basics
Soham Kansodaria
 
Lecture Note-2: Performance analysis of Algorithms
Lecture Note-2: Performance analysis of AlgorithmsLecture Note-2: Performance analysis of Algorithms
Lecture Note-2: Performance analysis of Algorithms
Rajesh K Shukla
 
Lecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its PropertiesLecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its Properties
Rajesh K Shukla
 
User_42751212015Module1and2pagestocompetework.pdf.docx
User_42751212015Module1and2pagestocompetework.pdf.docxUser_42751212015Module1and2pagestocompetework.pdf.docx
User_42751212015Module1and2pagestocompetework.pdf.docx
dickonsondorris
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
Tanya Makkar
 
Create and analyse programs
Create and analyse programsCreate and analyse programs
Create and analyse programs
Dr. C.V. Suresh Babu
 

Similar to Algorithms and Their Explanations (20)

Aad introduction
Aad introductionAad introduction
Aad introduction
 
Design & Analysis Of Algorithm
Design & Analysis Of AlgorithmDesign & Analysis Of Algorithm
Design & Analysis Of Algorithm
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
Daa chapter 1
Daa chapter 1Daa chapter 1
Daa chapter 1
 
Algoritmos
AlgoritmosAlgoritmos
Algoritmos
 
DATA STRUCTURE.pdf
DATA STRUCTURE.pdfDATA STRUCTURE.pdf
DATA STRUCTURE.pdf
 
DATA STRUCTURE
DATA STRUCTUREDATA STRUCTURE
DATA STRUCTURE
 
Modeling Aspects with AP&P Components
Modeling Aspects with AP&P ComponentsModeling Aspects with AP&P Components
Modeling Aspects with AP&P Components
 
Types of Algorithms.ppt
Types of Algorithms.pptTypes of Algorithms.ppt
Types of Algorithms.ppt
 
How to Analyze the Results of LinearPrograms—Part 1 Prelimi.docx
How to Analyze the Results of LinearPrograms—Part 1 Prelimi.docxHow to Analyze the Results of LinearPrograms—Part 1 Prelimi.docx
How to Analyze the Results of LinearPrograms—Part 1 Prelimi.docx
 
Program concep sequential statements
Program concep sequential statementsProgram concep sequential statements
Program concep sequential statements
 
Introduction to Algorithms & flow charts
Introduction to Algorithms & flow chartsIntroduction to Algorithms & flow charts
Introduction to Algorithms & flow charts
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptx
 
My Research Poster
My Research Poster My Research Poster
My Research Poster
 
Turbo prolog 2.0 basics
Turbo prolog 2.0 basicsTurbo prolog 2.0 basics
Turbo prolog 2.0 basics
 
Lecture Note-2: Performance analysis of Algorithms
Lecture Note-2: Performance analysis of AlgorithmsLecture Note-2: Performance analysis of Algorithms
Lecture Note-2: Performance analysis of Algorithms
 
Lecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its PropertiesLecture Note-1: Algorithm and Its Properties
Lecture Note-1: Algorithm and Its Properties
 
User_42751212015Module1and2pagestocompetework.pdf.docx
User_42751212015Module1and2pagestocompetework.pdf.docxUser_42751212015Module1and2pagestocompetework.pdf.docx
User_42751212015Module1and2pagestocompetework.pdf.docx
 
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
TIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMSTIME EXECUTION   OF  DIFFERENT SORTED ALGORITHMS
TIME EXECUTION OF DIFFERENT SORTED ALGORITHMS
 
Create and analyse programs
Create and analyse programsCreate and analyse programs
Create and analyse programs
 

More from Marco Benini

Point-free semantics of dependent type theories
Point-free semantics of dependent type theoriesPoint-free semantics of dependent type theories
Point-free semantics of dependent type theories
Marco Benini
 
The Graph Minor Theorem: a walk on the wild side of graphs
The Graph Minor Theorem: a walk on the wild side of graphsThe Graph Minor Theorem: a walk on the wild side of graphs
The Graph Minor Theorem: a walk on the wild side of graphs
Marco Benini
 
Explaining the Kruskal Tree Theore
Explaining the Kruskal Tree TheoreExplaining the Kruskal Tree Theore
Explaining the Kruskal Tree Theore
Marco Benini
 
The Graph Minor Theorem: a walk on the wild side of graphs
The Graph Minor Theorem: a walk on the wild side of graphsThe Graph Minor Theorem: a walk on the wild side of graphs
The Graph Minor Theorem: a walk on the wild side of graphs
Marco Benini
 
Dealing with negative results
Dealing with negative resultsDealing with negative results
Dealing with negative results
Marco Benini
 
Variations on the Higman's Lemma
Variations on the Higman's LemmaVariations on the Higman's Lemma
Variations on the Higman's Lemma
Marco Benini
 
Dealing with negative results
Dealing with negative resultsDealing with negative results
Dealing with negative results
Marco Benini
 
Well Quasi Orders in a Categorical Setting
Well Quasi Orders in a Categorical SettingWell Quasi Orders in a Categorical Setting
Well Quasi Orders in a Categorical Setting
Marco Benini
 
Proof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systemsProof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systems
Marco Benini
 
Point-free foundation of Mathematics
Point-free foundation of MathematicsPoint-free foundation of Mathematics
Point-free foundation of Mathematics
Marco Benini
 
Fondazione point-free della matematica
Fondazione point-free della matematicaFondazione point-free della matematica
Fondazione point-free della matematica
Marco Benini
 
Numerical Analysis and Epistemology of Information
Numerical Analysis and Epistemology of InformationNumerical Analysis and Epistemology of Information
Numerical Analysis and Epistemology of Information
Marco Benini
 
L'occhio del biologo: elementi di fotografia
L'occhio del biologo: elementi di fotografiaL'occhio del biologo: elementi di fotografia
L'occhio del biologo: elementi di fotografia
Marco Benini
 
Constructive Adpositional Grammars, Formally
Constructive Adpositional Grammars, FormallyConstructive Adpositional Grammars, Formally
Constructive Adpositional Grammars, Formally
Marco Benini
 
Marie Skłodowska Curie Intra-European Fellowship
Marie Skłodowska Curie Intra-European FellowshipMarie Skłodowska Curie Intra-European Fellowship
Marie Skłodowska Curie Intra-European Fellowship
Marco Benini
 
Programming modulo representations
Programming modulo representationsProgramming modulo representations
Programming modulo representations
Marco Benini
 
Programming modulo representations
Programming modulo representationsProgramming modulo representations
Programming modulo representations
Marco Benini
 
June 22nd 2014: Seminar at JAIST
June 22nd 2014: Seminar at JAISTJune 22nd 2014: Seminar at JAIST
June 22nd 2014: Seminar at JAIST
Marco Benini
 
CORCON2014: Does programming really need data structures?
CORCON2014: Does programming really need data structures?CORCON2014: Does programming really need data structures?
CORCON2014: Does programming really need data structures?
Marco Benini
 
Fondazione point-free della matematica
Fondazione point-free della matematicaFondazione point-free della matematica
Fondazione point-free della matematica
Marco Benini
 

More from Marco Benini (20)

Point-free semantics of dependent type theories
Point-free semantics of dependent type theoriesPoint-free semantics of dependent type theories
Point-free semantics of dependent type theories
 
The Graph Minor Theorem: a walk on the wild side of graphs
The Graph Minor Theorem: a walk on the wild side of graphsThe Graph Minor Theorem: a walk on the wild side of graphs
The Graph Minor Theorem: a walk on the wild side of graphs
 
Explaining the Kruskal Tree Theore
Explaining the Kruskal Tree TheoreExplaining the Kruskal Tree Theore
Explaining the Kruskal Tree Theore
 
The Graph Minor Theorem: a walk on the wild side of graphs
The Graph Minor Theorem: a walk on the wild side of graphsThe Graph Minor Theorem: a walk on the wild side of graphs
The Graph Minor Theorem: a walk on the wild side of graphs
 
Dealing with negative results
Dealing with negative resultsDealing with negative results
Dealing with negative results
 
Variations on the Higman's Lemma
Variations on the Higman's LemmaVariations on the Higman's Lemma
Variations on the Higman's Lemma
 
Dealing with negative results
Dealing with negative resultsDealing with negative results
Dealing with negative results
 
Well Quasi Orders in a Categorical Setting
Well Quasi Orders in a Categorical SettingWell Quasi Orders in a Categorical Setting
Well Quasi Orders in a Categorical Setting
 
Proof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systemsProof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systems
 
Point-free foundation of Mathematics
Point-free foundation of MathematicsPoint-free foundation of Mathematics
Point-free foundation of Mathematics
 
Fondazione point-free della matematica
Fondazione point-free della matematicaFondazione point-free della matematica
Fondazione point-free della matematica
 
Numerical Analysis and Epistemology of Information
Numerical Analysis and Epistemology of InformationNumerical Analysis and Epistemology of Information
Numerical Analysis and Epistemology of Information
 
L'occhio del biologo: elementi di fotografia
L'occhio del biologo: elementi di fotografiaL'occhio del biologo: elementi di fotografia
L'occhio del biologo: elementi di fotografia
 
Constructive Adpositional Grammars, Formally
Constructive Adpositional Grammars, FormallyConstructive Adpositional Grammars, Formally
Constructive Adpositional Grammars, Formally
 
Marie Skłodowska Curie Intra-European Fellowship
Marie Skłodowska Curie Intra-European FellowshipMarie Skłodowska Curie Intra-European Fellowship
Marie Skłodowska Curie Intra-European Fellowship
 
Programming modulo representations
Programming modulo representationsProgramming modulo representations
Programming modulo representations
 
Programming modulo representations
Programming modulo representationsProgramming modulo representations
Programming modulo representations
 
June 22nd 2014: Seminar at JAIST
June 22nd 2014: Seminar at JAISTJune 22nd 2014: Seminar at JAIST
June 22nd 2014: Seminar at JAIST
 
CORCON2014: Does programming really need data structures?
CORCON2014: Does programming really need data structures?CORCON2014: Does programming really need data structures?
CORCON2014: Does programming really need data structures?
 
Fondazione point-free della matematica
Fondazione point-free della matematicaFondazione point-free della matematica
Fondazione point-free della matematica
 

Recently uploaded

Immersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths ForwardImmersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths Forward
Leonel Morgado
 
Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)
Sciences of Europe
 
Applied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdfApplied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdf
University of Hertfordshire
 
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdfAJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR
 
Microbiology of Central Nervous System INFECTIONS.pdf
Microbiology of Central Nervous System INFECTIONS.pdfMicrobiology of Central Nervous System INFECTIONS.pdf
Microbiology of Central Nervous System INFECTIONS.pdf
sammy700571
 
Gadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdfGadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdf
PirithiRaju
 
Anti-Universe And Emergent Gravity and the Dark Universe
Anti-Universe And Emergent Gravity and the Dark UniverseAnti-Universe And Emergent Gravity and the Dark Universe
Anti-Universe And Emergent Gravity and the Dark Universe
Sérgio Sacani
 
The binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defectsThe binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defects
Sérgio Sacani
 
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
eitps1506
 
Summary Of transcription and Translation.pdf
Summary Of transcription and Translation.pdfSummary Of transcription and Translation.pdf
Summary Of transcription and Translation.pdf
vadgavevedant86
 
Tissue fluids_etiology_volume regulation_pressure.pptx
Tissue fluids_etiology_volume regulation_pressure.pptxTissue fluids_etiology_volume regulation_pressure.pptx
Tissue fluids_etiology_volume regulation_pressure.pptx
muralinath2
 
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
Advanced-Concepts-Team
 
Authoring a personal GPT for your research and practice: How we created the Q...
Authoring a personal GPT for your research and practice: How we created the Q...Authoring a personal GPT for your research and practice: How we created the Q...
Authoring a personal GPT for your research and practice: How we created the Q...
Leonel Morgado
 
Pests of Storage_Identification_Dr.UPR.pdf
Pests of Storage_Identification_Dr.UPR.pdfPests of Storage_Identification_Dr.UPR.pdf
Pests of Storage_Identification_Dr.UPR.pdf
PirithiRaju
 
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of ProteinsGBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
Areesha Ahmad
 
8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
by6843629
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
vluwdy49
 
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
Scintica Instrumentation
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
Sérgio Sacani
 
HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1
Shashank Shekhar Pandey
 

Recently uploaded (20)

Immersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths ForwardImmersive Learning That Works: Research Grounding and Paths Forward
Immersive Learning That Works: Research Grounding and Paths Forward
 
Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)Sciences of Europe journal No 142 (2024)
Sciences of Europe journal No 142 (2024)
 
Applied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdfApplied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdf
 
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdfAJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdf
 
Microbiology of Central Nervous System INFECTIONS.pdf
Microbiology of Central Nervous System INFECTIONS.pdfMicrobiology of Central Nervous System INFECTIONS.pdf
Microbiology of Central Nervous System INFECTIONS.pdf
 
Gadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdfGadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdf
 
Anti-Universe And Emergent Gravity and the Dark Universe
Anti-Universe And Emergent Gravity and the Dark UniverseAnti-Universe And Emergent Gravity and the Dark Universe
Anti-Universe And Emergent Gravity and the Dark Universe
 
The binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defectsThe binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defects
 
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
CLASS 12th CHEMISTRY SOLID STATE ppt (Animated)
 
Summary Of transcription and Translation.pdf
Summary Of transcription and Translation.pdfSummary Of transcription and Translation.pdf
Summary Of transcription and Translation.pdf
 
Tissue fluids_etiology_volume regulation_pressure.pptx
Tissue fluids_etiology_volume regulation_pressure.pptxTissue fluids_etiology_volume regulation_pressure.pptx
Tissue fluids_etiology_volume regulation_pressure.pptx
 
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
 
Authoring a personal GPT for your research and practice: How we created the Q...
Authoring a personal GPT for your research and practice: How we created the Q...Authoring a personal GPT for your research and practice: How we created the Q...
Authoring a personal GPT for your research and practice: How we created the Q...
 
Pests of Storage_Identification_Dr.UPR.pdf
Pests of Storage_Identification_Dr.UPR.pdfPests of Storage_Identification_Dr.UPR.pdf
Pests of Storage_Identification_Dr.UPR.pdf
 
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of ProteinsGBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
 
8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf8.Isolation of pure cultures and preservation of cultures.pdf
8.Isolation of pure cultures and preservation of cultures.pdf
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
 
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
 
HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1
 

Algorithms and Their Explanations

  • 1. Algorithms and Their Explanations CiE 2014 — History and Philosophy of Computing 24th June 2014 M Benini1 F Gobbo2 1Università degli Studi dell’Insubria marco.benini@uninsubria.it 2Universiteit van Amsterdam F.Gobbo@uva.nl
  • 2. Introduction The purpose of this talk is to speak about explanations of algorithms. The term explanation is understood in the following sense: the verb to explain has the paradigmatic form “A explains B to C”; the noun explanation denote the act of explaining where the subject A is hidden, i.e., “explanation of B to C”; the explanation is proposed on a given level of abstraction M set by A, living in a given context. Therefore, an explanation lives in a context where the explanandum, i.e., the explained object B, as well as the beneficiary C are clearly defined. On the contrary, the explaining agent A remains implicit, and also the level of abstraction M. (2 of 18)
  • 3. The Method of the Levels of Abstraction In Floridi’s approach to the Philosophy of Information, an explanation is always understood on one or more Levels of Abstraction (LoAs), clearly defined. In other words, the explanation of B to be grasped: has to be implemented by the agent C; over another LoA N; N is, again, part of the context, like M. The subject A provides the purpose of the implementation to B; in turn, the agent C has to “understand” the purpose, and he has also to use an amount of knowledge and information to build the new LoA N. Collectively, the purpose and the used information are called Level of Explanation (LoE). Evidently, the LoE is (at least in part) implicit and so it should be elicited by B in order to construct the LoA N. (3 of 18)
  • 4. Minimal information So, fixed a context, the question we want to address is: What amount of information the agent needs in order to construct the required level of abstraction N over the given one M? This is best understood looking at a concrete example: the Heapsort algorithm. It has been chosen because it is simple although not trivial, and it illustrates in a nutshell all the fundamental aspects of the above question. Also, since it is classical, there is no need to explain it in the first place: we can focus just on the analysis of explanations. (4 of 18)
  • 5. The scenario A software house has to produce a program to solve some given problem. Its employees are the programmer who has to convert a given specification to a working code in some programming language; the software designer who has to analyse the problem and to describe an algorithmic solution which becomes the set of specifications; the algorithm designer who takes the general specifications from the software designer and convert them into precise descriptions of what the programmer must implement. Each of these agents are part of an informational organism (inforg) which is given by the agent and the computer where the program has to be implemented. In turn, each of these inforgs has an appropriate LoA the agent acts upon. (5 of 18)
  • 6. The programmer’s view The programmer receives a specification, in the form of an algorithm. His purpose is to code this into an executable piece of code. In our example, the specification is the Heapsort algorithm. The programmer’s LoA is given by the programming language, in a broad sense, and by the view of the machine he has through the language. Our question becomes: What “explains” the Heapsort algorithm to the programmer, enabling him to successfully achieve his purpose? (6 of 18)
  • 7. The Heapsort algorithm Heapsort(A : array) ≡ BuildMaxHeap(A) for i ←len(A) downto 2 do exchange(A[1],A[i]) heapsize(A)←heapsize(A)−1 MaxHeapify(A,1) BuildMaxHeap(A : array) ≡ heapsize(A)←len(A) for i ← len(A)/2 downto 1 do MaxHeapify(A,i) left(i : N) ≡ 2i right(i : N) ≡ 2i +1 MaxHeapify(A: array,i : N) ≡ m←i l ←left(i) r ←right(i) if l ≤ heapsize(A) & A[l] A[m] then m←l if r ≤ heapsize(A) & A[r] A[m] then m←r if m = i then exchange(A[i],A[m]) MaxHeapify(A,m) exchange(a: element,b: element) ≡ x ←a; a←b; b ←x (7 of 18)
  • 8. The programmer’s explanation The programmer needs to know how to read the specification and to correctly convert it into an executable piece of code in the programming language. In other words, he has to build a new LoA, which extends the programming language with a new function, Heapsort. Thus, the minimal explanation the programmer needs of the above pseudo-code is the one which allows him to fulfil his task. This explanation reduces to know how to correctly interpret the pseudo-code into the programming language construction. E.g., he needs to know that ← stands for assignment. This amount of explanation suffices to show that the implementation exactly matches the pseudo-code, and so, it is correct with respect to the specification the programmer is given. (8 of 18)
  • 9. The software designer’s view The purpose of the software designer is to construct a set of specifications that collectively allows to write a program that solves the problem. The software designer, in our example, has reduced a part of the solution to the need of sorting an array. So, he has to understand what are the features this sorting algorithm must have. For example, he has to decide that stability does not matter, while efficiency is important. For a software designer, an algorithm is not a procedure, but a collection of properties. He has to decide what properties are relevant to solve the problem, and to pass them to the algorithm designer, who converts them into pieces of pseudo-code, and then, to the programmer, who convert the pseudo-code into an executable program. (9 of 18)
  • 10. The software designer’s explanation After identifying sorting as a (sub-)problem to be solved, the software designer has to decide what the sorting procedure should actually do. For him, the “right” sorting procedure must exhibit some features, while it may not have others because irrelevant to the solution he designs. Thus, the explanation of HeapSort is, for him, a collection of properties: it sorts an array; it rearranges the input, instead of generating a sorted copy; it is not stable; it is efficient among comparison-based sorting algorithms. This explanation allows the software designer to show that the solution he provides is correct, i.e., it solves the original problem within the given constraints. Note how the software designer does not need to know how Heapsort operates! (10 of 18)
  • 11. The algorithm designer’s view As the software designer is interested in “what” an algorithm does, the algorithm designer focuses on “how” an algorithm achieves its result. In our example, the algorithm designer may think that sorting data in a tree is more efficient than sorting data in a random-access sequence. Of course, this is true when the tree satisfies some conditions, like that each node’s key is less than the parent’s. Understanding that an array can be interpreted as a tree, allows to write an algorithm that does not use an additional data structure. In this way, eventually, the algorithm designer will be able to prove that the designed pseudo-code, which is the previously shown Heapsort procedure, is correct, that is, it sorts an array. Also, destructive manipulation of the input and lack of stability immediately follow from the correctness proof. Showing that Heapsort is efficient requires to reduce the execution time, measured as number of computational steps, to a set of mutually recursive equations. And the solution of these equations clearly shows that Heapsort operates in O(nlogn) with n the length of the array. (11 of 18)
  • 12. The algorithm designer’s explanation So, the algorithm designer is able to show that his pseudo-code, the LoA he constructed, satisfies the specification he received. To provide this evidence, he has to show that the pseudo-code sorts an array and do it within the constraints put by the software designer, which amounts to explain how the computational process he designed eventually produces the output; to calculate the complexity of the algorithm, which amounts to deduce from the algorithm and to solve a set of recurrence equations. The knowledge and information to obtain these two goals are essential to justify his work, so this is the minimal explanation which suits the algorithm designer’s purpose. (12 of 18)
  • 13. The Minimal Levels of Abstraction When the purpose has been accomplished, the resulting machine shows (at least) two levels of abstraction: 1. the LoA which has been used to implement Heapsort over it; 2. the LoA which has Heapsort as a primitive. Each of these LoAs can be described within Floridi’s framework, thus being in strict interaction with a corresponding level of observation, which enables us to measure information. Although very simple, these two LoAs provide a gradient of abstractions: the description of the system used by the software house of our example is, really, the gradient, i.e., the sum of the two LoAs together with their mutual interactions. (13 of 18)
  • 14. The Levels of Explanation of an Algorithm The Heapsort procedure as implemented can be explained in, at least, four different ways: 1. to the machine, it is explained by the operational semantics, encoded in the computer machinery, which allows to execute the code. 2. to the programmer, it is explained as the adherence to the pseudo-code; 3. to the system designer, it is explained as a set of properties that allows the procedure to take its role inside the program; 4. to the algorithm designer, it is explained as an algorithm which solves a useful problem, and which enjoys a number of “good” properties; Each Level of Explanation (LoE) allows to fulfil a specific purpose, the one of the explaining agent. In the last three cases this has been already illustrated, while in the first, the purpose is simply to execute the procedure on a given input. (14 of 18)
  • 15. A gradient of explanation In Floridi’s terms, each complex, structured information, is understood on one of more Levels of Abstractions (LoAs), where each one presumes a Level of Explanation (LoE) that is used to construct what we informally called explanation. And, the four explanations are strictly linked one to the others, together providing an explanation for (part of) the purpose of the software house: to provide a program that solves a specific problem. (15 of 18)
  • 16. Minimal explanations and measures A gradient of explanations allows for a very simple way to measure distance between explanations: we say that the machine “understands” the code less than the software designer because the explanation of the machine is at level 1 in the gradient, while the software designer’s is at level 3. It is important to remark that this measure is relative to a gradient and a LoA: it does not make sense to use it outside this context. Nevertheless, this measure can be made more “objective” when we consider minimal explanations — as we tried to do — because any other gradient of explanations on the same LoA and inforgs would become an extension of the minimal one. (16 of 18)
  • 17. Conclusion The concept of the Gradient of Explanations (GoE) presented here was naturally derived within the Method of the LoAs. It is important to note, that the GoE has a different epistemological status compared to the Gradient of Abstractions (GoA). The consequences of the introduction of the GoE are not yet fully explored, and its formalisation is still preliminary. However, the Heapsort example will act as a concrete guideline so to apply the GoE in other cases. (17 of 18)
  • 18. Thank you for your attention! (18 of 18)