Difference between revisions of "CSC103: DT's Notes 1"

From dftwiki3
Jump to: navigation, search
Line 36: Line 36:
 
The choice of using electricity has influenced greatly a fundamental way in which modern computers work.  They all use the binary system at the lowest level.  Because electricity can be turned ON or OFF with a switch, it was only logical that these two states would be used to represent information.  ON and OFF.  0 and 1.  True and False.  But if we can represent two different states, two different levels of information, can we represent other than 0 or 1?  Say 257?  Can we also organize electrical circuitry that can perform the addition of two numbers?
 
The choice of using electricity has influenced greatly a fundamental way in which modern computers work.  They all use the binary system at the lowest level.  Because electricity can be turned ON or OFF with a switch, it was only logical that these two states would be used to represent information.  ON and OFF.  0 and 1.  True and False.  But if we can represent two different states, two different levels of information, can we represent other than 0 or 1?  Say 257?  Can we also organize electrical circuitry that can perform the addition of two numbers?
  
The answers to these questions, and the ensuing solutions are provided by two giants of computer science, '''George Boole''', and '''Claude Shannon''' who worked at very different times.  Boole, in the 1840s, conceived an algebra, that is a mathematical system that obeyed the laws an algebra typically verifies, but that was based on only two values, two symbols.  Boole's interest was ''logic'' and wether we can represent any expression that is only True or False as a combination of simpler assertions, that themselves can be only True or False.   He succeeded in showing that this system of his was indeed an algebra, a '''[http://mathworld.wolfram.com/BooleanAlgebra.html boolean algebra]''', in the mathematical senseQuite a strong statement, and mostly of use for people interested in logic.  
+
The answers to these questions, and the ensuing solutions are provided by two giants of computer science, '''George Boole''', and '''Claude Shannon''' who worked at very different times.   
 +
 
 +
Boole's contribution was first in the history of computers.  In the 1840s, he conceived of a mathematical world where there would be only two symbols, two values, and three operations that could be performed with them, and he proved that such a system could exhibit the same rules exhibited by an algebra.  The two values used by Boole's algebra are ''True'' and ''False'', or ''T'' and ''F'', and the operators are ''and'', ''or'' and ''not''.  In essence he said that any combination, and function of many different variables that can only take the values ''T'' or ''F'' can be expressed by a combination of ''and'', ''or'' and ''not'' operators.
 +
 
 +
An example will illustrate this concept.
 +
 
 +
Assume that I'm interested in buying ice cream for three friends: Edna, Liz, and Frida. Before going to the store I probe my friends for their taste in ice cream. Edna likes anything with chocolate, but doesn't like anything with fruit. She also doesn't like
 +
Haagen Dazs icecream.  Liz doesn't like  chocolate, and doesn't care about the brandFrida likes everything.  So we can create three boolean variables:
 +
{|
 +
| Variable ''a''
 +
| likes chocolate ice cream
 +
|-
 +
| Variable ''b''
 +
| likes fruit ice cream
 +
|-
 +
| Variable ''c''
 +
| likes Haagen Dazs
 +
|}
 +
 
 +
And if I assigned these three variables to each of my friends, here is what I get for their value:
 +
 
 +
{|
 +
! Variable
 +
! Definition
 +
! Edna
 +
! Liz
 +
! Frida
 +
|-
 +
|  ''a''
 +
| likes chocolate ice cream
 +
| F
 +
| T
 +
| F
 +
|-
 +
|  ''b''
 +
| likes fruit ice cream
 +
| F
 +
| T
 +
| T
 +
|-
 +
| ''c''
 +
| likes Haagen Dazs
 +
| T
 +
| T
 +
| T
 +
|}
  
Before we move on to Shannon, let's go through a simple example that will illustrate how boolean operators work.
 
  
  

Revision as of 14:46, 30 January 2012

--© D. Thiebaut 08:10, 30 January 2012 (EST)


...