













































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
university of maharase enterance exam
Typology: Exams
1 / 53
This page cannot be seen from the preview
Don't miss anything!
Sample 1 questions answer for the MUM entrance exam
After applying in the Maharishi University of Management (MUM) for Master of Science in Computer Science, we get student id number provided by the University and we have to appearto the entrance exam, and in the entrance exam you will have three questions to be solved within 2 hours. I have collected some of the question and try to provide you the answers. Some of the sample questions that i am able to collect for the MUM entrance exam are as follows: There are three questions on the exam. You have two hours to finish. Please do your own work.
Examples if a is return reason {2, 1, 1} 1 2 + 1 + 1 {2, 1, 1, 4, -1, -1} 1 2 = 1 + 1, 2 = 4 + -1 + - {6, 2, 4, 2, 2, 2, 1, 5, 0, 0} 1 6 = 2 + 4, 6 = 2 + 2 + 2, 6 = 1 + 5 + 0 + 0 {18, 9, 10, 6, 6, 6} 0 18 != 9 + 10 {-6, -3, -3, 8, -5, -4} 0 -6 != 8 + -5 + - {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, -2, - 1}
{3, 1, 2, 3, 0} 0 The length of the array is 5, but 5 does not equal n*(n+1)/2 for any value of n.
Examples: if a is return reason {9, 0, 2, -5, 7} 2 The square pairs are <2, 7> and <7, 9>. Note that <-5, 9> and <0, 9> are not square pairs, even though they sum to perfect squares, because both members of a square pair have to be greater than 0. Also <7,2> and <9,7> are not square pairs because the first number has to be less than thesecond number. {9} 0 The array must have at least 2 elements
if n is odd then multiply by 3 and add 1 continue this until n becomes 1 The Guthrie sequence of a positive number n is defined to be the numbers generated by the above algorithm. For example, the Guthrie sequence of the number 7 is 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 It is easy to see that this sequence was generated from the number 7 by the above algorithm.Since 7 is odd multiply by 3 and add 1 to get 22 which is the second number of the sequence. Since 22 is even, divide by 2 to get 11 which is the third number of the sequence. 11 is odd so multiply by 3 and add 1 to get 34 which is the fourth number of the sequence and so on. Note: the first number of a Guthrie sequence is always the number that generated the sequence and the last number is always 1. Write a function named isGuthrieSequence which returns 1 if the elements of the array form a Guthrie sequence. Otherwise, it returns 0. If you are programming in Java or C#, the function signature is int isGuthrieSequence(int[ ] a) If you are programming in C++ or C, the function signature is int isGuthrieSequence(int a[ ], int len) when len is the number of elements in the array. Examples if a is return reason {8, 4, 2, 1} 1 This is the Guthrie sequence for 8 {8, 17, 4, 1} 0 This is not the Guthrie sequence for 8 {8, 4, 1} 0 Missing the 2 {8, 4, 2} 0 A Guthrie sequence must end with 1 There are three questions on this exam. You have two hours to complete it. Please do your own work.
Start with a positive number n if n is even then divide by 2 if n is odd then multiply by 3 and add 1 continue this until n becomes 1 The Guthrie index of a positive number n is defined to be how many iterations of the above algorithm it takes before n becomes 1. For example, the Guthrie index of the number 7 is 16 because the following sequence is 16numbers long.
22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 It is easy to see that this sequence was generated by the above algorithm. Since 7 is odd multiply by 3 and add 1 to get 22 which is the first number of the sequence. Since 22 is even, divide by 2 to get 11 which is the second number of the sequence. 11 is odd so multiply by 3 and add 1 to get34 which is the third number of the sequence and so on.
Write a function named guthrieIndex which computes the Guthrie index of its argument. Its signature is int guthrieIndex(int n) Examples if n is return sequence 1 0 number is already 1 2 1 1 3 7 10, 5, 16, 8, 4, 2, 1 4 2 2, 1 42 8 21, 64, 32, 16, 8, 4, 2, 1
You may assume that the length of the sequence can be represented by a 32 bit signed integer. There are 3 questions on this test. You have two hours to do it. Please do your own work.
If you are programming in Java or C#, the function prototype is int[ ] solve10() where the length of the returned array is 2. If you are programming in C++ or C, the function prototype is int * solve10() where the length of the returned array is 2. Please be sure that the method solve10 returns an array, a, with two elements where a[0] == x, a[1] == y and x! + y! = 10!.
Write a method named henry that takes two integer arguments, i and j and returns the sum of the ith and jth perfect numbers. So for example, henry (1, 3) should return 502 because 6 is the 1stperfect number and 496 is the 3rd perfect number and 6 + 496 = 502.
The function signature is int henry (int i, int j) You do not have to worry about integer overflow, i.e., you may assume that each sum that you have to compute can be represented as a 31 bit integer. Hint: use modulo arithmetic to determineif one number is a factor of another.
int isNUnique(int[ ] a, int n) If you are programming in C or C++, the function signature is int isNUnique(int a[ ], int len, int n) where len is the number of elements in the array. Examples If a is and n is return because {7, 3, 3, 2, 4} 6 0 because a[1]+a[2] == 6 and a[3]+a[4] also == 6. {7, 3, 3, 2, 4} 10 0 because a[0]+a[1] == 10 and a[0] + a[2] also == 10 {7, 3, 3, 2, 4} 11 1 because only a[0] + a[4] sums to 11 {7, 3, 3, 2, 4} 8 0 because no pair of elements sum to 8. (Note thata[1]+a[2]+a[3] do sum to 8 but the requirement is that two elements sum to 8.) {7, 3, 3, 2, 4} 4 0 no pair of elements sum to 4. (Note that the a[4]==4,but the requirement is that two elements have to sum to 4.) {1} anything 0 array must have at least 2 elements
Sample 2 question collections of MUM university MS computer science There are three questions on this exam. You have two hours to complete it.
if n is return reason 4 1 because 4 = 2* 25 1 because 25 = 5* -4 0 because there is no integer that when squared equals -4. (note, -2 squared is 4 not -4) 8 0 because the square root of 8 is not an integer. 0 1 because 0 = 0*
convertToBase10(new int[ ] {1, 1, 2}, 3) returns 14 convertToBase10(new int[ ] {3, 2, 5}, 8) returns 213 convertToBase10 (new int[ ] {3, 7, 1}, 6) returns 0 because 371 is not a legal base 6 number. Your convertToBase10 method must call the isLegalNumber method that you wrote for question 2.
If you are programming in Java or C#, the function signature is: int convertToBase10(int[ ] a, int base) If you are programming in C or C++, the function signature is: int convertToBase10(int a[ ], int len, int base) where len is the size of the array. There are 3 questions on this test. You have 2 hours to finish it. Please use tabs or spaces to indent your program.
In each case the sum of the absolute values is 8, which is the length of A and each sequence of numbers in A defined in a pattern is negative or positive as required. The array A = {1, 2, 3, -5, -5, 2, 3, 18} does not match the following patterns: i. P = {4, -1, 3} (because the first 4 elements of A are not positive ( A [3] is negative) as required by P) ii. P = {2, -3, 3} (because even though the first 2 elements of A are positive, the next 3 are required to be negative but A [2] is positive which does not satisfy this requirement.) iii. P = {8} (because this requires all elements of A to be positive and they are not.)
Please note: Zero is neither positive nor negative. Write a function named matches which takes arrays A and P as arguments and returns 1 if A matches P. Otherwise it returns 0. You may assume that P is a legal pattern, i.e., the absolute value of its elements sum to the length ofwrite code to check if P is legal! A and it contains no zeros. So do not
If you are programming in Java or C# the signature of the function is int matches(int[ ] a, int[ ] p) If you are programming in C++ or C, the signature of the function is int matches(int a[ ], int len, int p[ ]) where len is the number of elements of a. Furthermore, the value of p[0] should be the length of p. So, for example, if p ={5, 2, -1, -2, 4}, p [0]=5 means that the array has 5 elements and that the last 4 define the pattern. Hint: Your function should have one loop nested in another. The outer loop iterates through the elements ofinner loop is the absolute value of the current element of P. The inner loop iterates through the next sequence of P****. The lower bound of the inner loop is A. The upper bound of the
Write a function named isIsolated that returns 1 if its argument is an isolated number, it returns 0 if its not an isolated number and it returns -1 if it cannot determine whether it is isolated or not(see the note below). The function signature is:
int isIsolated(long n) Note that the type of the input parameter is long. The maximum positive number that can be represented as a long is 63 bits long. This allows us to test numbers up to 2,097,15 1 because the cube of 2,097,151 can be represented as a long. However, the cube of 2,097,15than 63 bits to represent it and hence cannot be computed without extra effort. Therefore, your 2 requires more function should test if n is larger than 2,097,151 and return -1 if it is. If n is less than 1 your function should also return -1. Hint: n % 10 is the rightmost digit of n, n = n/10 shifts the digits of n one place to the right. The first 10 isolated numbers are N nn nn*n 2 4 8 3 9 27 8 64 512 9 81 729 14 196 2744 24 576 13824 28 784 21952 34 1156 39304 58 3364 195112 63 3969 250047 Questions 2 and 3 are on the next page.
Example if a is Return reason {1} 1 all elements use only digit 1. {11, 22, 13, 34, 125} 0 Elements used 5 differentdigits {9, 999, 99999, -9999} 1 Only digit 9 is used by all elements. Note that negativenumbers are okay. { } 1 There is no counterexample tothe hypothesis that all elements use the same digit.
If you are writing in Java or C#, the function signature is int isTrivalent (int[ ] a) If you are writing in C or C++, the function signature is int isTrivalent(int a[ ], int len) where len is the number of elements in the array a. Hint: Remember that the elements of the array can be any value, so be careful how youinitialize your local variables! For example using -1 to initialize a variable won’t work because -1 might be one of the values in the array. Examples if a is return Reason {-1, 0, 1, 0, 0, 0} 1 All elements have one of three values (0, -1, 1) { } 0 There are no elements { 2147483647, -1, - -2147483648}
1 Again only three different values. Note that the value of a[0] is the maximum integer and the value of a[3] is the minimum integer so you can’t usethose to initialize local variables.
for (int rupee20=0; rupee20<=; rupee20++) for (int rupee10=0; rupee10<=; rupee10++) for (int rupee5=0; rupee5<=; rupee5++) for (int rupee2=0; rupee2<=; rupee2++) for (int rupee1=0; rupee1<=; rupee1++) { if (_) count++ }
Examples
if a is return Reason {0, 1} 0 the value 0 has to occur less than 0 times, but it doesn’t {-1, 2} 0 if array contains a negative number, return 0. {} 1 since there are no values, there are none that can fail the test. {5, 5, 5, 5} 1 5 occurs less than 5 times {5, 5, 5, 2, 5} 0 array is not in ascending order.