SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
Measuring Computational Complexity
the qualitative and quantitative intertwining of algorithm comparison




                                                *Marco Benini
                                        marco.benini@uninsubria.it
                                        Department of Pure Mathematics
                                              University of Leeds

                                               Federico Gobbo
                                         federico.gobbo@univaq.it
                                      Dep. of Eng., Comp. Sc. and Maths.
                                        Università degli Studi dell’Aquila
Introduction




Given P and Q, two computer programs running on the same machine,
written in the same language, what does it mean

                        P is faster than Q?

The theory of computational complexity wants to answer this kind of
questions, i.e., when a program uses better some resource of a computing
device, or when a problem is solvable by an efficient program.




 2 of 16
Decision problems



As customary, assume that our programs solve decision problems:
   〈I , A〉 with I a set of possible inputs, and A ⊆ I;
   a program, given an input i ∈ I, terminates with a result which is YES
   when i ∈ A, NO otherwise;

Furthermore, we assume that
   programs do terminate for any input i ∈ I;
   programs operate on some reasonable machine.




 3 of 16
Time as steps

Instead of measuring time by seconds, minutes, hours, we measure time as
the number of elementary instructions a program performs in its
computation.

   This is an abstraction over the technology of the machine, as it reduces
   time to what is observable in the language the programs are written in;
   From an engineering point of view, this abstraction is reasonable, as
   elementary instructions execute in similar times;

This is a new level of abstraction (LoA, [Floridi (2008)]):
   internally coherent;
   the level of observation is clear;
   designer + machine: time as steps;
   programmer + machine: time as seconds.
 4 of 16
Complexity



The complexity of a program is a function C : I → N, mapping each input
into the number of steps needed to obtain an answer.

We compare two programs by comparing their complexities.
We classify a problem by means of the best program which solves it.

   Good idea, bad implementation!
   Complexities are not uniform;
   Paradoxes—if interested in one result you have to calculate it before
   choosing the calculator!




 5 of 16
Abstract over the input



   Worst case analysis: fixed the size of the input, choose the worst input of
   that size;
   Complexity is a function C : N → N, mapping each size to the longest
   number of steps needed to obtain a result for an input of that size;


   Globally uniform
   The choice of the worst case can be done statically, estimating an upper
   bound of the value C (n), for each n ∈ N.




 6 of 16
A new level of abstraction




   Globally uniform: if we are allowed to perform at most k steps, we cannot
   scan an input whose size is greater than k , that is, time bounds size;
   Complexities can be derived by observables: programs are observable,
   and static analysis on them provide us with (bounds for) complexities.
   a new inforg: analyst + (program +) abstract machine.

Functions, i.e., structured collections of values, instead of measures: we
are out of the quantitative world. . .




 7 of 16
Problems



. . . but we are not yet in a qualitative world!

In fact,
   complexities are too informative to use for comparisons;
   complexities do not form an order, thus classification of
   programs/problems is impossible;
   we do not use real complexities but an estimation of them, typically an
   upper bound.




 8 of 16
Complexity as a class



Since estimations are used, why not to promote them?

The complexity of a program is a function which bounds the real complexity
   if C is the complexity of P as previously defined, and F is a function
   N → N in some predefined class, F is the complexity class of P when
   there are a, b, k ∈ N such that aF (n) ≤ C (n) ≤ bF (n) for every n ≥ k .

Thus F provides the growth rate of the complexity of P for increasing values
of the size of the input.




 9 of 16
Complexity classes


A good choice of reasonable classes is available:
                      n        i
    polynomials:      i =0 ai x ;
                        n         i
    exponentials: b     i =0 ai x     ;
                   n          i
    logarithms:    i =0 (ai x         + bi logi x ).
These choices have nice mathematical properties both facilitating the static
analysis of programs, and having enough expressive power to estimate
every natural program.

    these classes are comparable: n log x ≤ x n ≤ nx for sufficiently large n
    and x;
    they form a classification.



 10 of 16
Extended Church-Turing thesis


