REVISION ON COMPUTATIONAL MATHS
REVISION ON COMPUTATIONAL MATHS
REVISION ON COMPUTATIONAL MATHS
KNEC Q&A
(a) (I) 7648 to decimal = 500 (ii) E516 to octal = 141 (iii) 67910 to binary =
1010100111 (IV) 1110102 to hexadecimal = 37A
(b) Weighted binary code assigns different weights to each bit position. This
means that the value of each bit is multiplied by a different power of 2, depending
on its position. For example, in the 8-bit weighted binary code, the most significant
bit (MSB) has a weight of 128, the next bit has a weight of 64, and so on. This
code is commonly used in digital systems for representing numbers and performing
arithmetic operations.
Un-weighted binary code assigns the same weight to each bit position. This
means that the value of each bit is simply its binary value, regardless of its
position. For example, in the 8-bit un-weighted binary code, each bit has a weight
of 1. This code is commonly used for representing data in computers and other
digital devices.
(c) (i) Peter wins all the games. The probability of Peter winning is 3/8 and Winnie
winning is 5/8. Probability of Peter winning all 6 games = (3/8) ^6 = 729/262,144
= 0.00278
(ii) Peter wins in 2 or 3 games. Probability of winning in 2 games = (3/8) ^2 * (5/8)
^4 * 6C2 = 2025/32768 = 0.0617 Probability of winning in 3 games = (3/8) ^3 *
(5/8) ^3 * 6C3 = 13500/262,144 = 0.0515
Total Probability = 0.0617 + 0.0515 = 0.1132
(iii) Winnie wins at most in 5 games. The probability of Winnie winning at most in
5 games is equal to 1 minus the probability of Winnie winning all 6 games.
Probability of Winnie winning all 6 games = (5/8) ^6 = 15625/262,144 = 0.0596
Probability of Winnie winning at most 5 games = 1 - 0.0596 = 0.9404
(d) (i) Given Q = {6,7,8} and R = {7,8,9,6,5} Q⊆R; False (ii) If A =
{21,22,23,...,30} then| = 20; False (iii) If A = {1,2} then|P {1,2}| = 3. False (iv) P =
{3,4,5) = (5,3,4} = {4,3,5,4,3}; True
(e) (i) equally likely; Coin toss has equal chance of landing heads or tails. (ii)
complementary. These are opposite events. If it is not heads it must be tails.
(f) (i)
Let x be the cost of a sheet of craft paper,
y be the cost of a box of markers and
z be the cost of a glue stick.
Then, the equations for the given scenario are:
3x + 4y + 5z = 2440
6x + 5y + 2z = 3040
3x + 2y + z = 1340
(ii) Solving the above system of equations, we get: x = 200 (cost of a sheet of craft
paper) y = 340 (cost of a box of markers) z = 100 (cost of a glue stick)
(a) (i) Outline three features of symbolic model. Symbolic model is an abstract
representation of a system using mathematical and logical symbols.
1. Abstraction: Symbolic models simplify reality by focusing on essential
relationships and ignoring irrelevant details. This allows for easier analysis
and understanding of complex systems.
2. Formalization: Symbolic models use precise and unambiguous symbols
and rules, eliminating ambiguity and allowing for clear communication.
3. Generalization: Symbolic models can be used to represent a wide range of
situations and can be applied to different contexts.
(b) (i) Represent the information in matrices notation
Let's represent the information in matrices.
Brand: P, Q, R
Packets purchased: We have three people: Rama, Shem, and Mogan.
Cost of each brand: Ksh 40, Ksh 50, and Ksh 60
We can represent the number of packets purchased by each person as a matrix.
1 P Q R
2Rama 10 7 3
3Shem 4 8 10
4Mogan 4 7 8
We can represent the cost of each brand as a column matrix.
1 Cost
2 40
3 50
4 60
To find the total amount spent by each person, we can multiply these two matrices.
(ii) Use the matrix method to determine the amount of money spent by each
person.
Let's multiply the two matrices.
VerifyOpen In EditorEditCopy code
1 P Q R Cost
2Rama 10 7 3 40
3Shem 4 8 10 50
4Mogan 4 7 8 60
To find the total amount spent by Rama, we multiply the elements of the first row
of the first matrix with the corresponding elements of the cost matrix and sum
them.
(10 * 40) + (7 * 50) + (3 * 60) = 400 + 350 + 180 = 930
Similarly, for Shem:
(4 * 40) + (8 * 50) + (10 * 60) = 160 + 400 + 600 = 1160
And for Mogan:
(4 * 40) + (7 * 50) + (8 * 60) = 160 + 350 + 480 = 990
Therefore, the total amount spent by Rama is Ksh 930, Shem is Ksh 1160, and
Mogan is Ksh 990.
(c) Use the cofactor method to determine the inverse of matrix D = [3 1 6; 2 0 4; 5
7 2]
The cofactor method is a way to calculate the inverse of a matrix. It involves
finding the determinant of the matrix and then calculating the cofactor matrix.
Here's how to do it:
1. Find the determinant of the matrix.
VerifyOpen In EditorEditCopy code
1det(D) = (3 * (0 * 2 - 4 * 7)) - (1 * (2 * 2 - 4 * 5)) + (6 * (2 * 7 - 0 * 5))
2det(D) = -84 + 18 + 84 = 18
2. Find the cofactor matrix.
The cofactor of each element is the determinant of the submatrix obtained by
deleting the row and column of that element, multiplied by (-1)^(i+j), where i and j
are the row and column numbers, respectively.
VerifyOpen In EditorEditCopy code
1C = [ (0*2-4*7) -(2*2-4*5) (2*7-0*5);
2 -(1*2-6*7) (3*2-6*5) -(3*7-1*5);
3 (1*4-0*6) -(3*4-2*6) (3*0-2*1)]
4
5C = [-28 18 14;
6 40 -24 -16;
7 4 -6 -2]
3. Find the adjugate matrix.
The adjugate matrix is the transpose of the cofactor matrix.
VerifyOpen In EditorEditCopy code
1adj(D) = [-28 40 4;
2 18 -24 -6;
3 14 -16 -2]
4. Calculate the inverse of the matrix.
The inverse of the matrix is the adjugate matrix divided by the determinant.
VerifyOpen In EditorEditCopy code
1D⁻¹ = adj(D) / det(D)
2
3D⁻¹ = [-28/18 40/18 4/18;
4 18/18 -24/18 -6/18;
5 14/18 -16/18 -2/18]
6
7D⁻¹ = [-14/9 20/9 2/9;
8 1 -4/3 -1/3;
9 7/9 -8/9 -1/9]
Therefore, the inverse of the matrix D is:
VerifyOpen In EditorEditCopy code
1D⁻¹ = [-14/9 20/9 2/9;
2 1 -4/3 -1/3;
3 7/9 -8/9 -1/9]
(b)
(i) Combination - Order doesn't matter when choosing a team.
(ii) Permutation - Order matters when choosing a chairman, secretary and
treasurer.
(iii) Combination - Order doesn't matter when choosing desserts.
(iv) Permutation - Order matters when listing favorite desserts.
(c)
For a PIN to be divisible by 10, the last digit must be a 0. This leaves us with 5
digits for the first 3 positions (0, 3, 5, 7, 8).
1st position: 5 options
2nd position: 4 options (since we can't repeat digits)
3rd position: 3 options
The total number of possible PINs is 5 * 4 * 3 * 1 = 60
(d)
Absolute Error: The absolute difference between the measured value and
the true value. It's the magnitude of the error.
Relative Error: The ratio of the absolute error to the true value. It expresses
the error as a fraction of the true value. It's a measure of how significant the
error is relative to the size of the measurement.
(a)
(i)
Tautology: A logical statement that is always true, regardless of the
truth values of its individual components.
Contradiction: A logical statement that is always false, regardless of
the truth values of its individual components.
(ii)
Truth Table:
A B ¬(A ∨ B) A ∧ ¬(A ∨ B) P Q P ∨ (P ⇔ Q) ∨ Q
T T F F T T T
T F F F T F T
F T F F F T T
F F T F F F T
A B ¬(A ∨ B) A ∧ ¬(A ∨ B) P Q P ∨ (P ⇔ Q) ∨ Q
(b) The number of ways of painting the shape is 8765432*1 = 40320 ways
(c) i) AND - Series of Logic gates with 2 or more switches ii) OR - Parallel Logic
gates with 2 or more switches iii) NOT - A logic gate with one input and one
output. The output is the opposite of the input.
(a) i) The tail of the distribution is longer on the right side. ii) The tail of the
distribution is longer on the left side.
(b) i) Absolute measures are not comparable across different distributions, as they
depend on the scale of the data. Relative measures are comparable, as they are
standardized. ii) Absolute measures are affected by outliers. Relative measures are
not affected by outliers. iii) Absolute measures are not scale-invariant. Relative
measures are scale-invariant.
(c)
A B AB A+B
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 1
The table shows that the output of AB is equal to the output of A+B for all possible
inputs.
(d) The quadratic equation 3x^2 + 5x -2 = 0 can be solved graphically by plotting
the graph of the equation and finding the x-intercepts. The graph is a parabola that
intersects the x-axis at two points, x= -2 and x= 1/3.
(a) i) Charts can only represent a limited amount of information. For example, a
chart cannot represent all of the data points in a large dataset.
ii) Charts can be misleading if they are not used properly. For example, a chart
with a misleading scale can distort the data.
(ii) Determine the relative error in each of the following
measures: (I) Radius; (II) Volume.
The radius of the sphere is 20 cm with a possible error of 0.01 cm.
(I) The relative error in the radius is calculated by dividing the maximum error in
the radius by the actual radius. Therefore, the relative error in the radius is
(0.01/20) = 0.0005.
(II) The volume of a sphere is given by (4/3) * π * r³, where r is the radius. The
relative error in the volume is calculated by dividing the maximum error in the
volume by the actual volume. The maximum error in the volume is given by 4 * π
* r² * ∆r, where ∆r is the maximum error in the radius. The actual volume is (4/3) *
π * r³. Therefore, the relative error in the volume is given by (4 * π * r² * ∆r) /
((4/3) * π * r³) = 3 * (∆r / r) = 3 * (0.01 / 20) = 0.0015.
(b) Distinguish between discrete random variable and continuous random variable
as used in probability.
Discrete random variable refers to a variable that can only take on a finite
number of values or a countably infinite number of values. It's typically a whole
number. For example, the number of heads when a coin is tossed four times is a
discrete random variable, with possible values 0, 1, 2, 3, and 4.
Continuous random variable refers to a variable that can take on any value
within a given range. It can be measured on a continuous scale, and its value can
be any number between two given points. For example, the height of a student in a
class is a continuous random variable, as the height can take on any value between
the minimum and maximum heights in the class.
(c) Distinguish between odd and even parity as applied in digital communications.
Parity is a technique used in digital communications to detect errors during data
transmission. It involves adding an extra bit, known as a parity bit, to the data
stream. The parity bit is set according to the number of '1' bits in the data stream.
Odd parity requires that the total number of '1' bits, including the parity bit, be
odd. So, if the data stream has an even number of '1' bits, the parity bit is set to '1',
and if the data stream has an odd number of '1' bits, the parity bit is set to '0'.
Even parity requires that the total number of '1' bits, including the parity bit, be
even. So, if the data stream has an odd number of '1' bits, the parity bit is set to '1',
and if the data stream has an even number of '1' bits, the parity bit is set to '0'.
Here is an example: Let's say we want to transmit the data stream 10110. Odd
parity: The data stream has three '1' bits (an odd number). Therefore, the parity bit
is set to '0' to make the total number of '1' bits even. The transmitted data stream
becomes 101100. Even parity: The data stream has three '1' bits (an odd number).
Therefore, the parity bit is set to '1' to make the total number of '1' bits even. The
transmitted data stream becomes 101101.
During data transmission, the receiver checks the parity of the received data
stream. If the parity is incorrect, it means that an error has occurred. Parity checks
can detect single-bit errors but cannot detect double-bit errors.
8. (a) (i) A random experiment is a process that leads to one of several possible
outcomes, where the specific outcome is uncertain. (ii) The sample space is
the set of all possible outcomes of a random experiment. (iii) An outcome is
a single result of a random experiment. (iv) A sample point is a specific
element of the sample space, representing a unique possible outcome of a
random experiment.
(b) Discrete random variables can only take on a finite number of values or a
countably infinite number of values, while continuous random variables can take
on any value within a given range.
(c) Odd parity refers to a system where the number of 1 bits in a data unit is odd.
Even parity refers to a system where the number of 1 bits in a data unit is even. In
digital communications, parity is used to detect errors in data transmission.
(d) We can use the given formula to find the solution of the equation x³ + 5x = 20,
given the initial value X = 2: X₁ = 3√20-5 * 2 = 1.817 X₂ = 3√20-5 * 1.817 =
1.894 X₃ = 3√20-5 * 1.894 = 1.896 X₄ = 3√20-5 * 1.896 = 1.896
Therefore, the solution of the equation x³ + 5x = 20 to 3 decimal places is 1.896.