SlideShare a Scribd company logo
1 of 18
Download to read offline
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

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
 
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 language (Collected By Dushmanta)
C language  (Collected By Dushmanta)C language  (Collected By Dushmanta)
C language (Collected By Dushmanta)
Dushmanta Nath
 

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

Lecture filling algorithms
Lecture  filling algorithmsLecture  filling algorithms
Lecture filling algorithms
avelraj
 
Clipping Algorithm In Computer Graphics
Clipping Algorithm In Computer GraphicsClipping Algorithm In Computer Graphics
Clipping Algorithm In Computer Graphics
student(MCA)
 

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
 
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
 
User_42751212015Module1and2pagestocompetework.pdf.docx
User_42751212015Module1and2pagestocompetework.pdf.docxUser_42751212015Module1and2pagestocompetework.pdf.docx
User_42751212015Module1and2pagestocompetework.pdf.docx
dickonsondorris
 

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

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

Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
RohitNehra6
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Lokesh Kothari
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
AlMamun560346
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
RizalinePalanog2
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
Lokesh Kothari
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
PirithiRaju
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Sérgio Sacani
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
Sérgio Sacani
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOST
Sérgio Sacani
 

Recently uploaded (20)

Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdf
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
 
VIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C PVIRUSES structure and classification ppt by Dr.Prince C P
VIRUSES structure and classification ppt by Dr.Prince C P
 
CELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdfCELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdf
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
 
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptxCOST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
 
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
Discovery of an Accretion Streamer and a Slow Wide-angle Outflow around FUOri...
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on Io
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
Disentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOSTDisentangling the origin of chemical differences using GHOST
Disentangling the origin of chemical differences using GHOST
 
Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )Recombination DNA Technology (Nucleic Acid Hybridization )
Recombination DNA Technology (Nucleic Acid Hybridization )
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
 
Animal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptxAnimal Communication- Auditory and Visual.pptx
Animal Communication- Auditory and Visual.pptx
 

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)