0% found this document useful (0 votes)
43 views6 pages

MCS1 - Exam Paper 01

The document contains a series of mathematical and logical questions covering number systems, character encoding, logical propositions, algorithms, and graph theory. It includes tasks such as conversions between number systems, truth table constructions, and the application of Cramer's rule. Additionally, it requires the creation of algorithms and flowcharts for specific scenarios, as well as the analysis of student enrollment data.

Uploaded by

prabashanadinith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views6 pages

MCS1 - Exam Paper 01

The document contains a series of mathematical and logical questions covering number systems, character encoding, logical propositions, algorithms, and graph theory. It includes tasks such as conversions between number systems, truth table constructions, and the application of Cramer's rule. Additionally, it requires the creation of algorithms and flowcharts for specific scenarios, as well as the analysis of student enrollment data.

Uploaded by

prabashanadinith
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ANSWER ONLY 5 OUT OF 6 QUESTIONS

1.
(A) In the field of mathematics, we utilize four primary number systems to express numbers:
decimal (base 10), binary (base 2), octal (base 8) and hexadecimal (base 16). Convert the
following numbers between these number systems and provide your answers in each of the
specified bases.
I. Convert the decimal number 255 into binary and hexadecimal. [03 Marks]
II. Convert the binary number 11010101 into decimal and hexadecimal. [03 Marks]
III. Convert the hexadecimal number 1A3F into decimal and octal. [03 Marks]
IV. Describe one advantage and one disadvantage of using the hexadecimal number system
when compared to the binary and decimal systems. [02 Marks]
(B)
I. Provide a demonstration of the 16.7510 floating-point representation in the IEEE 754
format using 32 bits. [03 Marks]
II. Perform the following binary calculations. [06 Marks]
a. (11000011 - 101) x 101
b. 11101 + 1101
c. 110101 / 11

2.
(A)
I. Explain the 02 distinctions in how ASCII and Unicode are different. [02 Marks]
II. Suppose a computer uses ASCII for its internal representation of characters. In which
order will this computer sort the strings: 24, b2, 1A, 2A, A1, Aa, 22? [03 Marks]
III. Convert the following decimal values into 8421 weighted codes, also known as
Binary-Coded Decimal (BCD). [04 Marks]
a. 7236
b. 6495
IV. According to the ASCII table, the letter 'H' corresponds to the decimal value 72.
Demonstrate the complete binary representation for the word "HELLOWORLD".
[06 Marks]
(B)
I. What are the two primary advantages of the 2's complement representation compared
to the 1's complement representation? Describe with examples. [02 Marks]
II. Perform the following calculations using the 2's complement representation with 8 bits.

Page 1 of 6
[03 Marks]
a. 16 - 16
b. 5 - 9
c. 5 + 3 - 2

3.
(A)
I. Express the following compound propositions in symbolic form (using logical variables and
connectives). Consider the following propositions. [05 Marks]
p: "The sun is shining."
q: "It is raining."
r: "The temperature is below freezing."
a. "It is not raining."
b. "Either the sun is shining, or it is raining."
c. "It is not raining and the temperature is below freezing."
d. "The sun is shining and it is not raining."
e. "It is not raining or the temperature is below freezing."
II. Construct a truth table for the compound proposition: (p ∧ q) ∨ (~r) [03 Marks]
III. Determine whether the following 02 propositions are logically equivalent and justify your
answer using a truth table. [02 Marks]
● "The sun is shining or it is raining."
● "It is not raining and the temperature is below freezing."
IV. Show that [(p ∨ q) ∧ (r ∨ ~q)] → (p ∨ r)] is a tautology by making a truth table.
[04 Marks]

(B)

I. Explain whether the following sentences can be considered propositions or not, and
provide your reasoning for your evaluation. [03 Marks]
a. x + 9 = 12
b. x2 = 0 when x = 0
c. a - b = b - a
II. Are the logical expressions "p ∨ (q ∧ r)" and "(p ∨ q) ∧ (p ∨ r)" equivalent? Verify your
answer by constructing a truth table. [03 Marks]

Page 2 of 6
4.
(A)
I. What is an algorithm, and how is it utilized in software engineering? [02 Marks]
II. Explain the 03 situations in which we prefer to use pseudo-code rather than flowcharts.
[03 Marks]
III. ABC University requires a program to validate student identity card numbers. Valid
national identity cards consist of ten characters, with the last character being one of the
following uppercase letters: V, X, or N. Here are three examples of valid identity card
numbers:

