Wednesday, 7 August 2013

About Theory of Computation



Students of computer science in usually take a course on Theory of Computation as an elective some time after they have finished courses on programming, data structures, discrete mathematical structures (whatever that means), computer architecture, programming languages and sometimes operating systems as well. Theory of computation is of course a very broad and deep area, and it is anyone’s guess what really should be taught in such course. For example, Dexter Kozen’s text with the same name suggests that the course should dwell primarily on complexity classes. Most courses on Theory of Computation in India follow the classic text by Hopcroft and Ullman [1] on formal languages and automata which was written at a time when parsing, compiling, code optimization and complexity theory were pursued as frontier areas of research. As a result, the exposure to automata theory and formal languages was considered the most important aspect of the theory, later followed by some exposure to NP-completeness. Moreover the book was written for graduate students.
More recently (apparently on the strength of having course web pages on Programming, Logic, Programming Languages and Complier Design), I have been bombarded by questions from students and outsiders (some of them managers with computer science degrees who are willing to pay thousands of dollars if I agreed to sit in on such a project) regarding the feasibility of designing tools which would take the programs of their (novice?) programmers and transform them automatically into the most efficient program possible or the shortest program possible in some language. I have even been asked why these programs cannot be proved automatically thus saving the company a small fortune in testing time and being able to meet stiff deadlines.
Anyway that’s my story and I am sticking to it.
It is my feeling that at a time when courses on compilers, formal languages, complexity theory and automatic verification are usually electives which students tend to avoid, this has led to a disconnect between a course primarily devoted to formal languages and automata theory and the bouquet of courses that students otherwise need to do in a typical computer science curriculum.
Anyway that’s my story and I am sticking to it.
It is also my feeling that IIT students (who are numerically quite literate) feel most comfortable when numbers and computations on numbers form the basis for a theory of computation. On the other hand courses on theory of computation which primarily teach automata and formal languages usually completely ignore the connections between programming and computability theory and scant attention is paid to the theory of primitive recursive functions and the design of data structures or programming language features. As a result students who sit through a course on automata and formal languages and who have no intention of pursuing either compilers or formal verification or complexity theory, emerge from the course feeling that the whole course was useless and unconnected to anything they have learned and anything else they might learn and of no use whatsoever in their professional life in industry.
 Anyway that’s my story and I am sticking to it.
I decided therefore to make computability theory the primary focus of these lecture notes and gradually introduce Turing machines, finite automata and formal languages. I have used the books of Cutland [4] and Martin Davis ([2], [3]) as my primary sources for these lecture notes. I have tried to introduce the connections between the theory of computability with other courses such as programming, functional programming, data structures, discrete mathematical strucutres and operating systems in as elementary a fashion as possible. It has been a source of wonder to me that this beautiful material seems to be taught mostly only to students of pure or applied mathematics or logic rather than to computer science students. I am sure students of engineering can absorb this material and appreciate it equally well, especially since it requires little more than high school mathematics to understand it (though it might require a more maturity to appreciate it).
Anyway that’s my story and I am sticking to it.
I have of course borrowed freely from various sources, but in many cases I have made significant departures fromt he original material especially as concerns notation. Not to put too fine a point on it, I believe that my notation though strange to look at, is an attempt to clean up (mostly for my own understanding) misleading notation used in various sources.
[1] Hopcroft J and Ullman J D. Automata, Languages and Computation. Addison- esley, New York, 1983.
[2] Davis M. Computability and Unsolvability. Dover Publications Inc., New York, 1982.
[3] Davis M and Weyukar E. Computability, Complexity and Languages. Academic Press,New York, 1983.
[4] Cutland N.Computability:An Introduction to Recursive Funt Theory.CUP,Cambridge,Great Britain,1980.

It is a mystery to me how it has come to be taught as a textbook for an undergraduate course. I would assume that the same natural processes which brought Euclid, Descartes and Newton down to school mathematics are responsible for it. But nevertheless the transition in the case of formal languages and automata has taken place in less than 15 years while Newton took about 200 years before being prescribed for high school.

Monday, 17 June 2013

How to format pen drive from terminal in Ubuntu

Many times it happens that your pen drive or memory cards does not formatted from file manager so you have to format it from terminal. In this tutorial, it is shown that how to format pen drive or any other hard-disk or memory card from terminal using commands in Ubuntu.

This text  gives you a complete idea of how to format pen drive from terminal and which commands you have to type.


I also attached the screenshots of this commands from terminal window step by step.
 
 First of all unmount your pen drive using the following command.

       sudo umount /dev/sdbN
 N : number of drive it may be 1 ,2,3,4 etc


Then enter the following command to format your pen drive with 
        FAT32 partition.
 sudo mkfs.vfat -n 'Ubuntu' -I /dev/sdbN
where Ubuntu is the name of your disk 
 

Friday, 14 June 2013

NP-complete