Most problems falls into two super-classes:
    P is the class of problems solvable by a program operating in polynomial
    time;
    EXP is the class of problems solvable by a program operating in
    exponential time.
Evidently, P is contained in EXP. And it is possible to prove that the two
super-classes are distinct.

The extended Church-Turing thesis says that programs operating in
polynomial time are effective, while programs operating in exponential time
are practically uncomputable.



 11 of 16
Big problems!



If we allow the machine to do a limited amount of guessing, some problems
in EXP become polynomial.

Without giving the formal details, on these machines, called
non-deterministic, the polynomial problems form a class called NP. It is
immediate to see that P is contained in NP, and that NP is contained in
EXP.

The most important open problem in theoretical computer science is
whether P is distinct from NP. All the world bets that this is the case, but. . .




 12 of 16
Quality versus quantity

The abstraction “complexity as a function” to “complexity as a class” does
not form a level of abstraction (LoA):
    no new inforg is needed (and this is a good hint);
    its associated level of observation is identical.

In fact, it is better understood as a different level of explanation (LoE), using
Luciano Floridi’s terms [Floridi (2008)].

As a LoE, it is completely qualitative, allowing for a classification of decision
problems.

In terms of Information Quality (IQ) analysis, complexity as a class is
P-purpose, as algorithms serve to produce programs, regardless of the
actual use of them, i.e., their consumption (C-purpose) [Floridi (2013)].


 13 of 16
Conclusions




It is clear how the development has been achieved.

There is a poor understanding of the exact meaning of the intermediate
level of abstraction, where complexity is measured by a function.

We hope this real case study may lead to some insight on the threshold
between quantitative versus qualitative measuring, addressing the
P-purpose within the LoE of algorithm comparison.




 14 of 16
References




      Floridi, L. (2013), “Information Quality,” in Philos. Technol., 26, 1–6.
      Floridi, L. (2008), “The method of levels of abstraction,” in Minds and
      Machines, 18, 3, 303–329.




15 of 16
Thanks for your attention!


                       Questions?

                     For proposals, ideas & comments:

                   Download & share these slides here:
                    http://slidesha.re/14rFpZD

           marco.benini@uninsubria.it & federico.gobbo@univaq.it



                                                 C
                                  CC   BY:   $       Federico Gobbo & Marco Benini 2013
                                             




16 of 16

Weitere ähnliche Inhalte

Andere mochten auch

From simulations to (3D) virtuality: Mirorring tasks from language learning
From simulations to (3D) virtuality: Mirorring tasks from language learningFrom simulations to (3D) virtuality: Mirorring tasks from language learning
From simulations to (3D) virtuality: Mirorring tasks from language learningCristina Palomeque
 
Achieveing the Ying-Yang in language teaching and learning in virtual worlds
Achieveing the Ying-Yang in language teaching and learning in virtual worldsAchieveing the Ying-Yang in language teaching and learning in virtual worlds
Achieveing the Ying-Yang in language teaching and learning in virtual worldsCristina Palomeque
 
Communication Strategies in synchronous CMC and face-to-face interactions
Communication Strategies in synchronous CMC and face-to-face interactionsCommunication Strategies in synchronous CMC and face-to-face interactions
Communication Strategies in synchronous CMC and face-to-face interactionsCristina Palomeque
 
FinTechGroup: FinTech Fenyegetettség
FinTechGroup: FinTech FenyegetettségFinTechGroup: FinTech Fenyegetettség
FinTechGroup: FinTech Fenyegetettséglemakg
 
Counting sort(Non Comparison Sort)
Counting sort(Non Comparison Sort)Counting sort(Non Comparison Sort)
Counting sort(Non Comparison Sort)Hossain Md Shakhawat
 
Counting Sort and Radix Sort Algorithms
Counting Sort and Radix Sort AlgorithmsCounting Sort and Radix Sort Algorithms
Counting Sort and Radix Sort AlgorithmsSarvesh Rawat
 

Andere mochten auch (7)

