TA: Jade Cheng ICS 241 Recitation Lecture Note #5 September 25, 2009 Recitation #5 Let be the following relation defined on the set,,, :,,,,,,,,,,,,,,,,,,,,,. Determine whether is [Chapter 8.1 Review] a. Reflexive is reflexive because contains,,,,,, and,. b. symmetric is not symmetric because,, but,. c. antisymmetric is not antisymmetric because,, and,,.but. d. transitive is not transitive because, for example,, and,, but,. Let be the following relation on the set of real numbers: Determine whether is [Chapter 8.1 Review] a. Reflexive, where is the loor of. is reflexive because is true from all real numbers.
b. symmetric is symmetric suppose ; then. c. antisymmetric is not antisymmetric: we can have and for distinct and. For example, 1.1 1.2. d. transitive is transitive, suppose and ; from transitivity of equality of real numbers, it follows that. Answer the following questions regarding this Flight Table: [Chapter 8.2 Review] Airline Flight_number Gate Destination Departure_time N 122 34 Detroit 08:10 A 221 22 Denver 08:17 A 122 33 Anchorage 08:22 A 323 34 Honolulu 08:30 N 199 13 Detroit 08:47 A 222 22 Denver 09:10 N 322 34 Detroit 09:44 a. Assuming that no new -tuples are added, find a composite key with two fields containing the Airline field for the database in the Flight Table. Airline and Flight_number; Airline and Departure_time b. What do you obtain when you apply the selection operator, where is the condition Destination = Detroit, to the data base in the Flight Table. (N, 122, 34, Detroit, 08:10), (N, 199, 13, Detroit, 08:47), (N, 322, 34, Detroit, 09:44). c. What do you obtain when you apply the selection operator, where is the condition (Airline = N) (Destination = Denver), to the data base in the Flight Table. (N, 122, 34, Detroit, 08:10), (N, 199, 13, Detroit, 08:47), (N, 322, 34, Detroit, 09:44), (A, 221, 22, Denver, 08:17), (A, 222, 22, Denver, 09:10).
d. Display the table produced by applying the projection, to the Flight Table. Airline Destination N Detroit A Denver A Anchorage A Honolulu N Detroit A Denver N Detroit Show that if and are conditions that elements of the -ary relation may satisfy, then. [Chapter 8.2 Review] Both sides of this equation pick out the subset of consisting of those -tuples satisfying both conditions and.,,. Give an example to show that if and are both -ary relations, then,, may be different from,,,,. [Chapter 8.2 Review] Let set be the -tuple relation below: Airline Flight_number Gate Destination Departure_time N 122 34 Detroit 08:10 A 221 22 Denver 08:17 A 122 33 Anchorage 08:22 A 323 34 Honolulu 08:30 Let set be the -tuple relation below: Airline Flight_number Gate Destination Departure_time A 221 22 Denver 08:17 A 122 33 Anchorage 08:22 A 323 34 Honolulu 08:30 N 199 13 Detroit 08:47 A 222 22 Denver 09:10 N 322 34 Detroit 09:44
By definition contains the set elements that are in but not in. So is as below: Airline Flight_number Gate Destination Departure_time N 122 34 Detroit 08:10 Let 1, We obtain the following relationship regarding,, and,,,, :,, N.,,,, N, A N, A. N,,,,,,. Represent each of these relations on 1, 2, 3 with a matrix (with the elements of this set listed in increasing order) [Chapter 8.3 Review] a. 1, 1, 1, 2, 1, 3 0 0 0. 0 0 0 b. 1, 2, 2, 1, 2, 2, 3, 3 1 1 0. 0 0 1 c. 1, 1, 1, 2, 1, 3, 2, 2, 2, 3, 3, 3 0 1 1. 0 0 1
List the ordered pairs in the relations on 1, 2, 3 corresponding to these matrices (where the rows and columns correspond to the integers listed in increasing order). [Chapter 8.3 Review] 1 0 1 a. 1 0 1 1, 1, 1, 3, 2, 2, 3, 1, 3, 3. b. 1, 2, 2, 2, 3, 2. c. 1 0 1 1, 1, 2, 2, 1, 3 2, 1 2, 3 3, 1 3, 2 3, 3. Determine whether the relations represented by the matrices in the previous Question are reflexive, irreflexive, symmetric, antisymmetric. [Chapter 8.3 Review] The matrix representing a reflexive relation has 1 s for all its main diagonal entries such as: 1??? 1?.?? 1 The matrix representing a irreflexive relation has 0 s for all its main diagonal entries such as 0??? 0?.?? 0 The matrix representing a symmetric relation has a symmetric 1 s and 0 s layout according to its main diagonal, such as?? 0?? 1. 0 1? The matrix representing an antisymmetric relation has all 1 s having 0 s as the counterpart according to its main diagonal, such as? 1 0 0? 0. 0 1?
1 0 1 So it s clear is reflexive, and symmetric, is antisymmetric, 1 0 1 is 1 0 1 symmetric. Let be the relation represented by the matrix: [Chapter 8.3 Review] 0 0 1 1 1 0 Find the matrices that represent,, and. 0 0 1 0 0 1. 0 0 1 1 1 0. 1 1 0 1 1 0 0 1 1 0 1 0 1 1 0. 0 0 1 1 1 0. 0 0 1 0 1 1. 1 1 0 0 1 0 1 1 0 0 1 1. 0 0 1 0 1 1. 0 0 1. 1 1 0 1 1 0 Some Problems that appeared in HW#2 and E1 Find the number of solutions of the equation 17, where, 1, 2, 3, 4, are nonnegative integers such that 3, 4, 5, and 8. [Chapter 7.6 Review] To apply the principle of inclusion-exclusion, let a solution have property if 3, property if 4, property if 5, and property if 8. The number of solutions satisfying the inequalities 3, 4, 5 and 8 is
. total number of solutions 4 17 1, 17 1140 number of solutions with 3 4 13 1, 13 560 total number of solutions 4 4 12 1, 12 455 total number of solutions 5 4 11 1, 11 364 total number of solutions 8 4 8 1, 8 165 total number of solutions 3 and 4 4 8 1, 8 165 total number of solutions 3 and 5 4 7 1, 7 120 total number of solutions 3 and 8 4 4 1, 4 35 total number of solutions 4 and 5 4 6 1, 6 84 total number of solutions 4 and 8 4 3 1, 3 20 total number of solutions 5 and 8 4 2 1, 2 10 total number of solutions 3, 4, 5 4 2 1, 2 10 total number of solutions 3, 4, 8 0 total number of solutions 3, 5, 8 0 total number of solutions 4, 5, 8 0 total number of solutions 3, 4, 5, 8 0 Inserting these quantities into the formula for shows that the number of solutions with that 3, 4, 5, and 8 equals: 1140 560 455 364 165 165 120 35 84 20 10 10 0 0 0 0 20. Determine which of these are linear homogeneous recurrence relations with constant coefficients. Also, find the degree of those that are. [Chapter 7.2] a. 3 Linear, homogeneous, with constant coefficients, degree 2. b. 3 Linear, with constant coefficients but not homogeneous.
c. not Linear. d. 2 Linear, homogeneous, with constant coefficients, degree 3. e. / Linear, homogeneous, but not with constant coefficients. f. 3 Linear, with constant coefficients, but not homogeneous. g. 4 5 9 Linear, homogeneous, with constant coefficients, degree 7. Solve the recurrence relation 2 2 with initial condition 4. [Chapter 7.2 Review] The characteristic equation for the associated homogeneous recurrence relation is 2 0. So it has solutions 2 Therefore the general solution to the associated homogeneous recurrence relation is: 2. To obtain a particular solution to the given recurrence relation, try obtaining:, 2 1 2 1 2 2 2 4 2 2 0
The coefficient of, terms and the constant term must each equal 0. Therefore, we have 2 0 4 0 2 2 0 Hence, we have 2 8 and 12. Therefore: 2 2 8 12. The initial condition 4, yields the system of equations coefficient: 2 2 1 8 1 12 4 13. The coefficient is found to be 13. Therefore the solution to the given recurrence relation is: 13 2 2 8 12.