程序代写案例-SCHOOL 2020

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
THE UNIVERSITY OF AUCKLAND
SUMMER SCHOOL 2020
Campus: City
COMPUTER SCIENCE
Introduction to Computer Systems
(Time Allowed: TWO hours) r>Note:
Your Teleform sheet is stapled at the end of this question/answer book. Remove the Teleform sheet
from the question/answer book.
The version code for this question/answer book is 00003978 . You MUST carefully check that this
version code corresponds to the one on the Teleform. If the version codes do not match, please inform
the exam supervisor IMMEDIATELY.
Enter your name and student ID on the Teleform sheet. You must also enter your name and student ID
on this question/answer book in the space provided below.
Enter your answers on the Teleform. Answers entered in the question/answer book will not be marked.
At the end of the exam, submit the Teleform only. You MUST retain this question/answer book until
the marking is complete and you have received the mark or grade for this assessment.
Each of the 45 questions is expected to have exactly 1 (one) correct answer. If you believe that a
question has either NO or MULTIPLE correct answers, select the ONE you believe is most likely to be
the intended answer.
All questions carry equal marks. You must answer 40 out of the 45 questions correctly in order to obtain
full marks in this exam. Any excess marks may be used to offset marks lost in the mid-semester test.
This exam counts for 50% of your final grade.
Name: ......................................
ID: ......................................
COMPSCI 110
Page 1 of 22
1. Which of the following strings, when compressed with the RLE algorithm discussed in class, will result in a compression ratio
of 1.5 or more?
X. WHHAAAAAAMMM
Y. bookkeeper
Z. zzzzZZZZzzzz!!
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
2. Which of the following additions are CORRECT? Note the subscripts denote the bases (8=octal, 16=hexadecimal).
X. 21358 + 3548 = 25118
Y. 11528 + 2628 = 14348
Z. 21158 + 3668 = 25038
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
3. Which of the following subtractions are CORRECT? Note the subscripts denote the bases (8=octal, 16=hexadecimal).
X. 34168 - 3708 = 30268
Y. CEB16 - A116 = C4B16
Z. 56528 - 238 = 56278
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
COMPSCI 110
Page 2 of 22
4. Which of the following answers correctly give the 8-bit two's complement of the specified decimal number?
X. -65 is 1011 1110
Y. 111 is ​0110 1111​
Z. 9 is ​1111 0111​
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
5. Which of the following are correct representations of the specified decimal values in the 16-bit floating point format presented
in lectures and the textbook? Note that the floating point representation has been expressed in hexadecimal.
X. 0.1875(decimal) is 6022 (hexadecimal).
Y. -55.375 (decimal) is EEC6 (hexadecimal).
Z. -0.375 (decimal) is E001 (hexadecimal).
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
COMPSCI 110
Page 3 of 22
6. Given that the hexadecimal value of the ASCII code for "A" is 41, the ASCII code for "a" is 61 and the ASCII code for "1"(one)
is 31, which of the following statements are TRUE? All numbers are in hexadecimal.
X. The ASCII code for "m" is 6D.
Y. All uppercase letters have ASCII codes numerically smaller than the ASCII codes of all lowercase letters.
Z. The decimal value of numeric characters can be obtained by looking at the 4 most significant bits of their hexadecimal
ASCII codes.
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
7. Consider the truth table below:
Which of the following boolean expressions match the output column in the truth table above?
X. (NOT A AND B AND C) OR (A AND NOT B AND NOT C)
Y. (NOT A AND NOT B AND C) OR (NOT A AND B AND NOT C)
Z. (NOT A OR A) AND (NOT B OR B) AND NOT C
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
COMPSCI 110
Page 4 of 22
8. Consider the Huffman tree below:
Which of the following statments about this Huffman tree are TRUE?
X. The Huffman code for 'f' is 1101.
Y. The Huffman code for 'e' is 000.
Z. The Huffman code for space (' ') is 111.
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
9. Which of the following statements are TRUE?
X. The MAR determines whether data is to be fetched from memory or stored to memory.
Y. A multiplexor circuit can be used to select the proper ALU result.
Z. Data stored at larger memory addresses in RAM, take longer to be accessed than data stored at smaller memory
addresses.
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
COMPSCI 110
Page 5 of 22
10. Here is a program using the pseudocode presented in lectures:
Using this program, which of the following give the correct output with the given input?
X. Input: 7, Output: 39
Y. Input: 6, Output: 21
Z. Input: 1, Output: 0
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
COMPSCI 110
Page 6 of 22
11. Here is an assembly language program using the textbook language (the appendix contains the textbook instruction set):
.BEGIN
IN X
L: LOAD X
COMPARE Z
JUMPEQ E
LOAD W
ADD Y
STORE W
INCREMENT Y
DECREMENT X
JUMP L
E: OUT W
HALT
W: .DATA 0
X: .DATA 0
Y: .DATA 1
Z: .DATA 0
.END
Using this program which of the following give the correct output with the given input?
X. Input: 0, Output: 1
Y. Input: 4, Output: 4
Z. Input: 2, Output: 2
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
COMPSCI 110
Page 7 of 22
12. Here is an assembly language program using the textbook language. The comments at the right end of each line are for
numbering the lines. The program starts at address zero. The appendix contains the textbook instruction set.
.BEGIN -- line 1
IN X -- line 2
L: LOAD X -- line 3
ADD X -- line 4
STORE X -- line 5
LOAD Z -- line 6
COMPARE Y -- line 7
JUMPEQ E -- line 8
DECREMENT Z -- line 9
JUMP L -- line 10
E: OUT X -- line 11
HALT -- line 12
X: .DATA 0 -- line 13
Y: .DATA 0 -- line 14
Z: .DATA 3 -- line 15
.END -- line 16
Using this program, which of the following have the correct machine code and data (both in hexadecimal) for the specified
line?
X. Line 3 - 000D
Y. Line 6 - 000D
Z. Line 12 - F000
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
COMPSCI 110
Page 8 of 22
13. Consider the following C or Java source code:
while (l==5) { l = - b + c / _x2;}
If analysed with the lexicographical analyser from the lectures, how many tokens and token classes do we find here?
A. 17 tokens and 11 token classes
B. 17 tokens and 13 token classes
C. 17 tokens and 12 token classes
D. 16 tokens and 13 token classes
E. 18 tokens and 13 token classes
14. Which of the following BNF specifications are recursive?
X. ::= | $ | _ | @ | ! | % | ^ | * | ( | ) | . |
Y. ::= |
Z. ::= |
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
15. Consider the following BNF grammar:
::= 1|2|3|4|5|6|7|8|9
::= 0|
::= +|

Which of the following patterns does this grammar match?
X. +64
Y. 03
Z. 570
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
COMPSCI 110
Page 9 of 22
16. Consider the parsing tree below:
Which of the following BNF grammar definitions could have been involved in the production of this tree?
X. ::= =|<|>
Y. ::= |+
Z. ::= |
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
17. Which of the following statements are true about semantic analysis during compilation?
X. A syntactically correct statement might be semantically wrong.
Y. The semantic analysis phase generates a parse tree for the input tokens.
Z. A non-terminal symbol may be linked to an existing semantic record.
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
18. Assume that in a multiprocess OS, each process spends about 50% of it's time waiting for I/O operations to be completed.
Which of the following statements are true?
X. If there are 3 processes loaded into memory, the processor utilization will be 75%.
Y. If there are 4 processes loaded into memory, the processor utilization will be 100%.
Z. If there are 2 processes loaded into memory, the processor utilization will be 50%.
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
COMPSCI 110
Page 10 of 22
19. A file on a Linux machine has permissions rw-------. This file is:
X. executable by its owner.
Y. not writable by its owner.
Z. readable by members of its group.
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
20. A file on a Linux machine should have permissions rwxr-x--x. Which command do you use to set these permissions?
A. chperm 771
B. chgrp 711
C. chmod 751
D. chmod 771
E. chperm 751
21. Which of the following statements about file permissions in Unix are correct?
X. The owner user of a file can change file ownership to any other user.
Y. A file with permissions drw-rw-rw- is a directory.
Z. A file can be associated with multiple groups at a time.
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
COMPSCI 110
Page 11 of 22
22. Which of the following situations are deadlocked or might create one?
X. A system has six units of a resource, with 5 processes competing for them. Each process needs two units.
Y. Process B is trying to read data from a file X that process C has locked for writing. Process C is waiting for A to finish
writing to file Y that A has locked. Process A is waiting for data from Process B.
Z. A system has six units of a resource, with 6 processes competing for them. Each process needs two units.
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
23. Which of the following features are essential in a multi-user operating system?
X. Access permissions for files and directories
Y. Separate memory areas for different processes
Z. User authentication
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
24. Which of the following statements are true about malware?
X. A virus is carried by an infected host file.
Y. Phishing can be used to obtain sensitive information such as credit card details or passwords.
Z. A virus can spread from one machine to another without being carried by a host file.
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
25. Consider a ciphertext KCJI. If you know that this was encrypted with a Caesar cipher from plaintext CUBA, which of the
following could be the key? You may assume that the cipher's alphabet consists of the 26 letters of the English alphabet only.
A. 16
B. 8
C. 14
D. 9
E. 12
COMPSCI 110
Page 12 of 22
26. Consider the plaintext COCONUT. If encrypted with a Caesar cipher with key 11, which of the following is the ciphertext?
You may assume that the cipher's alphabet consists of the 26 letters of the English alphabet only.
A. NZNZMTS
B. NZNZYFE
C. NZNZYUT
D. NZNZYFU
E. NZNMLSR
27. Decrypt the ciphertext PBZZREPR:
A. COMMERCE
B. MIDNIGHT
C. INITIATE
D. ENGINEER
E. ACCURACY
28. Consider the plaintext EFH over the shortened alphabet A=0, B=1, C=2, D=3, E=4, F=5, G=6, H=7. What is the ciphertext if
we encrypted the plaintext with the following block cipher key:
Note: Given the size of the alphabet, you will need to use mod 8.
A. AFB
B. FDH
C. EAF
D. AAE
E. AGG
COMPSCI 110
Page 13 of 22
29. Which of the following are TRUE with respect to RSA?
X. The first part of the public key is the product of two large prime numbers.
Y. The private key can be computed once the first part is known.
Z. The private key is used to encrypt messages intended for the owner only.
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
30. Which of the following are TRUE?
X. A 100 Mbps Ethernet interface takes longer to transmit a 1500 byte frame than a Gigabit Ethernet interface takes for a
9000 byte frame.
Y. Ethernet data transfer slows down as the number of actively communicating hosts on the segment increases.
Z. Coaxial cable and twisted-pair cables are types of wireless media.
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
31. Which of the following are TRUE?
X. A single medium earth orbit satellite cannot provide 24/7 service to a single ground station.
Y. Geostationary satellite ground stations need larger antennas than medium earth orbit satellite ground stations.
Z. Low earth orbit satellite ground stations need very large tracking antennas at each ground station.
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
COMPSCI 110
Page 14 of 22
32. Which of the following are TRUE in terms of the maximum achievable bit rate between two hosts connected by this
technology?
X. VDSL has a higher bit rate than 100 Mbps Ethernet.
Y. Gigabit Ethernet has a higher bit rate than Fibre.
Z. 100 Mbps Ethernet has a higher bit rate than ADSL.
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
33. Which of the following statements are TRUE with respect to packet size on a network shared with other hosts?
X. Small packets cannot be affected by bit errors.
Y. The smaller the packet size, the higher the fairness towards other hosts.
Z. If we make our packet size larger, we may be able to complete transfers with fewer packets.
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
34. With reference to the OSI layer model, the
A. transport layer interacts with the physical layer above and the presentation layer below.
B. transport layer interacts with the session layer above and the network layer below.
C. transport layer interacts with the presentation layer above and the physical layer below.
D. transport layer interacts with the session layer above and the presentation layer below.
E. transport layer interacts with the application layer above and the presentation layer below.
COMPSCI 110
Page 15 of 22
35. Which of the following are TRUE with respect to a TCP-based data communication between two IP hosts on the Internet?
X. The transport layer forwards packets from one router to the next.
Y. Routers along the way use the TCP destination port numbers to determine the correct outgoing interface.
Z. The data link layer is not used in TCP communication.
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
36. Which of the following are valid sets of instructions for a Turing machine?
X. (1,0,1,1,L),(1,1,0,3,R),(2,0,1,3,L),(2,1,0,1,L),(2,b,b,2,L)
Y. (1,b,0,2,R),(1,1,0,3,R),(2,b,1,1,R),(3,0,0,1,R),(3,0,0,1,L)
Z. (1,0,0,1,R),(1,b,0,2,L),(2,0,1,1,L),(2,1,0,1,L),(2,1,1,1,R)
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
37. Consider the following sets of instructions, some of which may not be valid. Which of the sets are valid and prevent a Turing
machine from halting irrespective of the input to the machine on the tape? You may assume that the machine is in state 1 at
the start of execution.
X. (1,0,1,2,R),(1,1,0,2,R),(1,b,1,1,L),(2,0,1,3,R),(2,b,1,1,R),(3,0,1,2,L),(3,1,0,1,R),(3,b,1,2,L)
Y. (1,0,1,2,R),(1,1,0,2,R),(1,b,1,1,L),(2,0,1,3,R),(2,b,1,1,R),(3,0,1,2,L),(3,1,b,3,R),(3,b,1,2,L)
Z. (1,0,1,1,R),(1,1,1,2,R),(1,b,1,2,L),(2,0,0,2,R),(2,1,0,2,R),(2,b,1,1,L)
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
COMPSCI 110
Page 16 of 22
38. Consider the following instruction set for a Turing machine:
(1,0,0,2,R)
(1,1,1,4,R)
(2,0,0,4,R)
(2,1,0,3,R)
(3,0,1,5,R)
(3,1,1,1,R)
(4,0,0,2,R)
(4,1,0,4,R)
(5,0,0,2,R)
(5,1,1,5,R)
If the Turing machine is run on the tape 101010..., starting in state 1 on the first symbol on left of the tape, which state
does it end up in after executing 6 instructions?
A. State 1
B. State 4
C. State 5
D. State 2
E. State 3
39. Consider the following instruction set for a Turing machine:
(1,0,0,2,R)
(1,1,0,4,R)
(2,0,0,5,R)
(2,1,1,3,R)
(3,0,0,5,R)
(3,1,0,1,R)
(4,0,0,2,R)
(4,1,1,4,R)
(5,0,1,2,R)
(5,1,0,4,R)
If the Turing machine is run on the tape 101011..., starting in state 1 on the first symbol on the left of the tape, what is
written on the tape after 6 instructions have been executed?
A. ...101001...
B. ...001101...
C. ...001001...
D. ...011001...
E. ...000001...
COMPSCI 110
Page 17 of 22
40. Which of the following statements on Turing machines are TRUE?
X. Turing machines can be used to show that the halting problem is unsolvable.
Y. Turing machines allow the read/write head to move any number of cells to the left.
Z. Scientists believe that every computation that a real computer can do can in principle be performed by a Turing
machine.
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
41. Which of the following are reasoning tasks?
X. Ranking products based on sales.
Y. Understanding the spoken word.
Z. Deciding what to wear based on weather conditions.
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
42. Which of the following statements about back propagation in neural networks is TRUE?
X. If an output neuron fired erroneously, its firing threshold is increased.
Y. If an output neuron failed to fire, its positive (excitatory) weights are increased.
Z. In back propagation, the weights from each neuron layer are moved to the previous layer.
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
COMPSCI 110
Page 18 of 22
43. Which of the following statements on robots are TRUE?
X. Robots can only be used for tasks where they cannot possibly make a mistake.
Y. Every robot must have a complete knowledge representation about its environment.
Z. All robots use sensors to detect what is around them.
A. X and Y only
B. X and Z only
C. Y and Z only
D. All of X, Y, and Z
E. None, or only one of X, Y, and Z
44. Consider the following neural networks. Which networks output 1?
X.
N1
2
N2
1
N3
2
N4
2
N5
1
1
0
1
1
OUTPUT
2
-1
2
0
3
0
1
0
3
0
Y.
N1
2
N2
2
N3
1
N4
3
N5
2
0
0
1
0
OUTPUT
2
0
1
-2
3
-1
2
-1
3
0
Z.
N1
1
N2
1
N3
1
N4
3
N5
1
0
0
0
0
OUTPUT
2
-1
1
-2
4
-1
2
0
4
0
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
COMPSCI 110
Page 19 of 22
45. Which of the following sentences could be used as a Winograd schema?
X. Joe's uncle can still beat him at tennis, even though he is 30 years older.
Y. Susan knows all about Ann's personal problems because she is nosy.
Z. Sid explained his theory to Mark but he couldn't understand him.
A. X only
B. Y only
C. Z only
D. None of X, Y, and Z
E. All, or two of X, Y, and Z
COMPSCI 110
Page 20 of 22
Appendix
COMPSCI 110
Page 21 of 22
Powered by Dividni.
COMPSCI 110
Page 22 of 22

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468