921545268V
985263524X
997856268N
Write an algorithm that will, take a potential identity card number from the user
● if input is “E”, allow the user to exit the program.
● if the identity card number is too short, then display an error message to the
user.
● if the identity card number is too long, then display an error message to the user.
● if the last character does not follow the rules, then display an error message to
the user.
● allow the user to keep entering identity card numbers.

Use pseudo-code to construct an algorithm that satisfies the specified


requirements.
[05 Marks]

(B)

I. Describe 03 key ways in which you would use a flowchart to prepare your team of
programmers for the development phase of a software project. [03 Marks]
II. Imagine you're a university academic officer who wants to automate the process of
calculating the average score for your class of students. You have a list of students'
names and their corresponding test scores. Your goal is to draw a flowchart to calculate
and display the class's average score. Consider implementing conditional statements and
loops to efficiently process multiple students' scores and generate class average.
[07 Marks]

Page 3 of 6
5.
(A) Examine a paragraph taken from ABC University's annual report. Review the paragraph and
provide responses to the questions listed below.

“In the dynamic landscape of university education, students often embark on


diverse academic journeys, pursuing a range of subjects. In study of student
enrollments of our university intake 2022/2023, we found that 60 students are
pursuing Mathematics(M), 45 are studying Physics(P), and 30 have chosen
Computer Science(C). Additionally, 25 students are enrolled in both Mathematics
and Physics, 15 in both Physics and Computer Science, and 20 in both
Mathematics and Computer Science. Remarkably, 10 students are dedicatedly
studying all three subjects: Mathematics, Physics, and Computer Science. These
numbers reflect the diverse academic choices made by the students.”

a. Draw a Venn diagram representing the sets M, P, and C, [04 Marks]


b. How many students are studying only Mathematics? [01 Mark]
c. How many students are studying only Physics? [01 Mark]
d. How many students are studying only Computer Science? [01 Marks]
e. How many students are studying exactly two of the three subjects?
[01 Mark]
f. How many students are not studying any of the three subjects? [02 Marks]

(B)
I. A vehicle collision detection system has been designed to identify motor vehicle
accidents beforehand. The collision detection system consists of three (03) Collision
avoidance sensors.
S1 : Positioned at the precise center of the vehicle's front.
S2 : Positioned at the left of the vehicle.
S3 : Positioned at the right of the vehicle.
A sensor can either be active (send the logical value 1) or inactive (send the logical value
0). The collision detection system will autonomously engage the vehicle's braking system
in order to prevent a collision, specifically when a minimum of TWO sensors are
concurrently active.
a. Construct the truth table to represent the functionality of the above vehicle
collision detection system. [02 Marks]
b. Using the information from your truth table, construct the combinational logic
circuit.
[02 Marks]
c. Derive the Boolean expression to represent your truth table. [03 Marks]

Page 4 of 6
II. Using the laws of Boolean algebra, simplify the following Boolean expression.
[03 Marks]

6.
(A)
I. Consider the following system of three linear equations.
3x + 2y - z = -7
6x - y + 3z = -4
x + 10y - 2z = 2
a. Transform this system of linear equations into matrix form and identify the
coefficient matrix. [01 Mark]
T
b. Let the coefficient matrix be denoted by A. Then A(A) ? [02 Marks]
c. Apply Cramer’s rule to solve the given system of linear equations. [03 Marks]

II. In order for a matrix to be considered “skew symmetric”, it is necessary that its
transpose is equal to the negative of the original matrix (CT = -C). Is the given matrix C
skew symmetric? Justify your answer. [04 Marks]

(B)
I. Examine the graph below to determine the values for the properties mentioned. [06
Marks]

Page 5 of 6
a. Cardinality of the Graph
b. Size of the Graph
c. Recommend an open walk path from point C to point A and calculate its length.

II. Generate the undirected graph by considering the properties of the graph below. [04
Marks]
● |V| = 6
● |E| = 7
● Deg (A) = 1+1+2
● Deg (B) = 1+1+1+1
● Deg (C) = 1+1+1
● Deg (D) = 1+1
● Deg (E) = 1
● Deg (F) = 0
● C→C:CBADC

***

Page 6 of 6

You might also like