Once again I need help with a program in C... How do I make the prog output for given 'n' and 'k' all k-element subsets of set 'n'.\nfor example for n=3 k=2 it would write those subsets: 0,1; 0,2; 1,2 (let's think of set n as a set of natural numbers starting with 0 and ending with n-1)\nThere are two ways (I think) - either use of recursive functions or without recursive functions...\nI would prefer the solution without use of recursion... (the ones with are welcome as well...)
209442
binary generation or backtracking techniques
511991
Start out by letting (x,y) be a point in AnB.  As it is in AnB, it must be in A.  So, x=>0 and y=>x. [We've gotten the x=>0 part, now we just need the x=y bit.]  (x,y) is also in B, so x=>y.  Now we have that y=>x and x=>y.  The only way that is possible is for x=y.\n\nQED
465717
Hello dear Asker ;\n\n{ as you know ;\nP(n , r) = n! / ( n –  r )! }...\n\nso ;\n\nP (5 , 3) = 5! / ( 5 – 3)! \n=5! / 2! \n= (5 * 4 * 3 * 2 * 1) / (2 * 1) \n= 120 / 2 \n= 60 \nTotally We cane make 60 words with out any repetition\n\nGood Luck dear
472661
Try tracing a very small example on paper to gain some insight into this.  Perhaps just two or three elements with at least two equal keys.  Then reverse the order of the two equal keys in the input set, and see if you still get the same result.  Tracing the algorithm like this will get you the answer in a manner that should give you some confidence.
332197
I'm not sure if you mean from the set of {a,b,c,d,e} or all letters:\n\nIf only from the set {a,b,c,d,e}:\n\nIn the first case, you have 5 choices for the first letter, 4 choices for the second letter and 3 choices for the third.  The reason you have less choices is that you have already used a letter or two.\n\nStated as permutations this is:\nP(5,3) = 5 x 4 x 3 = 60 permutations.\n\nFor the second case, this is a simple permutation.  You have 5 choices for the first letter, 5 for the second and 5 for the third.  \n\n5^3 = 5 x 5 x 5 = 125 permutations.\n\nIf you mean for all letters of the alphabet:\n\nIn the first case, you have 26 choices for the first letter, 25 choices for the second letter and 24 choices for the third.\n\nStated as permutations this is:\nP(26,3) = 26 x 25 x 24 = 15,600 permutations.\n\nFor the second case, you have 26 choices for the first letter, 26 for the second and 26 for the third.  \n\n26^3 = 26 x 26 x 26 = 17,576 permutations.
268718
A subgroup H is generated by a set S if H is the smallest subgroup that contains S. This will mean that every element of H can be written as a finite product of elements of S and their inverses.\n\nIn your case, H will consist of {1, (12), (34), (12)(34)}. No other products are possible with (12) and (34) along with their inverses. \n\nTo show that H is normal in G, you need to show that xHx^-1=H for all x in G. Consider \n\nK={x in G:xHx^-1=H}.\n\nShow this *is* a subgroup of G (easy) and then show that K contains (12), (34), and (13)(24). If you do this, K will have to contain G and hence will equal G. \n\nTo show [G:H]=2, just notice that (12) and (34) are already in H and that the square of (13)(24) is in H. This will show there are two cosets of H in G. The rest follows.
460915
set is defined as [x1 x2 x3 x4 x5] with x1 being the smallest and x5 being the largest\n\nx1 + x2 = 637\nx1 = 637 - x2\n\nx1 + x3 = 669\n637 - x2 + x3 = 669\nx3 = x2 + 32\n\nx3 + x5 = 1072\nx2 + 32 + x5 = 1072\nx5 = 1040 - x2\n\nx4 + x5 = 1197\nx4 + 1040 - x2 = 1197\nx4 = x2 + 157\n\nx2 + x3 = Y\nx2 + x2 + 32 = Y\n2 x2 = Y - 32\nfor x2 to be an integer, Y must be even, so Y could be 794 or 1040\n\nx2 + x5 = Z\nx2 + 1040 - x2 = Z\n1040 = Z so Y must be 794\n\n2 x2 = 794 - 32\nx2 = 381\n\nx5 = 1040 - x2\nx5 = 1040 - 381\nx5 = 659
494730
The previous result is that the number of elements in the preimage of each element in f(K) (or more generally in f(G)) is n. All those sets are disjoint and their union is K, so the total number of elements in K is n * (Number of elements in f(K)).\n --> |K| is a multiple of |f(K)|\n\nAnother way of looking at is that if N is the kernel of f, f(K) is isomorphic to the quotient group K/N which always divides the order of K.
474343
here is part of solution. the rest figure it out yourself :-).\n\n int nLines = 5;\n \n     for (int i = 1; i <= nLines; i++)\n     { \n \nint nSpaces = i - 1;\n \n         int nAsterisks = 2 * (nLines - i) + 1;\nfor (int j = 1; j <= nSpaces; j++)\n \n    System.out.print(" ");\n \nfor (int j = 1; j <= nAsterisks; j++)\n \n System.out.print("*");\n \nSystem.out.println("");\n }
534428
Clearly, there is only one permutation of the empty set, and 0!=1, so this is true when n=0. Now suppose this is true for some n. Suppose we want to construct a permutation of n+1 elements. We have n+1 choices for the first element, times (by our induction hypothesis) n! ways of permuting the remaining elements, so there are (n+1)*n! or (n+1)! permutations. Thus by induction, there are n! permutations of n elements for all n. Q.E.D.
199348
Proof's are generally about asking yourself the right question, not making a huge intellectual leap.\n\nProve that every subset of a finite set is finite.  What is the right question?  There are a couple interesting questions to ask here:\n1)  Could there exist an infinite set within a finite set, and if so, what would it look like?  \nBecause the infinite set is within the finite set, every set within the infinite set must be within the finite set.  But the finite set is finite ... (proof follows)\n\n2) If you put a set in another set, can you draw a line (make a function) connecting the things in the inner set with the things in the outer set?  \nYes, you can.  All of the elements of the inner set are in the outer set, so you could draw a line from the elements in the set to themselves.  This probably sounds funny, so let me help you with an example:\nyou have 5 apples and 4 oranges.  Invent 2 sets, the set of apples and the set of fruit.  The set of fruit has 9 elements.  Clearly, the set of apples is within the set of fruit.    You could make a connection between the number of apples in the set and the number of fruit -- eg the set of fruit has nine elements and the set of apples has 5, so you could draw a line from an apple in the set of apples to an apple in the set of fruit.  Can you draw this type of line if the apples were infinite and the fruit were not?  To put this another way, if the apples were infinite, then there must be infinite fruit as fruit is an apple (eg, apples are in the set of fruits.)\n\nMathematically (this proof is way more than needed, but for illustration):\n\nsuppose B is an infinite subset of the finite set A with n elements.  Define F to be a function from an element x in B onto itself.  Clearly F is 1-1 as every element in F maps an element in B to itself.  Because B is infinite, for any nth element in F there exists a (n+1)th element in F mapping the n+1 th element in B onto itself.  But B is a subset of A, so there is a n+1 th element in A that maps to itself, contradiction to the fact that A is finite.\n\nPlain text of what I just said:\nB is within A, A is finite, and B is infinite.  If I count up all the terms in B (using the function), I am also counting all the terms in A (because every element in B is also in A).  If there are 5 terms in A, and I start counting B and get to 6 terms, then there must be 6 terms in A.  But then I can get a 7th term in B, so there must be 7 terms in A.  And so on to infinity (induction).  So A must be infinite, which is a contradiction.  So any subset of a finite set cant be infinite.  So it must be finite.
317410
include <stdio.h>\n\nvoid main(){\n   float no;\n   scanf("%f",&no);\n   if(!( ((int)no)%7!=0 || ((int)no)%2==0 )) \n      printf("No is divisible by 7 and not divisible by 2");\n}\n\nsalam
378617
Yes. What's more, K is a normal subgroup of S_4 (the group of all permutations). \nOne has to show that p^(-1)kp is in K for every k in K and every permutation p. Now each k in K is a pair of disjoint transpositions, and K consists of ALL such pairs of swaps (and identity). What happens when p^(-1)kp is applied is that the elements of {1,2,3,4} get "renamed", then arranged in two pairs and swapped within each pair as per k, and finally renamed back. This permutation is just another pair of swaps, so it is in K. \nMore formally, if k = (ij)(mn) then p^(-1)kp = (p(i)p(j)) (p(m)p(n)). The argument is placed on the left, as usual with permutations, so the 1st to apply in p^(-1)kp is p^(-1), then k then p. So p(i) and p(j) are first mapped to i and j, then swapped, and then mapped back to p(j) and p(i). The result is that p(i) and p(j) get swapped. Same with m and n.
643935
i would like to clear natural numbers and whole numbers.\n\nOld practise:\nNatural numbers={1,2,3,4,.......}\nWhole numbers={0,1,2,3,4,......}\nIntergers={....,-3,-2,-1,0,1,2,3,....}\n\nNew practise:\nNatural numbers={0,1,2,3,4,....}\nIntegers={....,-3,-2,-1,0,1,2,3,.....}\nNote: Whole numbers concept is not there.
410953
C.  Statement 1 tells us nothing about set T.  For Statement 2, consider the sums, given that Sm is the median  element of set S and Tm is the median element of set T.  We have 5 Sm  = 7 Tm, but there are obviously numerous values of Sm and Tm that would work other than the trivial case Sm = Tm = 0.  However, Statement 1 excludes all cases except the trivial case, so the bottom line is that both are needed.
210187
Use any recursive algorithm.\n\nFor instance:\n\nf(x) = f(x) + 1
78434
Try this:\n\n#include <stdio.h>\n\nmain()\n{\nint size,array[50],n,m,border,max,buf,step;\nint i, j, temp;\n\nprintf("Input number of elements in array:");\nscanf("%d",&size);\n\nfor(n=0;n<size;n++) {\n  printf("input %d. element of array:",n+1);\n  scanf("%d",&array[n]);\n  }\n\n for (i=(size-1);i>=0; i--)\n  {\n   for(j=1;j<=i;j++)\n    {\n     if(array[j-1]>array[j])\n      {\n       temp=array[j-1];\n       array[j-1]=array[j];\n       array[j]=temp;\n      }\n     }\n   }\n\nfor(n=0;n<size;n++)\n   printf("%d. element: %d&#92;n",n+1,array[n]);\n\n}\n\n\n\nHERE IS MY OUTPUT:\n\nInput number of elements in array:8\ninput 1. element of array:6\ninput 2. element of array:2\ninput 3. element of array:3\ninput 4. element of array:5\ninput 5. element of array:1\ninput 6. element of array:4\ninput 7. element of array:5\ninput 8. element of array:7\n1. element: 1\n2. element: 2\n3. element: 3\n4. element: 4\n5. element: 5\n6. element: 5\n7. element: 6\n8. element: 7