Which of the following statements are true? The element (1,2,3,4,5) € Shas order 5. The element...
Consider the following relation R on the set A = {1,2,3,4,5}. R= {(1, 1), (2, 2), (2, 3), (3, 2), (3, 3), (4,4), (4,5), (5,4), (5,5)} Given that R is an equivalence relation on A, which of the following is the partition of A into equivalence classes? Select the correct response. A. P = {{1}, {1, 2}, {3}, {3,4}, {4},{5}} B. P ={{1,2,3,4,5}} C. P ={{1,2},{3,4}, {5}} D. P = {{1}, {2,3}, {4,5}} E. P ={{1,2,3}, {1,5}} F. P= {{1},...
Exercise 4. Consider the permutation group S7. a. Show that the subgroup generated by the element (1,2,3,4,5,6) is a cyclic group of order 6. b. Show that the subgroup generated by the element (1,3, 4, 5, 6, 7) is a cyclic group of order 6. c. Show that the subgroup generated by the element (1,2,3) is a cyclic group of order 3. d. Show that the subgroup generated by the element (6, 7) is a cyclic group of order 2....
8 α = (д 1 9 2 5 3 4 5 10 3 6 7 86 9 10 2 7 10) 1 4 1 в = (1, 2 3 3 5 4 8 5 2 6 9 7 7 8 4 9 6 10 1 10) 10 8 ү 1 3 2 7 3 9 4 5 1 5 6 7 8 2 9 4 19) 10 1 ө ( 42 2 4 5 4 6 5 2 6 7...
1. Show the steps in order to sort {11,5,6,3,8,1,9,2} using Mergesort algorithm. 2. Show the element sequences of running Shellsort on the input {15,2,8,1,10,7,4,3,9,11,12,6} at the increments {7, 3, 1}, respectively. 3. Show the steps in details of sorting {15, 2, 8, 1, 10, 7, 4, 3, 9, 11, 12, 6} using quicksort with median-of-three partitioning and a cutoff 3 (if the elements are less than 3, using insertion sort).
def sum_gt_avg(num_list): Implement a function that returns the sum of the numbers in num_list that have a value greater than the average value in the list. • Parameters: num_list is a list of numbers (mixed integers and floats) • Examples: sum_gt_avg([1,2,3,4,5]) → 9 # 4+5 sum_gt_avg([1,2,3,-4,5]) → 10 # 2+3+5 sum_gt_avg([-1,-2,-3,-4,-5]) → -3 # -1-2
Define a function called collapse() which takes a list as input. Each element of the list will either be an integer, or a list of integers. The function should modify the input list by replacing all of the elements which themselves are lists with the sum of their elements. For example: Test Result vals = [1, 2, 3, 4, 5] collapse(vals) print(vals) [1, 2, 3, 4, 5] vals = [1, [2, 3], 4, 5] collapse(vals) print(vals) [1, 5, 4, 5]...
Problem 2. For the following statements, write down whether true or false (No justification needed, and for ease of grading, please make it clear what is) (1) (a) xE (b) х€ {{x}} (c) x}€{{x}} (d) } E (2) (a) C 1,2,3 (b) E {1,2,3 (c)E P({1,2,3} (d) n0 (3) (a) 1,2,3 (b) {1,2,3} с {1, 2, 3} (c) An0 (d) AU A (4) a) ZnZ = Z (b) ZUZ 22 your answer Problem 3. List the elements of the following...
I need to create a c++ print function that takes a vector of values ex: <1 2 3 4 5 6> and prints it in the correct way with the given dimensions. Example 2x3 = [[1,2,3],[4,5,6]] or 3x2 = [[1,2],[3,4],[5,6]]. To make this even more difficult there can be 3 dimensional matrixs. For example for <1 2 3 4 5 6 7 8 9 10 11 12> with dimensions depthXheightXwidth: 2x3x2 = [[[1,2],[3,4],[5,6]],[[7,8],[9,10],[11,12]]]. The depth height and width could be...
Let wE S7 be a permutation which rearranges 7 objects as follows, showing the result on the lower line 2 3 4 6 7 5 5 4 2 7 6 1 3 a) Express was a product of disjoint cycles representing how each object moves Is w an even permutation, or an odd permutation? What is its order? products of disjoint cycles b) Calculate w3, w5 and w' 2 as c) Does there exist T E S7 for which T-lwr...
Determine the order of the coset containing each of the following elements in the respective quotient groups. order element quotient group (6,1) Z16 Z18/((4, 13)) (9, 11) Z12 Z18/((6, 13)) (4,3) Z10 U(10)/((6, 7)) (12,9) Z14 * U(14)/{(8, 11))||