The solution works!! But, is it possible to make the code work more dynamically? Like I ask the user to input the values of m and n, and also the sets A and B and display the onto functions for those...
Type: Posts; User: vivek.1993
The solution works!! But, is it possible to make the code work more dynamically? Like I ask the user to input the values of m and n, and also the sets A and B and display the onto functions for those...
Thank you very much for your answer. It was very helpful! :D
Using Loops this is really hard. Just consider all the functions from set A with m=3 to set B n=3. The total number of functions is 3^3 = 27. I require 3 for loops to display all the functions. The...
This is a kind of question where if you know the solution you can validate whether it is a function or not. It is quite difficult to 'display' the functions. The solution is derived by exclusion...
Actually the number of solutions is given by
for(k=0; k<n; k++)
x = x + pow(-1,k) * comb(n,n-k) * pow(n-k,m);
The order of printing doesn't matter.
If the number of functions is high, I need to display only some functions and say in a similar way there are ____ other functions.
Can u help me in displaying the functions for the sets I have given...
Displaying the number of functions is easy. I have already done it. The problem is displaying all of them. I need sample code to at least display the functions for the example I gave in the main...
I'm actually doing my 2nd year Bachelor of Engineering Course in Computer Science. Yes, I have taken an introductory course on C as well as Data Structures with C and yes, I have tried solving this...
I have to write a C program (for my Discrete Mathematics assignment) that finds the number of onto functions from set A (|A| = m) to set B (|B|=n) and to display all those functions. I wrote the...