From simulations to (3D) virtuality: Mirorring tasks from language learning
From simulations to (3D) virtuality: Mirorring tasks from language learningFrom simulations to (3D) virtuality: Mirorring tasks from language learning
From simulations to (3D) virtuality: Mirorring tasks from language learning
 
Achieveing the Ying-Yang in language teaching and learning in virtual worlds
Achieveing the Ying-Yang in language teaching and learning in virtual worldsAchieveing the Ying-Yang in language teaching and learning in virtual worlds
Achieveing the Ying-Yang in language teaching and learning in virtual worlds
 
Communication Strategies in synchronous CMC and face-to-face interactions
Communication Strategies in synchronous CMC and face-to-face interactionsCommunication Strategies in synchronous CMC and face-to-face interactions
Communication Strategies in synchronous CMC and face-to-face interactions
 
FinTechGroup: FinTech Fenyegetettség
FinTechGroup: FinTech FenyegetettségFinTechGroup: FinTech Fenyegetettség
FinTechGroup: FinTech Fenyegetettség
 
Time andspacecomplexity
Time andspacecomplexityTime andspacecomplexity
Time andspacecomplexity
 
Counting sort(Non Comparison Sort)
Counting sort(Non Comparison Sort)Counting sort(Non Comparison Sort)
Counting sort(Non Comparison Sort)
 
Counting Sort and Radix Sort Algorithms
Counting Sort and Radix Sort AlgorithmsCounting Sort and Radix Sort Algorithms
Counting Sort and Radix Sort Algorithms
 

Ähnlich wie Measuring Computational Complexity the qualitative and quantitative intertwining of algorithm comparison

Paper Analysis Essay The 5-page Paper You Submit Must At L.docx
Paper Analysis Essay The 5-page Paper You Submit Must At L.docxPaper Analysis Essay The 5-page Paper You Submit Must At L.docx
Paper Analysis Essay The 5-page Paper You Submit Must At L.docxmosyrettcc
 
Paper Analysis Essay The 5-page Paper You Submit Must At L.docx
Paper Analysis Essay The 5-page Paper You Submit Must At L.docxPaper Analysis Essay The 5-page Paper You Submit Must At L.docx
Paper Analysis Essay The 5-page Paper You Submit Must At L.docxaman341480
 
From programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides availableFrom programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides availableCelso Martins
 
Computational Fields meet Augmented Reality: Perspectives and Challenges
Computational Fields meet Augmented Reality: Perspectives and ChallengesComputational Fields meet Augmented Reality: Perspectives and Challenges
Computational Fields meet Augmented Reality: Perspectives and ChallengesDanilo Pianini
 
Scientific calculator project in c language
Scientific calculator project in c languageScientific calculator project in c language
Scientific calculator project in c languageAMIT KUMAR
 
Integrative Parallel Programming in HPC
Integrative Parallel Programming in HPCIntegrative Parallel Programming in HPC
Integrative Parallel Programming in HPCVictor Eijkhout
 
ESIT135 : Unit 1 Python Basics Concepts
ESIT135 : Unit 1 Python Basics  ConceptsESIT135 : Unit 1 Python Basics  Concepts
ESIT135 : Unit 1 Python Basics ConceptsSwapnaliGawali5
 
Software code metrics
Software code metricsSoftware code metrics
Software code metricsPVS-Studio
 
Believe it or not - keynote CAS 2015
Believe it or not - keynote CAS 2015Believe it or not - keynote CAS 2015
Believe it or not - keynote CAS 2015lantoli
 
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...Philippe Laborie
 
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
 
Snap!, a powerful tool for studying algorithms in high school
Snap!, a powerful tool for studying algorithms in high schoolSnap!, a powerful tool for studying algorithms in high school
Snap!, a powerful tool for studying algorithms in high schoolNathalie Carrié
 
LCBM: Statistics-Based Parallel Collaborative Filtering
LCBM: Statistics-Based Parallel Collaborative FilteringLCBM: Statistics-Based Parallel Collaborative Filtering
LCBM: Statistics-Based Parallel Collaborative FilteringFabio Petroni, PhD
 
