Question

If A = {12, 8, 7, 6} and B = {4, 3, 2} is there a...

If A = {12, 8, 7, 6} and B = {4, 3, 2} is there a surjection from A to B (yes or no)?

If A = {12, 8, 7, 6} and B = {4, 3, 2} is there an injection from A to B (yes or no)?

Define an injection from Z to N in Python or C++.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Let F : X->Y be a function.Then function F is injective if distinct elements of X are mapped to distinct elements of Y.

or we can say, if F(x1)=F(x2), then x1=x2.

Let F : X->Y be a function.Then F is surjective if every element of Y is the image of at least one element of X i.e. image(F)=Y.

Given:

A={12,8,7,6} and B={4,3,2}, So according to definition of surjection we can say that yes, there is a surjection from A to B. But there is not injection from A to B.

Following is an injection from Z to N defined in C++.

Let's assume that elements of Z are z1,z2,z3.......,zn and elements of N are n1,n2,n3,..........,nn. and Z[i] denotes the ith element of Z and N[i] denotes the ith element of N. F is some function that return some function value after calculaton.

So, according to the definition of injection, C++ definition is as follow:

int F(int x){
/*
....  
  
*/
return func_value;
//returning some function value.
}
void define_injecton(int Z[],int N){
int n1=Z.size();
int n2=N.size();
int i,j;
bool flag=true;
for(i=1;i<=n1;i++){

for(j=1;j<=n2;j++){

if(F(Z[i])==F(N[j]&&Z[i]!=N[j]){ //condition of injection is false.
flag=false;
return flag;
//returning false.
break;
}
}
}
return flag;
}

Add a comment
Know the answer?
Add Answer to:
If A = {12, 8, 7, 6} and B = {4, 3, 2} is there a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In Preview Activity 2 from Section 6.1 , we introduced the birthday func- tion. Is the birthday f...

    In Preview Activity 2 from Section 6.1 , we introduced the birthday func- tion. Is the birthday function an injection? Is it a surjection? Justify your conclusions. 8. (a) Let f :Z × Z → Z be defined by fm, n) = 2m + n. Is the function f an injection? Is the function f a surjection? Justify your conclusions. 6m+3n. Is the function g (b) Let g:ZxZ-Zbe defined by g(m.n an injection? Is the function g a surjection? Justify...

  • 7 8 4 5 6 23 -3 -2-1 12-11-10-0 -8-7-6 -5-4 -2 -3 + function that matches the given graph. If needed, you can enter...

    7 8 4 5 6 23 -3 -2-1 12-11-10-0 -8-7-6 -5-4 -2 -3 + function that matches the given graph. If needed, you can enter 3.1416... as pi' in your answer, otherwise use at least 3 decimal digits. The curve above is the graph of a sinusoidal function. It goes through the points (-8,0) and (2, 0). Find a sinusoidal Preview f(z)= Get help: Video License 7 8 4 5 6 23 -3 -2-1 12-11-10-0 -8-7-6 -5-4 -2 -3 +...

  • Python Question: In [76]: arr3d = np.array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10,...

    Python Question: In [76]: arr3d = np.array([[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]) In [77]: arr3d Out[77]: array([[[ 1, 2, 3], [ 4, 5, 6]], [[ 7, 8, 9], [10, 11, 12]]]) In [78]: arr3d[0] Out[78]: array([[1, 2, 3], [4, 5, 6]]) Can someone tell me why arr3d[0] is a  2 × 3 array?

  • 1 2 3 4 5 6 7 Question 6 of 8 (1 point) Attempt 2 of...

    1 2 3 4 5 6 7 Question 6 of 8 (1 point) Attempt 2 of Unlimited 6.2 Section Exercise sample of size 7 will be drawn from a normal population with mean 63 and standard deviation 15. Use the TI-84 Plus calculator. a) Is it appropriate to use the normal distribution to find probabilities for x? (b) Find the probability that I will be between 53 and 73. Round the answer to at least four decimal places. (e) Find...

  • Q1 lf S-(Q 1, 2, 3, 4, 5, 6, 7, 8, 9} and A-|0, 2, 4,...

    Q1 lf S-(Q 1, 2, 3, 4, 5, 6, 7, 8, 9} and A-|0, 2, 4, 6, 8], B (1, 3, 5, 7, 9), C (2, 3, 4, 5), and D [1,6,7], list the elements of the sets corresponding to the following events: (a) A U C; (b) An B; (d) (C' n D) U B; (e) (s n c)' (f) Anc n D'.

  • 4+ 2 1 ༡ པོ 12 -11 00 -9 -8 -7 -6 -5 -4 -3 -2...

    4+ 2 1 ༡ པོ 12 -11 00 -9 -8 -7 -6 -5 -4 -3 -2 -l 2 3 4 5 6 7 8 -2 -4 -3 ༢ The curve above is the graph of a sinusoidal function. It goes through the points ( - 8, - 3) and (2, - 3) Find a sinusoidal function that matches the given graph. If needed, you can enter T=3.1416... as 'pi' in your answer, otherwise use at least 3 decimal digits. ༼(c)...

  • Given the following sets: S = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10},...

    Given the following sets: S = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, Even numbers A = {2, 4, 6, 8, 10}; Odd number B = {3, 5, 7, 9}; Natural numbers N = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} and Prime numbers C = {2, 3, 5, 7} Find the following: a) A ∪ C b) A ∩ N c) A ’ d) B ∩ N e) B ∪ N f) C...

  • #10 Answer in units of T. 6. B = 12-3-k) 7. B = 120-k) 8. B...

    #10 Answer in units of T. 6. B = 12-3-k) 7. B = 120-k) 8. B = 120+k) 9. B =-; 10. B =- 007 (part 2 of 2) 10.0 points For given values of È and B, there exists a critical speed such that the electrons may move along the +a direction undeflected. If the speed of the electron is less than the criti- cal speed, along which direction will the elec trons be deflected? 1. = 30+) 009...

  • .2 6 9 3 8 3 2 1 5 5 4 9 9 9 4 5 7 5 4 7 82445538955922245 5 3 4 3 2 5 3 2 4 3 2 2 4 3 2 3 2 2 2 ...

    ***(unable to provide data except by using pictures) .2 6 9 3 8 3 2 1 5 5 4 9 9 9 4 5 7 5 4 7 82445538955922245 5 3 4 3 2 5 3 2 4 3 2 2 4 3 2 3 2 2 2 1 2 2 4 2 2 2 1 3 3 3 12 233 7 8 2 8 3 1 12111 2-21 1 382015785685 7 599231958 0 2 2 5 782 2990957503 1...

  • Part S: Compate fer each set of fractions 2 4 6 1 8+12- 2+7- 3 5...

    Part S: Compate fer each set of fractions 2 4 6 1 8+12- 2+7- 3 5 7 10-5-1 4 2 3 1 9 3 10 5- 7 2 3 3 5 3- 8 5- Part 6: Add and subtract the signed numbers. 8+18-(-3) -5-(-17) 42+ (-4) -12-(+26) 3+(-29)+ (-11) 0-(-16) +7 15-4+(-18) -54 +34 8+((41-(-17) -17-(-3+-1) 5-(16+-2) -33+(-5-6) Part 7: Multiply and divide the signed numbers (-4X-5)(20) (-2)(-7)-4) 13(-3)X2) 12+-3 -26/-13 (3(4X-1) -35+5 -84/-2 (11-3)3 6/3-2 (4 8)-1 (-30/10) -7

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT