• Tidak ada hasil yang ditemukan

Chapter at a Glance

Dalam dokumen Untitled - Digital Library Univ STEKOM (Halaman 94-98)

Definition 2.56 Algorithm)

2.6 Chapter at a Glance

Booleans, Numbers, and Arithmetic

ABoolean valueis True or False. TheintegersZare{. . . ,3,2,−1, 0, 1, 2, 3, . . .}. The realnumbersRare the integers and all numbers in between. Theclosed interval[a,b]

consists of all real numbersxwhereaxb; theopen interval(a,b) excludesaandb.

TherationalnumbersQare those numbers that can be represented asa/bfor integersa andb6= 0. Here is some useful notation involving numbers:

exponentiation:bkisb·b· · · · ·b, wherebis multipliedktimes;

logarithms: logbxis the numberysuch thatby=x;

absolute value:|x|isxforx≥0, and|x|=−xforx<0;

floorandceiling:⌊x⌋is the largest integernx;⌈x⌉is the smallest integernx;

modulus:nmodkis the remainder whennis divided byk.

Ifnmodd= 0, thendis afactorofnorevenly divides n, writtend|n. If 2|nfor a positive integern, thenniseven(“has evenparity”); otherwisenisodd. An integern ≥ 2 is primeif it has no positive integer factors other than 1 andn; otherwiseniscomposite.

(Note that 0 and 1 are neither prime nor composite.)

For a collection of numbersx1,x2, . . . ,xn, their sumx1+x2+· · ·+xnis written formally as∑ni=1xi, and their productx1·x2· · · · ·xnis written∏ni=1xi.

Sets: Unordered Collections

Asetis an unordered collection of objects calledelements. A set can be specified by listing its elements inside braces, as{x1,x2, . . . ,xn}. A set can also be denoted by {x:P(x)}, which contains all objectsxsuch thatP(x) is true. The set of possible val- uesxthat are considered is theuniverse U, which is sometimes left implicit.

Standard sets include theempty set{}(also written∅), which contains no elements;

theintegersZ; thereal numbersR; and thebooleans{True, False}. We writeZ0 = {0, 1, 2, . . .}andZ<0 = {−1,2, . . .}, etc. For a setAand an objectx, the expression xA(“xis inA”) is true wheneverxis in the setA. (Soy ∈ {x:P(x)}whenever P(y) = True, andy ∈ {x1,x2. . . ,xn}wheneverxi =yfor somei.) Thecardinalityof a set A, written|A|, is the number of distinct elements inA.

Given two setsAandB, theunionofAandBisAB = {x:xAorxB}. The intersectionofAandBisAB = {x:xAandxB}. Theset differenceofAand BisAB = {x:xAandx/B}. Thecomplementof a setAisA = UA = {x:xUandx6∈A}, whereUis the universe.

Asubsetof a setBis a setAsuch that every element ofAis also an element ofB;

this relationship is denoted byAB. IfAis a subset ofB, thenBis asupersetofA, writtenBA. Aproper subsetofBis a setAthat is a subset ofBbutA 6= B, written AB. Such a setBis aproper supersetofA, writtenBA. Two setsAandBare disjointifAB =. Apartitionof a setSis a collection of setsA1,A2, . . . ,Ak, where A1A2∪ · · · ∪Ak=Sand, for any distinctiandj, the setsAiandAjare disjoint.

Thepower setof a setA, writtenP(A), is the set of all subsets ofA.

Sequences, Vectors, and Matrices: Ordered Collections

Asequence(ortuple,(ordered) pair,triple,quadruple, ...,n-tuple, ...) is an ordered col- lection of objects calledcomponentsorentries, written inside angle brackets. The set A×B={ha,bi:aAandbB}is theCartesian productof setsAandB; the setA×B contains all pairs where the first component comes fromAand the second fromB. For a setSand a numbern0, the setSndenotes then-fold Cartesian product ofSwith itself:Sn=S×S×. . .×S, whereSoccursntimes in this product.

Avector(orn-vector) is an element ofRn, for some positive integern2. (An element ofR1 = Ris called ascalar.) Abit vectoris an element of{0, 1}n. Vectors are sometimes written in square brackets:x = [x1,x2, . . . ,xn]. For a vectorx, writexito denote theith component ofx. (Butxiis meaningless unlessi ∈ {1, 2, . . . ,n}.) Thesize ordimensionalityofxRnisn.

For a vectorxRnand a real numberα∈R, thescalar productαxis a vector where (αx)i = αxi. For two vectorsx,yRn, the sum ofxandyis a vectorx+y, where (x+y)i =xi+yi. Thedot productof two vectorsx,yRnisxy =ni=1xiyi. Bothx+y andxyare meaningless unlessxandyhave the same dimensionality.

M=

M1,1 M1,2 . . . M1,m

M2,1 M2,2 . . . M2,m

... ... ... ... Mn,1 Mn,2 . . . Mn,m

Figure 2.61: A matrix.

Ann-by-m matrix Mis an element of (Rn)m, which is also sometimes writtenRn×m. Such a matrixMhasn rowsandm columns, as in Fig- ure 2.61. A matrixMRn×missquareifn =m. For a sizen, theidentity matrixisIRn×nhas ones on the main diagonal (the entriesIi,i = 1) and zeros everywhere else.

Given a matrixMRn×mand a real numberα∈ R, the matrixαMis specified by (αM)i,jMi,j. Given two matricesM,MRn×m, the matrixM+Mis specified by (M+M)i,j = Mi,j+Mi,j . (The sumM+Mis meaningless ifMandMhave different dimensions.) The product of two matricesARn×mandBRm×pis a matrix ABRn×pwhose components are given by (AB)i,j = ∑mk=1Ai,kBk,j. (More compactly, (AB)i,j = Ai,(1...m)B(1...m),j.) If the number of rows inAis different from the number of columns inBthenABis meaningless. TheinverseofMis a matrixM1such that MM−1=I(if any such matrixM−1exists).

Functions

Afunction f : ABmaps every elementaAto some elementf(a) ∈ B. The domainoff isAand thecodomainisB. Theimageorrangeoff is{f(x) :xA}, the set of elements of the codomain “hit” by some element ofAaccording tof.

Thecompositionof a functionf :ABandg :BCis writtengf :AC, and (gf)(x) = g(f(x)). A functionf :ABisone-to-oneorinjectiveiff(x) =f(y) implies thatx = y. The functionf isontoorsurjectiveif the image is equal to the codomain. If f :ABis one-to-one and onto, it isbijective. For a bijectionf :AB, the function f1:BAis theinverseoff, wheref1(b) =awhenf(a) =b.

Apolynomial p:RRis a functionp(x) =a0+a1x+· · ·+akxk, where eachaiRis acoefficient. Thedegreeofpisk. Therootsofpare{x:p(x) = 0}. A polynomial of degree kthat is not always zero has at mostkdifferent roots.

Analgorithmis a step-by-step procedure that transforms an input into an output.

Key Terms and Results

Key Terms

Booleans, Numbers, Arithmetic

• booleans, integers, reals, rationals

• open intervals, closed intervals

• absolute value|x|, floorx, ceilingx

• exponentiation, logarithms

• modulus, remainder, divides

• even, odd, prime, parity

• summation∑, product∏

• nested summations, nested products Sets

• set, element, membership, cardinality

• exhaustive enumeration

• set abstraction, universe

• the empty set∅={}

• Venn diagram

• complement∼, union∪, intersection∩

• set difference−

• (proper) subset, (proper) superset

• disjoint sets

• partitions

• power set

Sequences, Vectors, Matrices

• sequence, list, ordered pair,n-tuple

• Cartesian product

• vector, dot product

• matrix, identity matrix

• matrix multiplication

• matrix inverse Functions

• domain, codomain, image/range

• function composition

• one-to-one, onto functions

• bijection, inverse

• polynomial, degree, roots

• algorithm

Key Results

Booleans, Numbers, and Arithmetic

1. The value ofbnisb·b· · ·b, multiplied togetherntimes. If n<0, thenbn= 1/(bn). For rational exponents,b1/mis the numberxsuch thatxm=b, andbn/m= (b1/m)n. 2. For a positive real numberb6= 1 and a real numberx>0,

the quantity logbx(the log basebofx) is the real number ysuch thatby=x.

3. Consider integersk>0 andn. Thenk|n(“kdividesn”) if

nk is an integer—or, equivalently, ifnmodk= 0.

4. As long as the terms being added remain unchanged, we can reindex a summation (for example, shifting the variable over which the sum is taken, or reversing the order of nested sums) without affecting the total value of the sum. The same is true for products.

Sets: Unordered Collections

1. A set can be specified using exhaustive enumeration (a list of its elements), or by abstraction (a condition describing when an object is an element of the set).

2. Two setsSandTare equal if every element ofSis an element ofTand every element ofTis an element ofS.

Sequences, Vectors, and Matrices

1. For vectorsx,yRn, thedot productofxandyis xy=∑ni=1xiyi.

2. The productABof two matricesARn×mandBRm×p is ann-by-pmatrixMRn×pwhose components are given byMi,j=∑mk=1Ai,kBk,j.

Functions

1. A one-to-one and onto functionf :ABhas an inverse functionf1:BA, wheref(a) =bprecisely when f1(b) =a.

2. A polynomial of degreekthat is not always zero has at mostkdifferent roots.

Logic

In which our heroes move carefully through the marsh, making sure that

each step follows safely from the one before it.

Dalam dokumen Untitled - Digital Library Univ STEKOM (Halaman 94-98)