A neural network solves, explains, and generates university math problems by ...
A neural network solves, explains, and generates university math problems by ...A neural network solves, explains, and generates university math problems by ...
A neural network solves, explains, and generates university math problems by ...Sarah Pollard
 
SPoC: search-based pseudocode to code
SPoC: search-based pseudocode to codeSPoC: search-based pseudocode to code
SPoC: search-based pseudocode to codeMinhazul Arefin
 

Ähnlich wie Measuring Computational Complexity the qualitative and quantitative intertwining of algorithm comparison (20)

Paper Analysis Essay The 5-page Paper You Submit Must At L.docx
Paper Analysis Essay The 5-page Paper You Submit Must At L.docxPaper Analysis Essay The 5-page Paper You Submit Must At L.docx
Paper Analysis Essay The 5-page Paper You Submit Must At L.docx
 
Paper Analysis Essay The 5-page Paper You Submit Must At L.docx
Paper Analysis Essay The 5-page Paper You Submit Must At L.docxPaper Analysis Essay The 5-page Paper You Submit Must At L.docx
Paper Analysis Essay The 5-page Paper You Submit Must At L.docx
 
From programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides availableFrom programming to software engineering: ICSE keynote slides available
From programming to software engineering: ICSE keynote slides available
 
Partial Compilers
Partial CompilersPartial Compilers
Partial Compilers
 
Computational Fields meet Augmented Reality: Perspectives and Challenges
Computational Fields meet Augmented Reality: Perspectives and ChallengesComputational Fields meet Augmented Reality: Perspectives and Challenges
Computational Fields meet Augmented Reality: Perspectives and Challenges
 
Scientific calculator project in c language
Scientific calculator project in c languageScientific calculator project in c language
Scientific calculator project in c language
 
Integrative Parallel Programming in HPC
Integrative Parallel Programming in HPCIntegrative Parallel Programming in HPC
Integrative Parallel Programming in HPC
 
Collatz Conjecture Research
Collatz Conjecture ResearchCollatz Conjecture Research
Collatz Conjecture Research
 
ESIT135 : Unit 1 Python Basics Concepts
ESIT135 : Unit 1 Python Basics  ConceptsESIT135 : Unit 1 Python Basics  Concepts
ESIT135 : Unit 1 Python Basics Concepts
 
Academic paper - Final
Academic paper - FinalAcademic paper - Final
Academic paper - Final
 
Software code metrics
Software code metricsSoftware code metrics
Software code metrics
 
Believe it or not - keynote CAS 2015
Believe it or not - keynote CAS 2015Believe it or not - keynote CAS 2015
Believe it or not - keynote CAS 2015
 
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...
An Optimal Iterative Algorithm for Extracting MUCs in a Black-box Constraint ...
 
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?
 
Snap!, a powerful tool for studying algorithms in high school
Snap!, a powerful tool for studying algorithms in high schoolSnap!, a powerful tool for studying algorithms in high school
Snap!, a powerful tool for studying algorithms in high school
 
Efficient projections
Efficient projectionsEfficient projections
Efficient projections
 
Efficient projections
Efficient projectionsEfficient projections
Efficient projections
 
LCBM: Statistics-Based Parallel Collaborative Filtering
LCBM: Statistics-Based Parallel Collaborative FilteringLCBM: Statistics-Based Parallel Collaborative Filtering
LCBM: Statistics-Based Parallel Collaborative Filtering
 
A neural network solves, explains, and generates university math problems by ...
A neural network solves, explains, and generates university math problems by ...A neural network solves, explains, and generates university math problems by ...
A neural network solves, explains, and generates university math problems by ...
 
SPoC: search-based pseudocode to code
SPoC: search-based pseudocode to codeSPoC: search-based pseudocode to code
SPoC: search-based pseudocode to code
 

Mehr von Federico Gobbo

Open Issues of Language Contestation in Italy
Open Issues of Language Contestation in ItalyOpen Issues of Language Contestation in Italy
Open Issues of Language Contestation in ItalyFederico Gobbo
 
