Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


Scientific Programming and Mathematical Modelling

Question Set Assessment 1

Assessment instruction

This is a summative assessment for the module of Scientific Programming and Mathematical Modelling (FP041).  Your completed work must be uploaded onto Tabula by Wednesday 16th February 2022 at 12 noon.

Late submissions will incur a late penalty in line with standard University regulations.  Please ensure that your work has your student ID printed on it and not your name.  This enables anonymity in the marking.

This assignment aims to test your understanding on the purpose, methods, and analysis of mathematical modelling in data science. Applying your knowledge in Python and data science, this assignment will also test your critical thinking on the many ways to approach a quantitative problem.  You will also be tested on your independent thinking and research on real-world phenomena and how mathematical modelling can help you provide a comprehensive understanding and conclusions.

Your analysis and answers should be around 800 words long but will also contain tables and figures. Your report should be typed using Times New Roman font, size 12.  Any mathematical notation used must be inserted professionally using Microsoft Equation Editor or an equivalent tool.

There are 4 questions in this assignment. To structure your report well and include relevant content you should complete the questions listed and structure each question appropriately in the form of a questions and answers. For each question you should see that there are boxes to fill in your answers and for python question, you can input the screenshot of your program output. You will be marked on your ability to undertake mathematical calculations, interpret quantitative data, and present information in a professional and informative way.  Marks will also be awarded for accuracy of the information reported and your creativity in delivering your answers in a mathematical form.

The total mark for this assignment is 50 marks and the detail of each mark is specified on the question. Read the questions carefully. This assignment is worth 30% of your overall module grade. Under some circumstances, you are also eligible to apply for self-certification should you not able to submit this assignment within the deadline specified on Tabula.

Student ID:

Total Word Count:

Total mark:

Question 1: Python Function (12 marks)

a) Write a program in Python to calculate the surface area of a cuboid. Collect width, height and depth of the cuboid as input. 

(2 mark)

Code:

 

Screenshot:


b) Write a program that will work out the distance travelled if the user enters in the speed and the time.

(2 mark)

Code:

Screenshot:

 

c) Write a program to calculate the area of a circle from the radius entered by the user.

(2 mark)

 Code:

Screenshot:

 

 

d) Write a program to calculate the future value (FV) of a loan using compound interest.

(3 mark)

������ = ������(1 + ���)���

PV = present value

 

r = interest rate (as a decimal value) n = number of periods

 

Code:

 

Screenshot:

 

e) Display 0 if a number entered by the user is even, and 1 if it is odd.

(3 mark)

 

 

 

Code:

 

Screenshot:

 

Question 2: Sketching and analyzing graph (13 marks)

 

You will need to use Jupyter notebook for this question. The code below draws a line from position (0,0) to (6,250)

import matplotlib.pyplot as plt import numpy as np

xpoints = np.array([0, 6]) ypoints = np.array([0, 250])

 

plt.plot(xpoints, ypoints) plt.show()

 

a) The code above creates a positive linear slope. Change the code so that the positive linear slope becomes a negative linear slope using the same range of axis.

(3 mark)

Code:

 

Screenshot:

  

b) Create code which will produce the graph below. Hint: you may need to use this line in your code:

plt.plot(xpoints, ypoints, 'o')


 

(2 mark)

Code:

 

Screenshot:

 

 

c) Create the line graph with multiple points shown above.

(2 mark)

Code:

 

Screenshot:

 

d) Why do the majority of Data Scientists use NumPy array instead of Lists in Python?

(3 marks)

 

 

e) The following is an example of unstructured data. How would you be able to structure this data?

(3 marks)

Unstructured Data:

The university is known for its diverse students. David’s ID is 1. David has a Ph.D and is British. Yara’s ID is 2. Yara has a B.Sc degree and is Jordanian. Bob’s ID is 3. Bob has the same degree as Yara and is from the same country as David.

 

Structured Data:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Question 3: The practice of mathematical modelling (12 marks)

Answer the following questions regarding the basic of Mathematical Modelling. It is also useful to illustrate your answer using a diagram or a chart.

 

a. In your own words, provide a definition of Mathematical modelling and explain three components which contributes to a good mathematical model. Think of one or more real-world scenario in which mathematical modelling can be used to provide insights, solutions, and predictions.

(2 marks)

 

 

b. Explain the importance of assumptions in building a mathematical model. Use one or two examples to further clarify your answers.

(2 marks)

 

c. Explain three possible limitations of using mathematical model as a data scientist. Use some real-world example(s) to illustrate your answers.

(3 marks)

 

d. Suppose that one of your hobbies is to collect ants and put them in a jar. One day after coming to mathematical modelling seminar, you are interested in modelling the growth of your ant’s colony population.

 

i. Explain using the 1st stage of mathematical modelling how you would define the objective of your model, the assumptions regarding your ants’ population, the level of simplifications, and your model function or formula. (hint: suppose P = population and t=time (day), what is the function for your ants population growth in terms of time ) (3 marks)

 

ii. What technique of mathematics is used to model the scenario above? Suggest some ways for you to validate your model in (i) (2 mark)

 

(5 marks)


 

Question 4: Functions and structured data (13 marks)

 

The questions below test your understanding on using functions and structured data in modelling real-world problems.

 

e. In the context of mathematical modelling, explain the relations and differences between an expression, an equation, and a function. Use a real-world example, structured data, or a cartesian graph to illustrate the suitability of using a function in modelling.

(3 marks)

 

f. Observe the structured data provided below.

 

 

Summarize the structured data above and determine whether you can model a function of height in terms of age (Height (Age)). Explain the relationship between height and exam score and analyse if you can model a function of exam score in terms of height (Exam score (Height)). 

(3 marks)


 

g. A University had 1200 undergraduate students enrolled in 2003 and 1500 students in 2006. If the student population P; grows as a linear function of time t, where t is the number of years after 2003 (Hence t = 0 at 2003).

 

i. Find a linear function that relates the student population P to the time t. Starts with defining your objective (what the independent and dependent variable is) and any assumptions necessary for your model. (2 marks)

ii. With your linear function, predict the number of students enrolled in the University in 2010. (1 mark)

(3 marks)

 

h. As an analyst at Amazon, your first task is to analyse the sales of Amazon Kindle throughout the year. Your data concludes that when the retail price of a kindle is $50, the number of sales is 4,500 unit per month. After analysing it further, you find out that if the price is raised by $1, the sales drop by 5 unit. So at $51, the number of sales become 4,495.

i. Find a linear function that relates the number of sales to the price of a kindle. Determine the dependent and independent variable and write down your function. (2 marks)

ii. Extend your function so that it relates the monthly revenue to the price. Note that Revenue(price) = number of sales (price) * price. In addition, find the optimal price of a kindle so that it maximises the revenue. (2 mark)

(4 marks)