The four rules of problem solving / programming / life

Generalize : Find more different look-alike particular problems then solve for all simultaneously
Abstract : Identify and understand the higher level underlying concept
Instantiate : Solve your problem as a particular instance of a more general solution
Name : give a concept an alias and precise specifications to get power over it.

Generalize :

Let'say that it happens you have to prove 5 < 9 => 10 < 18
You should be thinking :
-Forall x,y,f,g,op x op y ?=> f(x) op g(y)
-Exist x,y,f,g,op,imp f(x) op g(y) ?imp x op y
-Quantify(x,y,f,g,op,imp) f(x) op g(y) ?imp x op y
-QuantifyWithConditions(x,y,z,t,op,imp) x op y ?imp z op t
Let'say that it happens you have to sort a list of integers.
You should be thinking :
-How about sorting list of strings ?
-How about sorting arrays ?
-What kind of sort algorithm can I use ?
-What about performance and parrallelism ?
-Is sorting a list of integers really necessary ?
Let'say that it happens you have to buy a car.
You should be thinking :
-How about a bicycle ?
-How about renting one ?
-How about selling one ?
-How about making my own transportation system ?
-should I be using a car ?
The key point in generalizing, is altering the original problem by asking the question why ?
Why is the problem the way it is ? You should try to link concepts that might be linked.


Abstract :

5 < 9 => 5 + 5 < 9 + 9
x < y ?=> f(x) < f(y)
f growing |- comp(x,y) => comp(f(x),f(y))
possible underlying concepts : comp, addition, growing, function, implication, hypothesis
Factorizing the previously emerged instances of the problem
By grouping interchangeable objects like integer and strings, radix sort and bubble sort, lists and arrays,
By grouping the different operations you observe, permutations, access patterns
By examining the different properties
You find yourself dealing with the following concepts :
Enumerable, Collection, Comparaison operator, Genericity, Sort Algorithm, Stability, Cache coherency, Scalability
Factorizing the previously emerged instances of the problem
By grouping interchangeable objects like car and bicycle, buying or renting
By grouping the different operations you observe like exchanging objects, Interacting with people
By examining the causes and consequences
You find yourself dealing with the following concepts :
Transportation system, Exchange, Industry, Service, Ecology, Sport, Money
The key points in abstracting, are to identify the similarities and differences, group accordingly, and define relations between these groups. You are here building a concept map. Beauty in the Ockham's razor sense should be your guide.


Instantiate :

It just happens that our problem was the specific solution of the definition of a growing function applied to the function x -> x + x
You could have found your solution just by backward chaining with a set of known general theorems.
It just happens that our problem was the specific solution of the sort of an enumerable generic collection applied to the list of integers.
You could have found your solution just by using a library with an eventual adapter.
It happens that our problem was the specific solution of Exchange "money" for "car" by the intermediate of ( "Industy" of "Transportation system" )
You could have found your solution just by googling for it, and proceeding with the exchange.
The key point here is reuse. You should try to see your problem as a particuliar solution to a more general problem. Instantiating should be as simple as possible. In fact, the ease of Instantiating is an indicator of good Generalization, Abstraction and Naming.


Name :

The naming is the process of precisely defining the frontiers of the concept :
Fix the ideas, go into the details once, extract what's useful, then forget the details.
This is the essence of formalism
It is a way of indicating that a particular concept is significative.
The name is an alias for a concept. It allows to shorten the length of the proofs.
The naming is the process of precisely defining the frontiers of the concept:
Fix the ideas, go into the details once, extract what's useful, then forget the details.
This is the essence of modularity.
It is a way of indicating that a particular concept is significative.
The name is an alias for a concept. It allows to shorten the length of the code.
The naming is the process of precisely defining the frontiers of the concept:
Fix the ideas, go into the details once, extract what's useful, then forget the details.
This is the essence of representation
It is a way of indicating that a particular concept is significative.
The name is an alias for a concept. It allows to shorten the communication process.
Name is what you transmit for anyone to build on.


Darkblue

Post Scriptum :
This is a self-described description.

No comments:

Post a Comment