Human-Machine Communication strategies in today’s Esperanto community of prac...
Human-Machine Communication strategies in today’s Esperanto community of prac...Human-Machine Communication strategies in today’s Esperanto community of prac...
Human-Machine Communication strategies in today’s Esperanto community of prac...Federico Gobbo
 
Esperanto as Lingua Receptiva / Esperanto Ricevema
Esperanto as Lingua Receptiva / Esperanto RicevemaEsperanto as Lingua Receptiva / Esperanto Ricevema
Esperanto as Lingua Receptiva / Esperanto RicevemaFederico Gobbo
 
L’utilizzo di lingue inventate come strumento di educazione interculturale in...
L’utilizzo di lingue inventate come strumento di educazione interculturale in...L’utilizzo di lingue inventate come strumento di educazione interculturale in...
L’utilizzo di lingue inventate come strumento di educazione interculturale in...Federico Gobbo
 
One species, many languages
One species, many languagesOne species, many languages
One species, many languagesFederico Gobbo
 
Una lingua comune per l'Europa?
Una lingua comune per l'Europa?Una lingua comune per l'Europa?
Una lingua comune per l'Europa?Federico Gobbo
 
Esperanto: el Eŭropa lulilo al disvastiĝo tra la tuta mondo
Esperanto: el Eŭropa lulilo al disvastiĝo tra la tuta mondoEsperanto: el Eŭropa lulilo al disvastiĝo tra la tuta mondo
Esperanto: el Eŭropa lulilo al disvastiĝo tra la tuta mondoFederico Gobbo
 
Reflecting upon the European Day of Languages
Reflecting upon the European Day of LanguagesReflecting upon the European Day of Languages
Reflecting upon the European Day of LanguagesFederico Gobbo
 
Interlinguistica ed esperantologia oggi: l’esperienza di Amsterdam
Interlinguistica ed esperantologia oggi: l’esperienza di AmsterdamInterlinguistica ed esperantologia oggi: l’esperienza di Amsterdam
Interlinguistica ed esperantologia oggi: l’esperienza di AmsterdamFederico Gobbo
 
Adpositional Argumentation: How Logic Originates In Natural Argumentative Dis...
Adpositional Argumentation: How Logic Originates In Natural Argumentative Dis...Adpositional Argumentation: How Logic Originates In Natural Argumentative Dis...
Adpositional Argumentation: How Logic Originates In Natural Argumentative Dis...Federico Gobbo
 
Complex Arguments in Adpositional Argumentation
Complex Arguments in Adpositional ArgumentationComplex Arguments in Adpositional Argumentation
Complex Arguments in Adpositional ArgumentationFederico Gobbo
 
Assessing linguistic unease to understand (socio)linguistic justice
Assessing linguistic unease to understand (socio)linguistic justiceAssessing linguistic unease to understand (socio)linguistic justice
Assessing linguistic unease to understand (socio)linguistic justiceFederico Gobbo
 
Lingua di contatto e mobilità: il caso dell'esperanto
Lingua di contatto e mobilità: il caso dell'esperantoLingua di contatto e mobilità: il caso dell'esperanto
Lingua di contatto e mobilità: il caso dell'esperantoFederico Gobbo
 
Le lingue di minoranza: il caso dell'esperanto
Le lingue di minoranza: il caso dell'esperantoLe lingue di minoranza: il caso dell'esperanto
Le lingue di minoranza: il caso dell'esperantoFederico Gobbo
 
The Religious Dimensions of the Esperanto Collective Identity
The Religious Dimensions of the Esperanto Collective IdentityThe Religious Dimensions of the Esperanto Collective Identity
The Religious Dimensions of the Esperanto Collective IdentityFederico Gobbo
 
I limiti dell'invenzione linguistica: la tipologia linguistica dall'esperanto...
I limiti dell'invenzione linguistica: la tipologia linguistica dall'esperanto...I limiti dell'invenzione linguistica: la tipologia linguistica dall'esperanto...
I limiti dell'invenzione linguistica: la tipologia linguistica dall'esperanto...Federico Gobbo
 
