Student Number: st20290653
Student Full Name: Fatiha Tinzefte
Date of Submission: May 24th
Module Name: Mthematics for computing
Component : Courswork
Guided By: Anass El Yaakoubi
Part 1: Problem Modelling (40%)
A metallurgist made two purchases. The first purchase, which cost $1080, included 30
kilograms of an iron alloy and 45 kilograms of a lead alloy. The second purchase, at the
same prices, cost $372 and included 15 kilograms of the iron alloy and 12 kilograms of
the lead alloy. Model the problem using a system of equations with two variables.
Part 2: Cramer’s Rule in C/Python (60%)
Write and describe a program in C/Python to solve the system of equations in Part 1. The
program should use Cramer's Rule.
A viva, scheduled for Monday, May 13th, will entail a direct dialogue between the
examiner and the student, centred around the student's work.
The student is required to submit a report consisting of two parts to Moodle by 16:00 on
Monday, May 24th.
Part 1: Problem Modelling:
Let a represent the cost per kilogram of the iron alloy and y represent the cost per
kilogram of the lead alloy.
For the first purchase, with 30 kilograms of iron alloy and 45 kilograms of lead alloy
costing $1080, we have:
30x + 45y = 1080
For the second purchase, with 15 kilograms of iron alloy and 12 kilograms of lead alloy
costing $372, we have:
15x + 12y = 372
Part 2: Solving the System of Equations using
Cramer's Rule:
First, let's calculate the determinant of the coefficient matrix, D:
D=(30× 12) - (45 × 15) =
360 - 675 = -315
Next, let's find the determinants Dx and Dy by replacing the corresponding column with
the constant terms:
Dx=(1080 × 12) - (15 ×372) = 12960 - 16740 =-3780
Dy= (30 × 372) - (1080 ×15) = 11160 - 16200 = - 5040
Now, we can find a and y using Cramer's Rule:
x=Dx /D=-3780 /-315=12
y=Dy/D=-5040/-315=16
So, the cost per kilogram of the iron alloy is $12, and the cost per kilogram of the lead
alloy is $16.