<< Chapter < Page Chapter >> Page >

The next two exercises aren't meant to be difficult, but rather to illustrate that, while we've sketched these twoapproaches and suggested they are equivalent, we still need an exact definition.

For the indicator function f x y y x 2 on the domain of (pairs of) natural numbers, write down the set-of-pairs representationfor the corresponding binary relation. It's insightful to give the answer both by listing the elements,possibly with ellipses, and also by using set-builder notation.

In general , for a binary indicator function f , what, exactly, is the corresponding set?

0 0 1 1 2 4 3 9 i i 2 In set-builder notation, this is x y y x 2

In general, for an indicator function f , the correspondingset would be x y f x y (Note that we don't need to write

f x y
; as computer scientists comfortable with Booleansas values, we see this is redundant.)

Got questions? Get instant answers now!

For the relation hasPirate K T R U E on the set of (individual) WaterWorld locations, write down the indicator-function representationfor the corresponding unary relation. In general , how would you write down this translation?

f hasPirate x x K x T x R x U x E .

In general, for a (unary) relation R , f R x x R x R .

Got questions? Get instant answers now!

Since these two formulations of a relation, sets and indicator functions,are so close, we'll often switch between them (a very slight abuse of terminology).

Think about when you write a program that uses the abstract data type Set . Its main operation is elementOf . When might you use an explicit enumeration to encode a set,and when an indicator function? Which would you use for the set of WaterWorld locations?Which for the set of prime numbers?

Functions as relations

Some binary relations have a special property: each element of the domain occurs as the first itemin exactly one tuple. For example, isPlanet Earth Venus Sol Ceres Mars is actually a (unary) function. On the other hand, isTheSquareOf 0 0 1 1 1 -1 4 2 4 -2 9 3 9 -3 is not a function, for two reasons. First, some numbers occur as the first element of multiple pairs. Second, some numbers, like 3 , occurs as the first element of no pairs.

We can generalize this to relations of higher arity, also. This is explored in this exercise and this one .

Binary relations

One subclass of relations are common enough to merit some special discussion: binary relations. These are relations on pairs, like nhbr .

Binary relation notation

Although we introduced relations with prefix notation, e.g., < i j , we'll use the more common infix notation, i j , for well-known arithmetic binary relations.

Binary relations as graphs

In fact, binary relations are common enough that sometimes people use some entirely new vocabulary:A domain with a binary relation can be called vertices with edges between them. Together this is known as a graph . We won't stress these terms right now,as we're not studying graph theory.

Binary relations (graphs) can be depicted visually, by drawing the domain elements (vertices) as dots,and drawing arrows (edges) between related elements.

A binary relation with a whole website devoted to it is

has starred in a movie with
. We'll call this relation hasStarredWith over the domain of actors. Some sample points in this relation:
  • hasStarredWith Ewan McGregor Cameron Diaz , as witnessed by the movie A Life Less Ordinary , 1997.
  • hasStarredWith Cameron Diaz John Cusack , as witnessed by the movie Being John Malkovich , 1999.
You can think of each actor being a
, and two actors being
to each other if they have ever starred in a movie together;two of these locations, even if not adjacent might have a multi-step path between them.(There is also a shorter path; can you think of it?The (in)famous Kevin Bacon game asks to find a shortest path from one location to thelocation Kevin Bacon. Make a guess, as to the longest shortest path leading from(some obscure) location to Kevin Bacon.)

Some other graphs:

  • Vertices can be tasks, with edges meaning dependencies of what must be done first.
  • In parallel processing, Vertices can be lines of code;there is an edge between two lines if they involve common variables.Finding subsets of vertices with no lines between them represent sets of instructions that can beexecuted in parallel (and thus assigned to different processors.)
  • Word ladders
    seek to transform one word to another by changing one letter at a time, while always remaining a word.For example, a ladder leading from WHITE to SPINE in three steps is:
    • WHITE
    • WHINE
    • SHINE
    • SPINE
    If a solution to such a puzzle corresponds to a path, what do vertices represent?What are edges? Do you think there is a path from any 5-letter word to another?

Questions & Answers

What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
sciencedirect big data base
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
so some one know about replacing silicon atom with phosphorous in semiconductors device?
s. Reply
Yeah, it is a pain to say the least. You basically have to heat the substarte up to around 1000 degrees celcius then pass phosphene gas over top of it, which is explosive and toxic by the way, under very low pressure.
Do you know which machine is used to that process?
how to fabricate graphene ink ?
for screen printed electrodes ?
What is lattice structure?
s. Reply
of graphene you mean?
or in general
in general
Graphene has a hexagonal structure
On having this app for quite a bit time, Haven't realised there's a chat room in it.
what is biological synthesis of nanoparticles
Sanket Reply
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Intro to logic. OpenStax CNX. Jan 29, 2008 Download for free at http://cnx.org/content/col10154/1.20
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Intro to logic' conversation and receive update notifications?