Mathematical Relations in Computing - Unary

889 Views Asked by At

I have this question that's bugging my mind:

"Discuss by giving suitable examples the role of mathematical relations (Unary, binary and ternary) in computing."

I'm sure it's a very simple question, but the way it's been phrased is just killing me. Our lecturer is not a competent English speaker, so I find it incredibly difficult to understand the set questions.

Here's a couple other questions that he wrote:

  1. What criteria this covers? Write a pseudo that display a triangle. The shape given below:

           *
    
       *   *   *
    
    *  *   *   *  *  
    
  2. Write a pseudo code that perform basic operations addition and subtraction on two matrices A and B. Both matrices have dimensions 2 x 2.

I've completed these tasks, but I need to understand what is meant by the initial task He wrote (in bold).

Here's the criteria that the question is meant to reach:

        *Relations: domain, range, Cartesian product, universal relation, empty relation, inverse 
relation, reflexive, symmetric and transitive properties, equivalence relations* -Note: this snippet is a quote from what the lecturer reads to create the tasks.

I have a good understanding of binary, but I cannot see how his question (in bold) relates to the criteria.

If someone could reword the question for me, or give me some insight into the mathematical relations He speaks of; I'd be very appreciative :)

Kind Regards, Josh Thomson

2

There are 2 best solutions below

0
On BEST ANSWER

This is what I ended-up writing...

(by Josh Thomson)

Mathematical Relations in Computing

Computing is reliant upon countless mathematical operations, among which are core numeric systems such as ‘Unary’, ‘Binary’ and ‘Ternary’. These different numeric systems have their own uses in computing, but each share a common difference. The Unary number system has a base count of ‘1’, whereas binary’s base count is equal to ‘2’ and ternary’s base count is equal to ‘3’. Binary is a commonly spoken of system as it’s system is state is directly correlative when compared to electricity. Electricity is either ‘On’ or ‘Off’, which translates to the values ‘1’ and ‘0’ in binary.

If you look at the physical transistors on a processor or the memory locations on a hard disk, you will notice that there’s an array of values that are either on or off depending on their state. Of course, just having a system comprised of binary would be a nightmare; you’d have to manually encode your alphanumeric language into a unique set of patterns to convey a message across. Luckily this has been done for us. -The birth of American Standard Code. Aka ASCII as its latest version is called. This is a system that was developed to convert the binary values to meaningful text visa-versa.

So we’ve discussed the numerical bases of these different systems, but what about operators? …well In programming there are various operators that use these different systems depending on the operation that takes place.

Operation A:

A+=1; or A++; …this is an example of unary operation as it’s only operating on a single value by incrementing it by 1. This is often seen in loops to count the iterations through the loop, the value is increased each time... allowing for the loop to escape when the target value is reached... This is important to prevent a loop from turning 'infinite', which would cause problems with memory or perhaps crash the system if an escape clause is not triggered.

Operation B:

5+5 …this is a binary operation as it has two separate entities being involved in the operation. This will modify the initial value by applying the secondary value to itself ...returning the result of the addition of the two numbers. This is often seen in programming when adapting existing values with other variables or static values..

Operation C:

(4+4==8)? “True”: “False”; …This is a ternary operation as it has 3 entities involved in the operation, the two separate values and also the conditional result of the values in the operation. This will check whether 4 + 4 is equal to 8 or not and return the relative string result (being the third entity in the operation)

Another area of computing that uses a numeric system to create order is the network ‘domain’. This is a numerical value based on a 32 bit binary value. The domain range can be read in normal units as 0.0.0.0 to 255.255.255.255, though only a certain portion of these addresses are deemed usable as they have been set into segregated classes. Each type of class on the world wide web will have a different ratio of networks to hosts. The most common class used for the average End-User is Class C (the 192-223 address range)

1
On

I'm not sure what you personally mean by "binary". Maybe the binary numeral system for the natural numbers?... In any case, here, a binary relation between two sets of objects, say $A$ and $B$, is a collection of pairs $(a_1, b_1), (a_2, b_2), \ldots, (a_m, b_m), \ldots$ (finite or infinite), where every $a_i$ belongs to $A$ and every $b_i$ to $B$. Note that the sets $A$ and $B$ may be indeed different or the same set. Then a unary "relation" would involve just one set $A$, and would be a collection of individual objects $a_1, a_2, \ldots, a_m, \ldots$, whereas a ternary one would involve three sets $A$, $B$, and $C$, and would be a collection of triples $(a_1, b_1, c_1), (a_2, b_2, c_2), \ldots, (a_m, b_m, c_m), \ldots$ Again, note that $A$, $B$, and $C$ may be all different sets or not. You could try to find examples where all the sets are the same, if you find this easier.

Now, it could help for the exercise, especially for the unary case (where the use of the word "relation" is standard enough but surely unfortunate), to think of an $n$-ary "relation" as given by a statement about $n$ objects (each belonging to the corresponding set), which may be true or false. Thus, an example of a $1$-ary relation on the set $\mathbb{N}$ of natural numbers is given by the statement "the number $x$ is even"; substituting every individual object for $x$ you see that $0$ is even, $1$ is not, $2$ is, $3$ is not, and so on, so this would give you the collection $0, 2, 4, 6, 8, \ldots$ Another unary relation, finite this time, would be given by "$x$ is less than $100$". A binary relation for the sets $\mathbb{N}$ and $\mathbb{N}$ is given for example by the statement "the number $x$ is strictly less than $y$"; substituting pairs of numbers for $(x,y)$ you see that $(1,2)$ is in the relation and that $(2,1)$ is not. An example of a ternary relation for the sets $\mathbb{N}$, $\mathbb{N}$ and $\mathbb{N}$, would be given by the statement "$x$ plus $y$ equals $z$"; then $(1,1,2)$ would be related, but $(1,1,1)$ not.

I don't know what you have covered in class already and what would count as a good example for "the role of relations in computing" in your context, but hopefully you will find such in your class notes---or by googling keywords from your class notes with the string "role in computing" included...