Abstraction in Mathematics and Computer Science

Abstraction is a purposeful process to focus on essentials, observable behavior, and ignore irrelevant details. Abstraction is a process frequently used in mathematics and computer science.

In computer science, there is a complementary process called encapsulation for abstraction. Encapsulation applies information hiding to hide secrets so that observable behavior is abstracted. For example, assuming we want to reinvent a virtual pizza store, a chef in the store is responsible to make pizzas. A customer orders a cheese pizza and the order is delivered to the chef, who then cooks the pizza to fulfill the order. The customer and/or some waiter doesn't need to know how the chef take actions to make the cheese pizza. The chef, however, hides the 'secrets' to make the pizza. Abstraction and encapsulation work together to invent the automating agents in the pizza store.

In mathematics, abstraction is important to produce a simple, elegant proof. Assuming that we want to prove the following statement.

"There are 8 baskets and 34 apples. If there is at least one apple in each of the 8 baskets, at least two baskets must have same number of apples."

We can apply prove by contradiction to prove the statement. We first find the logic negation of the result we want to prove. The logic negation should be: every basket must have a different number of apple(s) from other baskets. To infer a contradiction based on the following conditions and assumption:

a. There are 34 apples.
b. Each basket has at least one apple and the number of apple(s) is a unique number
c. There are 8 baskets.

Then, based on b and c, the minimum number of apples in the 8 baskets will be
1 + 2 + .... + 8 = 36, which is greater than 34, the condition given in the original statement. Therefore, a contradiction is arrived.

Abstraction here is applied to focus on the essential, the minimum number of apples in the 8 baskets based on b and c. The issue how the 36 apples are distributed into the 8 baskets is irrelevant except that the 8 numbers are different.

There is an article, computational thinking, discussing abstraction and automating in CS. It is worthy to do a careful reading for people who are interested in computing.





Comments

Popular posts from this blog

25 Google Interview Questions

Convert LaTeX to HTML

Art of Software Development