辅导案例-COT3100
COT3100 Discrete Structures Print Your Name ______________________________ February 13–15, 2020 Quiz II Discussion Period _____ Leaders _________/_________ Instructions Enter your printed name, discussion period, and discussion leader's first name in the fields at the top right corner of this page. You may work in your assigned presentation groups, but only within your assigned presentation groups and not with anyone else. Each group member must submit their own copy of the quiz. Unless a problem directly instructs you differently, there are no known errors within this document. If you are instructed to use specific functionality to solve a problem, then follow the guidelines given. Otherwise, you are allowed to utilize any of our identities / laws / techniques / rules / and so on that accurately apply to constructing a solution to each problem. After each problem statement, include your answer before the next problem statement using a text editor to enter your answers. You will not handwrite any answers. Ensure you document is cleanly and clearly formatted. Honor Code By signing here, you acknowledge that you are adhering to the University Honor Code and you have not given to another student nor received from another student any assistance or material contributing to the completion of the exam. Signature [you may print your name in text]: _______________________________ Exam Evaluation This exam is worth 50 points and it has six problems. Problem Points Max Problem Points Max Problem Points Max 1 _______ / 12 3 _______ / 12 5 _______ / 3 2 _______ / 12 4 _______ / 8 6 _______ / 3 TOTAL _______ / 50 February 13–15, 2020 COT3100 Quiz II Page 2 of 2 Score _______ 1. [12 pts] Given () = 2' + 5 − 3, find the () such that () is .()/. Prove your answer. 2. [12 pts] Use pseudocode to describe an algorithm for the procedure: String int_to_binary_string( int number ). The procedure receives a positive int [ ∈ 7] into its corresponding binary bit string and returns the binary string. Prove the time complexity of your solution. 3. [12 pts] Use pseudocode to describe an algorithm for the procedure: int[][] find_pairs( int array[], int value ). Given a sorted array of distinct integers and a single integer value, find all pairs of indexes in the list whose product is equal to the value. Return the index pairs on the same row of a two-dimensional array. Note, will be the number of rows and total number of pairs found, while 2 will be the number of columns along every row [the first and second index position. Prove the time complexity of your solution. If you solve the problem in () time, +3 Extra Credit Points. Example Data Array: [ 1, 2, 4, 5, 6, 9, 10, 15, 20 ] Value: 20 Return: 0, 8 1, 6 2, 3 4. [8 pts] Given ≡ ( ) and ≡ ( ), = 60, = 83, and = 4, find and prove the general case(s) representing the possible values for and , such that + ≡ + ( ). 5. [3 pts] Convert the decimal value 300 into the corresponding bases. Binary Octal Decimal 300 Hexadecimal 6. [3 pts] Convert the 2s Complement value 1101 0010 into the corresponding bases. 2s Complement 1101 0010 Octal Decimal Hexadecimal