Sei definizioni in cerca di una disciplina - Interlinguistica tra comunicazio...
Sei definizioni in cerca di una disciplina - Interlinguistica tra comunicazio...Sei definizioni in cerca di una disciplina - Interlinguistica tra comunicazio...
Sei definizioni in cerca di una disciplina - Interlinguistica tra comunicazio...Federico Gobbo
 
Lingva Kafejo: Esperanto
Lingva Kafejo: EsperantoLingva Kafejo: Esperanto
Lingva Kafejo: EsperantoFederico Gobbo
 
Fare musica in esperanto : ieri, oggi, domani
Fare musica in esperanto : ieri, oggi, domaniFare musica in esperanto : ieri, oggi, domani
Fare musica in esperanto : ieri, oggi, domaniFederico Gobbo
 
Hollywood Languages: The Challenge of Interlinguistics in the New Millennium
Hollywood Languages: The Challenge of Interlinguistics in the New MillenniumHollywood Languages: The Challenge of Interlinguistics in the New Millennium
Hollywood Languages: The Challenge of Interlinguistics in the New MillenniumFederico Gobbo
 

Mehr von Federico Gobbo (20)

Open Issues of Language Contestation in Italy
Open Issues of Language Contestation in ItalyOpen Issues of Language Contestation in Italy
Open Issues of Language Contestation in Italy
 
Human-Machine Communication strategies in today’s Esperanto community of prac...
Human-Machine Communication strategies in today’s Esperanto community of prac...Human-Machine Communication strategies in today’s Esperanto community of prac...
Human-Machine Communication strategies in today’s Esperanto community of prac...
 
Esperanto as Lingua Receptiva / Esperanto Ricevema
Esperanto as Lingua Receptiva / Esperanto RicevemaEsperanto as Lingua Receptiva / Esperanto Ricevema
Esperanto as Lingua Receptiva / Esperanto Ricevema
 
L’utilizzo di lingue inventate come strumento di educazione interculturale in...
L’utilizzo di lingue inventate come strumento di educazione interculturale in...L’utilizzo di lingue inventate come strumento di educazione interculturale in...
L’utilizzo di lingue inventate come strumento di educazione interculturale in...
 
One species, many languages
One species, many languagesOne species, many languages
One species, many languages
 
Una lingua comune per l'Europa?
Una lingua comune per l'Europa?Una lingua comune per l'Europa?
Una lingua comune per l'Europa?
 
Esperanto: el Eŭropa lulilo al disvastiĝo tra la tuta mondo
Esperanto: el Eŭropa lulilo al disvastiĝo tra la tuta mondoEsperanto: el Eŭropa lulilo al disvastiĝo tra la tuta mondo
Esperanto: el Eŭropa lulilo al disvastiĝo tra la tuta mondo
 
Reflecting upon the European Day of Languages
Reflecting upon the European Day of LanguagesReflecting upon the European Day of Languages
Reflecting upon the European Day of Languages
 
Interlinguistica ed esperantologia oggi: l’esperienza di Amsterdam
Interlinguistica ed esperantologia oggi: l’esperienza di AmsterdamInterlinguistica ed esperantologia oggi: l’esperienza di Amsterdam
Interlinguistica ed esperantologia oggi: l’esperienza di Amsterdam
 
Adpositional Argumentation: How Logic Originates In Natural Argumentative Dis...
Adpositional Argumentation: How Logic Originates In Natural Argumentative Dis...Adpositional Argumentation: How Logic Originates In Natural Argumentative Dis...
Adpositional Argumentation: How Logic Originates In Natural Argumentative Dis...
 
Complex Arguments in Adpositional Argumentation
Complex Arguments in Adpositional ArgumentationComplex Arguments in Adpositional Argumentation
Complex Arguments in Adpositional Argumentation
 
Assessing linguistic unease to understand (socio)linguistic justice
Assessing linguistic unease to understand (socio)linguistic justiceAssessing linguistic unease to understand (socio)linguistic justice
Assessing linguistic unease to understand (socio)linguistic justice
 
