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

3KE3 – Winter 2023

RStudio: Prescriptive Analytics

Assignment (III)

Assignment Overview

Objective

Providing some hands-on experience with the RStudio to see how it can be used in decision-making.

Therefore, throughout this assignment, you are expected to use appropriate codes to accomplish the required tasks as efficiently as possible.

Grade

This assignment is worth 7.5% of your total course grade. There are two parts in this assignment, and each part contains a set of questions. See the marking scheme:

Part 1 60 marks

Part 2 60 marks

Total      100 marks

Due date

Monday, March 27 at 11:59 PM (23:59). Your completed assignment should be uploaded through Avenue to  Learn  to  the  folder  "RStudio:  Prescriptive  Analytics  Assignment  (3)"  under  Assessments  --  > Assignments.

The overdue penalty is 20% of the total assignment mark per day.

Submitting the Assignment

Submit MS Word or PDF file, in addition to TWO RStudio scripts (for each part, one RStudio script should be submitted). If you submit more than one file, the most recent will be graded.

Please name the file as "Class section-Student number-First name-Last name" (for example, if you are in section 1 and your name is John Smith and your student number is 1234567, name the files C01-1234567- John-Smith).

The Word File

Create an MS Word file that includes the answers to the questions and any screenshots, graphs, and tables as instructed in the assignment questions. You will need to submit the finalized version of this file (as either Word or PDF ) to receive the grades for the assignment.

In   case   you   have   any   questions   regarding   the   assignment,   please   contact   Mahdi   Abouei

(aboueim@mcmaster.ca).

How to Logon to RStudio

1. For Windows users:

- First, download R using the following link:

https://cran.r-project.org/bin/windows/

- After downloading and installing R, you can download RStudio from the RStudio website:

https://www.rstudio.com/products/rstudio/download/

2. For Mac users:

- First, download R using the following link:

https://cran.r-project.org/bin/macosx/

- After downloading and installing R, you can download RStudio from the RStudio website:

https://www.rstudio.com/products/rstudio/download/

3.     Virtual Lab users:

Sign in tohttps://vlab.business.mcmaster.ca/with your Mac ID and password, and select RStudio. Please ensure that your VPN is connected before you open the link while you are off-campus.

For the instruction of R and RStudio installation, you can search online. There are lots of resources. For instance, check the following link for Windows and Mac users:

https://www.dataquest.io/blog/installing-r-on-your-computer/

The instructions for the Virtual lab can be found here:

•    For Windows:https://macdrive.mcmaster.ca/f/12613e26c29441efa67c/

•    For Mac:https://macdrive.mcmaster.ca/f/b4f7c8569cf04c22b651/

Notes:

For each part, you need to interpret the results from each analysis to help a manager make proper decisions.

Part 1.

A manufacturing company produces three products: Product A, Product B, and Product C. The company wants to determine how many units of each Product to produce to maximize the profit. Each unit of Product A requires 2 units of labor, 3 units of material X, and 1 unit of material Y, and will be sold for $20. Each unit of Product B requires 4 units of labor, 2 units of material X, and 2 units of material Y, and will be sold for $25. Each unit of Product C requires 4 units of labor, 1 unit of material X, and 3 units of material Y, and will be sold for $22. The company has 475 units of labor, 400 units of material X, and 300 units of material Y available.

1.1. How many Products, A, B, and C, should the company produce to meet the goal?

1.2. Interpret the results you obtain in RStudio in a short paragraph. (e.g., you can mention which Product is (not) profitable and why).

1.3. Assume that the number of Products A, B, and C to be produced are fixed and equal to the optimal values you found in question  1.1. By changing the values of the coefficients in the objective function, determine the highest profit given the specified number of products. What are the new coefficients? Explain your approach to solving this question.

Note. It is fine if you observe slight changes in the decision variable values (for example, ±5)

1.4. Assume that the manager has decided not to sell product B. Based on this input, draw a plot that shows the constraints and the objective function of this problem. Add the screenshot of the plot to your report and interpret the results. (Assign Product A to Y-axis and Product C to X-axis)

Part 2. Assume that you  are  an  investor,  and  you want  to  invest  in  one  of the  following manufacturing companies:

Company A:

A beverage company produces three products: cola, lemonade, and iced tea. The profit margin of each unit of cola, lemonade, and iced tea are $5, $7, and $6, respectively. The monthly production distribution of cola, lemonade, and iced tea is as follows:

Cola: Normal with mean 100 and variance 25

Lemonade: Normal with mean 70 and variance 36

Iced tea: Normal with mean 50 and variance 9.

Company B:

A toy company produces three products: dolls, cars, and puzzles. The profit margin of each doll, car, and puzzle are $4, $8, and $6, respectively. The monthly production distribution of dolls, cars, and puzzles is as follows:

Dolls: Normal with mean 70 and variance 16

Cars: Normal with mean 60 and variance 9

Puzzles: Normal with mean 40 and variance 25.

2.1. Which of these companies would you choose to invest in (company A or B)? Why?

2.2. How many units of cola, lemonade, and iced tea should company A produce to obtain its optimum profitability?

2.3. How many  dolls,  cars,  and puzzles  should  company B produce to  obtain  its  optimum profitability?

(Note. Set seed to 50 in RStudio, and produce 100 random variables for each of the products)