In computational complexity theory, the complexity class NP-complete  is a class of decision problems. A decision problem L is NP-complete if it is in the set of NP problems and also in the set of NP-hard problems. The abbreviation NP refers to "nondeterministic polynomial time."
Although any given solution to such a problem can be verified quickly, there is no known efficient way to locate a solution in the first place; indeed, the most notable characteristic of NP-complete problems is that no fast solution to them is known. That is, the time required to solve the problem using any currently known algorithm increases very quickly as the size of the problem grows. This means that the time required to solve even moderately sized versions of many of these problems can easily reach into the billions or trillions of years, using any amount of computing power available today. As a consequence, determining whether or not it is possible to solve these problems quickly, called the P versus NP problem, is one of the principal unsolved problems in computer science today.
While a method for computing the solutions to NP-complete problems using a reasonable amount of time remains undiscovered, computer scientists and programmers still frequently encounter NP-complete problems. NP-complete problems are often addressed by using approximation algorithms.

Euler diagram for P, NP, NP-complete, and NP-hard set of problems. The left side is valid under the assumption that P≠NP, while the right side is valid under the assumption that P=NP

Tuesday, 11 June 2013

Concepts, Techniques and Models of Computing

 
Introduction Notes
c_const_test.c

Declarative Model
Outline

Exceptions
Exceptions

Unification
Unification
Declarative Programming Techniques- Tail Recursion, Follow.

the grammar
declarative- programming

Declarative Concurrency - Introduction, Semantics declarative-concurrency

Thread.oz
Declarative Concurrency-Threads
Erlang - Sequential Programming, Concurrent Programming erlang
Erlang - Concurrent Programming (contd.)
Object-Oriented Programming oop

Java 1.4 Polymorphism
Type Inference tinf

Some fact about Complexity, Algorithms, Cryptography

  • Computational Complexity

Most of the open problems in computational complexity can be stated in terms of lower bounds. There are few general techniques available in proving lower bounds, and consequently, there has been little progress in this field. My approach to solving such problems is bottom up, working with simple open problems such as:
  • Do we need an exponential number of states to simulate a two-way nondeterministic finite automaton by a deterministic one?
  • What is the minimum parallel time required to solve some specific problems using a given number of processors? 
  • Algorithms

    I am working on designing new sequential and parallel algorithms, and improving existing ones, to solve various computational problems such as: graph isomorphism, membership in permutation groups (generalized Rubik's Cube), network flow, matching in graphs, Boolean matrix multiplication, and connectivity of graphs.
    Recently, I have been concentrating on the following problems.
    Dynamic graph algorithms. These are algorithms which solve problems in which the input graph keeps changing; e.g. edges are inserted and deleted or weights are increased or decreased. The goal is to maintain the solution in such a way that the changes in it can be found faster than resolving the problem from scratch.
    String processing algorithms with applications to molecular biology. There exist computational problems associated with the human genome project where algorithmic improvements are possible. An area were considerable progress has already been achieved is the speed up of various dynamic programming techniques.
     
  • Cryptography

    Various number theoretic problems, such as factoring of integers, primality testing, discrete logarithms and quadratic residuocity, are used as a basis for public key cryptosystems. The security of such crpytosystems therefore depends on the complexity of these problems. A deeper understanding of the complexity of these problems can help in reasoning about the security of the cryptosystems.
    Currently, proving the correctness and security of cryptoprotocols is hard. I am working on general techniques that can be applied to constructing protocols for which it is possible to prove things about.
     

Automaton Simulator

Finite State Automation Applet is an automaton simulator, similar to JFLAP. Requires Java.

Analysis of Algorithm


Introduction,   RAM model,     Worst-case complexity I Asymptotics                                                         Note 1

Asymptotics, Induction,
Divide and conquer, Merge sort Recurrence, Recursion tree
Note 2

Binary search, Powering, Matrix multiplication, Strassen's algorithm,
Master theorem

Note 3

Randomized algorithms,
Quicksort and its analysis


Note 4

Randomized Quicksort
Note 5

Selection in linear time, and
Lower bound on comparison sorts

Note 6

Counting sort and Radix sort
Hash tables and hash functions

Note 7.1
Note 7.2

Universal hashing
Note 8

Perfect hashing and
Binary search trees

Note 9.1
Note 9.2

Red-Black trees
Note 10

Augmenting data structures
Order statistics, Interval trees

Note 11

Greedy algorithms
Activity selection

Note 12

Greedy: Huffman trees,
Dynamic programming: Rod cutting

Note 13

Dynamic programming: Longest
common subsequence



Midterm in class


Dynamic programming: Optimal
binary search tree; midterm problems
Note 14

Amortized analysis
Note 15

Graphs and Breadth-first search
Note 16

Breadth-first search and its correctness
See Note 16

Depth-first search and Topological sort
Note 17

Strongly connected componentsMinimum spanning tree: the generic method Note 18

Minimum spanning trees:
Kruskal and Prim
Note 19

Single-source shortest path:
Bellman-Ford and Dijkstra

Note 20

All-pairs shortest paths
Note 21

Maximum Flow: Ford-Fulkerson Note 22

Edmonds-Karp, and
Maximum bipartite matching
Note 23

NP-completeness
Note 24

NP-completeness
Note 25