Lingua di contatto e mobilità: il caso dell'esperanto
Lingua di contatto e mobilità: il caso dell'esperantoLingua di contatto e mobilità: il caso dell'esperanto
Lingua di contatto e mobilità: il caso dell'esperanto
 
Le lingue di minoranza: il caso dell'esperanto
Le lingue di minoranza: il caso dell'esperantoLe lingue di minoranza: il caso dell'esperanto
Le lingue di minoranza: il caso dell'esperanto
 
The Religious Dimensions of the Esperanto Collective Identity
The Religious Dimensions of the Esperanto Collective IdentityThe Religious Dimensions of the Esperanto Collective Identity
The Religious Dimensions of the Esperanto Collective Identity
 
I limiti dell'invenzione linguistica: la tipologia linguistica dall'esperanto...
I limiti dell'invenzione linguistica: la tipologia linguistica dall'esperanto...I limiti dell'invenzione linguistica: la tipologia linguistica dall'esperanto...
I limiti dell'invenzione linguistica: la tipologia linguistica dall'esperanto...
 
Sei definizioni in cerca di una disciplina - Interlinguistica tra comunicazio...
Sei definizioni in cerca di una disciplina - Interlinguistica tra comunicazio...Sei definizioni in cerca di una disciplina - Interlinguistica tra comunicazio...
Sei definizioni in cerca di una disciplina - Interlinguistica tra comunicazio...
 
Lingva Kafejo: Esperanto
Lingva Kafejo: EsperantoLingva Kafejo: Esperanto
Lingva Kafejo: Esperanto
 
Fare musica in esperanto : ieri, oggi, domani
Fare musica in esperanto : ieri, oggi, domaniFare musica in esperanto : ieri, oggi, domani
Fare musica in esperanto : ieri, oggi, domani
 
Hollywood Languages: The Challenge of Interlinguistics in the New Millennium
Hollywood Languages: The Challenge of Interlinguistics in the New MillenniumHollywood Languages: The Challenge of Interlinguistics in the New Millennium
Hollywood Languages: The Challenge of Interlinguistics in the New Millennium
 

