Homework-3-3

docx

School

J Sargeant Reynolds Community College *

*We aren’t endorsed by this school

Course

205

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

9

Uploaded by BaronTreeViper20

Report
CSC-208 Home Work 3 1. What is a function from X to Y? A function from set X to set Y is a rule that associates each element in X with exactly one element in Y. 2. Define a one-to-one function. Give an example of a one-to-one function. Explain how to use an arrow diagram to determine whether a function is one-to-one. A one-to-one function assigns unique outputs to distinct inputs. For example, f(x) = 3x is a one-to-one function. In an arrow diagram, if no two arrows point to the same element in the codomain, it's one-to-one. 3. Define an onto function. Give an example of a onto function. Explain how to use an arrow diagram to determine whether a function is onto. An onto function covers the entire codomain with its range. For example, the function h(x) = 2x, with the domain and codomain being real numbers, is onto. In an arrow diagram, if every element in the codomain has at least one arrow pointing to it, it's onto.
4. Determine if function f x ( ) = 3 x 2 - 3 x + 1 is one-to-one, onto, or both. Give justification for your answer. The function f(x) = 3x^2 - 3x + 1 is not one-to-one because it's a quadratic function, and quadratic functions are generally not one-to-one. For example, when you expand f(x), you'll get two solutions for x for most values in the codomain, indicating that multiple inputs can map to the same output. 5. Prove that if n is an odd integer then n 2 4 ê ë ê ú û ú = n - 1 2 æ è ç ö ø ÷ n + 1 2 æ è ç ö ø ÷ . Right side of equation {n - 1/2}{n + 1/2} = (2k + 1 - 1/2)(2k + 1 + 1/2) = (2k + 1/2)(2k + 2/2) = (2k + 1/2)(2k + 1) = 4k^2 + 2k + k + 1/2 = 4k^2 + 3k + ½ Left side of equation [n^2/4] = [(2k + 1)^2/4] = (4k^2 + 4k + 1)/4
= 4k^2/4 + 4k/4 + 1/4 = k^2 + k + 1/4 Right side: 4k^2 + 3k + ½ Left side: k^2 + k + 1/4 both sides are not equal. So, it seems that the statement is not true when n is an odd integer. 6. Define sequence. A sequence is an ordered list of objects, typically numbers, arranged according to a specific rule or pattern. 7. Define decreasing sequence. A decreasing sequence is a sequence in which each term is smaller than or equal to the preceding term. 8. Define non-decreasing sequence. A non-decreasing sequence is a sequence in which each term is greater than or equal to the preceding term. 9. If X is a finite set what is X * ? If X is a finite set, then X* represents the set of all finite sequences made up of elements from X, including the empty sequence. 10. If X is a finite set what is X + ? If X is a finite set, then X+ represents the set of all non-empty finite sequences made up of elements from X. It excludes the empty sequence.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
11. Given t n = 3 n - 2 a. Find t 7 t 7=3 7−2=21−2=19 t7=19 b. Find t 100 t 100=3 100−2=300−2=298 t 100=298 c. Find t i i = 1 3 å t 1 ∣∣ t =1=3 1−2=3−2=1 t 1 t =2=3 2−2=6−2=4 t 1 ∣∣ t =2=3 2−2=6−2=4 t 1 t =3=3 3−2=9−2=7 t 1 ∣∣ t =3=3 3−2=9−2=7 Σ t =13 t 1=1+4+7=12 Σ t =13 t 1 is equal to 12. d. t i i = 3 7 Õ t 1 ∣∣ i =3=3 3−2=9−2=7 t 1 t =4=3 4−2=12−2=10 t 1 ∣∣ i =4=3 4−2=12−2=10 t 1 t =5=3 5−2=15−2=13 t 1 ∣∣ i =5=3 5−2=15−2=13 t 1 t =6=3 6−2=18−2=16 t 1 ∣∣ i =6=3 6−2=18−2=16 t 1 t =7=3 7−2=21−2=19 t 1 ∣∣ i =7=3 7−2=21−2=19 i =37 t 1=7 10 13 16 19
12. A relation R on a set X={1, 2, 3, 4, 5} defined by the rule ( x, y ) ÎR if 3 divides x-y. List the elements of R and the elements of R 1 . 1. (1, 1): 3 divides (1 - 1) = 0, so (1, 1) is in R. 2. (2, 2): 3 divides (2 - 2) = 0, so (2, 2) is in R. 3. (3, 3): 3 divides (3 - 3) = 0, so (3, 3) is in R. 4. (4, 4): 3 divides (4 - 4) = 0, so (4, 4) is in R. 5. (5, 5): 3 divides (5 - 5) = 0, so (5, 5) is in R. The elements of R and its inverse, R ¹, are the same in this case because all pairs in R satisfy the rule, and the inverse of a relation contains the same pairs as the original relation. 13. Given R={(1,1), (2,2), (3,3), (4,4), (5,5), (1,3) , (3,1) } is a relation on the set X={1,2,3,4,5}. Determine if R is and equivalence relation. Show your work. If you decide R is an equivalence relation then list the equivalence classes. R is an equivalence relation because it satisfies the properties of reflexivity and symmetry. The equivalence classes are [1] = {1}, [2] = {2}, [3] = {3}, [4] = {4}, [5] = {5}, and [1, 3] = {1, 3}.
14. Find the matrix of the relation R={(1,2),(2,3),(3,4),(4,5)} on the set X={1, 2, 3, 4, 5}; Ordering of X:1,2,3,4,5 The matrix for the relation R={(1,2),(2,3),(3,4),(4,5)} on the set X={1, 2, 3, 4, 5} with the ordering 1,2,3,4,5 is: 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 15. Write the matrix for the relation R = { ( x, y ) | x < y } With ordering of X:1,2,3,4 . The matrix for the relation r ={( x , y ) x < y } R ={( x , y ) x < y } on the set X ={1,2,3,4} X ={1,2,3,4} with the given ordering is: 0 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0 16. For the following matrix describes a relation on the set X={1,2,3,4} with ordering of X:1,2,3,4. Write the set form of the relation. ( 1 0 1 0 0 0 0 0 1 0 1 0 0 0 0 1 )
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
R ={(1,2),(1,4),(3,2),(3,4),(4,4)} 17. How can we quickly determine whether a relation is R is antisymetric by examining the matrix of R relative to some ordering? Look at the main diagonal (where x and y are the same). If any diagonal entry is 1, the relation is not antisymmetric.
18. Given two relations R 1 = { ( 1 ,x ) , ( 1 , y ) , ( 2 , x ) , ( 3 , x ) } and R 2 = { ( x ,b ) , ( y,b ) , ( y ,a ) , ( y ,c ) } with orderings 1,2,3;x,y;abc Answering the following questions. a. Find the matrix A 1 of relation R 1 relative to the orderings. The matrix A for relation R relative to the orderings is: A = | 0 1 | | 1 1 | b. Find the matrix A 2 of relation R 2 relative to the orderings. The matrix A for relation R relative to the orderings is: A = | 0 1 0 | | 1 1 1 | | 0 0 0 | c. Find the matrix product A 1 A 2 . The matrix product A A is: A A = | 1 1 0 | | 2 2 1 | d. Use the result of part c to find the matrix of the relation R 2 1 ¿ ¿ . The matrix of the relation R R is the result from part c: ₂◦ ₁ R R = | 1 1 0 | ₂◦ ₁ | 2 2 1 |
e. Use the result in part d to find the relation of R 2 1 ¿ ¿ as a set of ordered pairs. The relation R R as a set of ordered pairs is: ₂◦ ₁ R R = {(1, x), (1, y), (2, x), (2, y), (2, a)} ₂◦ ₁
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help