CSCI 1303 Assignment
CSCI 1303 Assignment
CSCI 1303 Assignment
1
TABLE OF CONTENTS
1. Recurrence Relations………………………………………………………………………………3
1.1 Problems……………………………………………………………………………………….3
1.2 Solution..……………………………………………………………………………………….4
1.3 Summary……………………………………………………………………………………….5
2. Set………………………………………………………………………………………………….7
2.1 Problems………………………………………………………………………………………..7
2.2 Solution………………………………………………………………………...………………8
2.3 Summary……………………………………………………………………………………….9
3. Counting…………………………………………………………………………………………..11
3.1 Problems………………………………………………………………………………………11
3.2 Solution……………………………………………………………………………………….12
3.3 Summary……………………………………………………………………………………...13
2
1. Recurrence Relations
1.1 Question.
Since the Pandemic is over, demand for technology products such as motherboards is increasing
dramatically. A company manufactures a motherboard. The cost of manufacturing each unit of
the product is c dollars. The company sells each unit of the product for b dollars, where b > c.
The company's profits can be represented by the recurrence relation, Pn = bxn - cxn + P(n-1) where
Pn is the company's profit after selling xn units of the product and xn is the number of units sold
during the nth time period. The company's profits during the first time period, P1, were $1000
dollars. The company sold 500 units of the product during the first time period and the cost of
manufacturing each unit was $10 dollars.
b) What was the company's profit after the third time period, P3, if the company sold 1000 units during the
second time period and 2000 units during the third time period?
c) Company targeted profits for the 4th time period is $13500 dollars. Does the company succeed
in getting their targeted profits if they sold 2500 units?
3
1.2 Solution
Given,
c = cost per unit product
b = price per unit product
xn = units of product
Pn = profits of company in nth time period
Objective:
● To find the price for one product , we will use the profits formula to find b value using P1
value.
● P0 is not given but we assume it is 0 because the 0th time period is when the company
just started the business.
Technique:
b) Given,
x2 = 1000
x3 = 2000
P2 = bx2 - cx2 + P1
4
P2 = (12)(1000) - (10)(1000) + 1000
P2 = 3000
P3 = bx3 - cx3 + P2
P3 = (12)(2000) - (10)(2000) + 3000
P3 = 7000
Company’s profit for the third time period is $7000.
c) P4 >= 13500?
Given x4 = 2500
P4 = bx4 - cx4 + P3
P4 = (12)(2500) - (10)(2500) + 7000
P4 = $12000
The company doesn't reach their targeted profits which are only short of $1500.
Summary
a) Find the price of the motherboard .
$12
b) What was the company's profit after the third time period, P3, if the company sold 1000 units
during the second time period and 2000 units during the third time period?
$7000
c) Company targeted profits for the 4th time period is $13500 dollars. Does the company succeed
in getting their targeted profits if they sold 2500 units?
No, The company doesn't reach their targeted profits which are only short of $1500.
5
6
2. Set
2.1 Problems
"A company has a database of customer data that includes their age, gender, location, and
purchasing history. The company wants to use AI to segment the customers into different groups
based on their characteristics.
Using set theory, how can the company segment the customers into the following groups:
a) Customers who are male and live in the United States
c) Customers who are over the age of 30 and have made at least one purchase in the past
month
d) Customers who are under the age of 30 and have not made a purchase in the past month
Assume that the data for each customer is represented as a 4-element tuple, with the elements in the
following order: age, gender, location, purchasing history."
7
2.2 Solution
To solve this problem, you could use set theory to determine the sets of customers that meet the criteria
for each group.
First, define a set for each characteristic that is used to segment the customers:
● Age: {under 30, over 30}
● Gender: {male, female}
● Location: {United States, Canada}
● Purchasing history: {made a purchase in the past month, did not make a purchase in the past
month}
Then, use the set operation of the cartesian product to find the set of all possible combinations of
these characteristics. The cartesian product of a set with itself n times is the set of all possible
combinations of n elements from the set. In this case, the sets have 2 elements each, so the cartesian
product with itself 4 times would be 2^4 (2 to the 4th power) combinations. This is the set of all possible
customer tuples.
Next, use the set operation of intersection to determine the set of customers that meet the criteria
for each group. For example, to find the set of customers who are male and live in the United States, you
would take the intersection of the sets for gender (male) and location (United States). To find the set of
customers who are female and live in Canada, you would take the intersection of the sets for gender
(female) and location (Canada). Similarly, you can use intersection to find the sets of customers who are
over the age of 30 and have made a purchase in the past month, and those who are under the age of 30 and
have not made a purchase in the past month.
8
2.3 Summary
c) Customers who are over the age of 30 and have made at least one purchase in the
past month
d) Customers who are under the age of 30 and have not made a purchase in the past
month
age = { under 30 } ∩ purchasing history = { did not made a purchase in the past month }
9
10
3. Counting
3.1 Question
You are designing a security system for a high-tech company that uses facial recognition
technology to grant access to their building. The system has three layers of security. The first
layer requires the user to input a unique 6-digit code. There are 10 options (0-9) for each digit, so
the total number of possible codes is 10^6 = 1,000,000. The second layer requires the user to
input a unique 4-digit PIN. There are 10 options (0-9) for each digit, so the total number of
possible PINs is 10^4 = 10,000. The third layer requires the user to scan their face. The company
has a database of 1,000 employee faces, so there are 1,000 possible faces that the system could
recognize.
a) How many different ways are there to enter the code, PIN, and face in any order? (This is
a counting principle problem.)
b) How many different ways are there to enter the code, PIN, and face in a specific order
(code first, PIN second, face third)? (This is a permutation problem.)
c) How many different ways are there to enter the code, PIN, and face if the order does not
matter (for example, the system recognizes the face as long as it is entered last)? (This is
a combination problem.)
11
3.2 Solution
a) For the first sub-question, we are looking for the total number of possible combinations
of the three layers of security. We can use the counting principle of multiplication to find
the total number of combinations. The total number of combinations is 1,000,000 *
10,000 * 1,000 = 1,000,000,000,000.
b) For the second sub-question, we are looking for the number of ways to enter the code,
PIN, and face in a specific order. We can use the formula for permutations to find the
total number of combinations. The total number of combinations is (1,000,000 * 10,000 *
1,000) / (3!) = 166,666,667.
c) For the third sub-question, we are looking for the number of ways to enter the code, PIN,
and face if the order does not matter. We can use the formula for combinations to find the
total number of combinations. The total number of combinations is (1,000,000 * 10,000 *
1,000) / [(3! * 2!) * (1!)] = 83,333,333.5.
12
3.3 Summary
a) How many different ways are there to enter the code, PIN, and face in any order? (This is
a counting principle problem.)
1,000,000,000,000 ways
b) How many different ways are there to enter the code, PIN, and face in a specific order
(code first, PIN second, face third)? (This is a permutation problem.)
166,666,667 ways
c) How many different ways are there to enter the code, PIN, and face if the order does not
matter (for example, the system recognizes the face as long as it is entered last)? (This is
a combination problem.)
83,333,333.5 ways
13
14