Measuring Computational Complexity the qualitative and quantitative intertwining of algorithm comparison

  • 1. Measuring Computational Complexity the qualitative and quantitative intertwining of algorithm comparison *Marco Benini marco.benini@uninsubria.it Department of Pure Mathematics University of Leeds Federico Gobbo federico.gobbo@univaq.it Dep. of Eng., Comp. Sc. and Maths. Università degli Studi dell’Aquila
  • 2. Introduction Given P and Q, two computer programs running on the same machine, written in the same language, what does it mean P is faster than Q? The theory of computational complexity wants to answer this kind of questions, i.e., when a program uses better some resource of a computing device, or when a problem is solvable by an efficient program. 2 of 16
  • 3. Decision problems As customary, assume that our programs solve decision problems: 〈I , A〉 with I a set of possible inputs, and A ⊆ I; a program, given an input i ∈ I, terminates with a result which is YES when i ∈ A, NO otherwise; Furthermore, we assume that programs do terminate for any input i ∈ I; programs operate on some reasonable machine. 3 of 16
  • 4. Time as steps Instead of measuring time by seconds, minutes, hours, we measure time as the number of elementary instructions a program performs in its computation. This is an abstraction over the technology of the machine, as it reduces time to what is observable in the language the programs are written in; From an engineering point of view, this abstraction is reasonable, as elementary instructions execute in similar times; This is a new level of abstraction (LoA, [Floridi (2008)]): internally coherent; the level of observation is clear; designer + machine: time as steps; programmer + machine: time as seconds. 4 of 16
  • 5. Complexity The complexity of a program is a function C : I → N, mapping each input into the number of steps needed to obtain an answer. We compare two programs by comparing their complexities. We classify a problem by means of the best program which solves it. Good idea, bad implementation! Complexities are not uniform; Paradoxes—if interested in one result you have to calculate it before choosing the calculator! 5 of 16
  • 6. Abstract over the input Worst case analysis: fixed the size of the input, choose the worst input of that size; Complexity is a function C : N → N, mapping each size to the longest number of steps needed to obtain a result for an input of that size; Globally uniform The choice of the worst case can be done statically, estimating an upper bound of the value C (n), for each n ∈ N. 6 of 16
  • 7. A new level of abstraction Globally uniform: if we are allowed to perform at most k steps, we cannot scan an input whose size is greater than k , that is, time bounds size; Complexities can be derived by observables: programs are observable, and static analysis on them provide us with (bounds for) complexities. a new inforg: analyst + (program +) abstract machine. Functions, i.e., structured collections of values, instead of measures: we are out of the quantitative world. . . 7 of 16
  • 8. Problems . . . but we are not yet in a qualitative world! In fact, complexities are too informative to use for comparisons; complexities do not form an order, thus classification of programs/problems is impossible; we do not use real complexities but an estimation of them, typically an upper bound. 8 of 16
  • 9. Complexity as a class Since estimations are used, why not to promote them? The complexity of a program is a function which bounds the real complexity if C is the complexity of P as previously defined, and F is a function N → N in some predefined class, F is the complexity class of P when there are a, b, k ∈ N such that aF (n) ≤ C (n) ≤ bF (n) for every n ≥ k . Thus F provides the growth rate of the complexity of P for increasing values of the size of the input. 9 of 16
  • 10. Complexity classes A good choice of reasonable classes is available: n i polynomials: i =0 ai x ; n i exponentials: b i =0 ai x ; n i logarithms: i =0 (ai x + bi logi x ). These choices have nice mathematical properties both facilitating the static analysis of programs, and having enough expressive power to estimate every natural program. these classes are comparable: n log x ≤ x n ≤ nx for sufficiently large n and x; they form a classification. 10 of 16
  • 11. Extended Church-Turing thesis Most problems falls into two super-classes: P is the class of problems solvable by a program operating in polynomial time; EXP is the class of problems solvable by a program operating in exponential time. Evidently, P is contained in EXP. And it is possible to prove that the two super-classes are distinct. The extended Church-Turing thesis says that programs operating in polynomial time are effective, while programs operating in exponential time are practically uncomputable. 11 of 16
  • 12. Big problems! If we allow the machine to do a limited amount of guessing, some problems in EXP become polynomial. Without giving the formal details, on these machines, called non-deterministic, the polynomial problems form a class called NP. It is immediate to see that P is contained in NP, and that NP is contained in EXP. The most important open problem in theoretical computer science is whether P is distinct from NP. All the world bets that this is the case, but. . . 12 of 16
  • 13. Quality versus quantity The abstraction “complexity as a function” to “complexity as a class” does not form a level of abstraction (LoA): no new inforg is needed (and this is a good hint); its associated level of observation is identical. In fact, it is better understood as a different level of explanation (LoE), using Luciano Floridi’s terms [Floridi (2008)]. As a LoE, it is completely qualitative, allowing for a classification of decision problems. In terms of Information Quality (IQ) analysis, complexity as a class is P-purpose, as algorithms serve to produce programs, regardless of the actual use of them, i.e., their consumption (C-purpose) [Floridi (2013)]. 13 of 16
  • 14. Conclusions It is clear how the development has been achieved. There is a poor understanding of the exact meaning of the intermediate level of abstraction, where complexity is measured by a function. We hope this real case study may lead to some insight on the threshold between quantitative versus qualitative measuring, addressing the P-purpose within the LoE of algorithm comparison. 14 of 16
  • 15. References Floridi, L. (2013), “Information Quality,” in Philos. Technol., 26, 1–6. Floridi, L. (2008), “The method of levels of abstraction,” in Minds and Machines, 18, 3, 303–329. 15 of 16
  • 16. Thanks for your attention! Questions? For proposals, ideas & comments: Download & share these slides here: http://slidesha.re/14rFpZD marco.benini@uninsubria.it & federico.gobbo@univaq.it C CC BY: $ Federico Gobbo & Marco Benini 2013 16 of 16