HW1
.pdf
keyboard_arrow_up
School
University of Illinois, Urbana Champaign *
*We aren’t endorsed by this school
Course
361
Subject
Computer Science
Date
Feb 20, 2024
Type
Pages
8
Uploaded by SuperStrawNewt36
University of Illinois, Urbana-Champaign
CS 361
Homework #1
Esther Hwang
January 26, 2024
Question 1
a) As median score is 9 and mean is 10.
(x1 + x2 + x3 + x4 + x5)/5 = 10.
x1 + x2 + x3 + x4 + x5 = 50.
9 + 9 + 9 + x4 + x5 = 50
x4 + x5 = 23
x4 and x5 should be more than 9.
(9 + 9 + 9 + 11 + 12)/5 = 10 and the median is 9.
The minimum possible top score is 12 b) The lowest student can be 0 so x1 and x2 can be 0.
x4 + x5 = 41
0, 0, 9, 9, 32
The maximum of the possible top score is 32.
c) Standard deviation of 9, 9, 9, 11, 12 is sqrt(((9-10)**2 +(9-10)**2 + (9-10)**2 + (11-10)**2 + (12-
10)**2)/4) = 1.4142
d) Standard deviation of 0, 0, 9, 9, 32 is sqrt(((0-10)**2 +(0-10)**2 + (9-10)**2 + (9-10)**2 + (32-10)**2)/4)
= 13.0958
Page 1
University of Illinois, Urbana-Champaign
CS 361
Question 2
a) Fx, (z) = Pr(Xs,
z)
differentiating this above function allows fx,(z) = d/dz Fx,(z)
= d/dz Fx (oz+ u)
=e**(-z*2/2)/sqrt(2pi)
it allows Xs similar to N(0, 1)
b) Median is -1 and it shows how it can be positively or right-skewed because the mean will be at the right
side of the median that has -1.
Page 2
University of Illinois, Urbana-Champaign
CS 361
Figure 1: Q3-b
Figure 2: Q3-c
Question 3
a) Based on the IQR calculation, there are no outliers in this dataset of cost and number of megawatts.
b) Mean : 461.5603125, Standard deviation 170.12066957318333
c) Mean :0.569735439641486, Standard deviation :0.1871243018960576
d) Code below
Figure 3: Q3-d(1)
Page 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Given: Mini-Sudoku 4x4
Assume the following numbers are place in the following cells:
C12 = 4
C24 = 1
C31 = 2
C42 = 3
If number 1 is place in cell C11 at the 2nd iteration, what cell is the next number 1 place?
C14
C13
C11
C23
C22
C21
C34
C33
C32
C44
C43
C41
arrow_forward
Evaluate the following quantities:
Blank 1
a)ɛ
E
132 131
b) δδ –δ δ Blank 2
33 21
31 23
Blank 3
c) E E
231 113
Blank 1
Blank 2
Blank 3
Add your answer
Add your answer
Add your answer
arrow_forward
2. Write a program in C to check Armstrong and perfect numbers using the function.
Test Data:
Input any number: 371
Expected Output:
The 371 is an Armstrong number.
The 371 is not a Perfect number
arrow_forward
ISBN-13 is a new standard for identifying books. It uses 13 digits d1d2d3d4d5d6d7d8d9d10d11d12d13. The last digit d13 is a checksum, which is calculated from the other digits using the following formula:
10 - (d1 + 3d2 + d3 + 3d4 + d5 + 3d6 + d7 + 3d8 + d9 + 3d10 + d11 + 3d12)%10
If the checksum is 10, replace it with 0. Your program should read the input as a string.
arrow_forward
1. You need to take a trip by car to another town that you have never visited before.
Therefore, you are studying a map to determine the shortest route to your destination.
Depending on which route you choose, there are five other towns (call them A, B, C,
D, E) that you might pass through on the way. The map shows the mileage along each
road that directly connects two towns without any intervening towns. These numbers
are summarized in the following table, where a dash indicates that there is no road
directly connecting these two towns without going through any other towns.
Miles between Adjacent Towns
Town
A
B
C
D
E
Destination
Origin
40
60
50
A
10
65
B
10
20
55
40
20
50
65
55
10
60
E
40
50
10
80
Formulate this problem as a shortest-route problem and find the shortest path.
arrow_forward
Problem:
Assume that you have been hired at Oman Investment and Finance Co. SAOG (OIFC) to write a java
program that prints a summary of customers' bills for water and electricity. Each bill has type, account
number, consumption amount (kilowatt/gallon) and the month of the bill. Each bill charges an amount
of 16.78 OMR as supply service charges. Electricity bill is either industrial or residential. The electricity
total energy charge is computed based on the type of the usage. For industrial each kilowatt consumed
costs 12 Baisa while for residential it costs 10 Baisa per kilowatt consumed. The total amount is the
sum of the energy charges plus the bill charges. Water bill applies different rates based on the water
consumption where the first 5000 gallons cost 2 Baisa per gallon and any gallon more than 5000 costs
2.5 Baisa. Water bill also includes sewage charges which is one third the water charges. The total
amount is the sum of the water charges, sewage charges and the bill…
arrow_forward
An elementary school student, Jake, receives his standardized test scores. Jake gives
his parents the score sheet. Jake's math score is in the 82nd percentile. This score
indicates to the parents that:
a. 82% of observations lie at or below the score
b. 18% of observations lie at or below the score
C. 82 observations lie below the score
d. 18 observations lie below the score
arrow_forward
Find the h °g and g °h for following:
a. If g(x) = Vx – 4 and h(x) = x³ + 4
b. If g(x) = x² +1 and h(x) = x +2
arrow_forward
Output for Sample Input 1
3+
Copy
arrow_forward
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Note: 200 is not a valid auxiliary highway because 00 is not a valid primary highway number.
Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.
Ex: If the input is: 90
the output is: I-90 is primary, going east/west.
Ex: If the input is: 290
the output is: I-290 is auxiliary, serving I-90, going east/west.
Ex: If the input is: 0
the output is: 0 is not a valid interstate highway number.
Ex: If the input is: 200
the output is: 200 is not a valid interstate highway number.
arrow_forward
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Note: 200 is not a valid auxiliary highway because 00 is not a valid primary highway number.
Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.
arrow_forward
Python Programming: Option Pricing Using Monte Carlo Simulation
arrow_forward
Lab 3
Periodic compounding
The total accumulated value, including the principal sum P, is given by the formula:
where:
nt
A = P(1+1) n²
●
●
●
●
A is the final amount Accumulated Value
P is the original principal sum
r is the nominal annual interest rate
n is the compounding frequency
t is the overall length of time the interest is applied (expressed using the same time units as r, usually years).
(https://en.wikipedia.org/wiki/Compound_interest)
Using the above formula write a program that will display the following table.
Principal-Value | Times-Interest-Compunded | Annual-Int-Rate | Term | Accumulated-Value
1000
6.00%
10
3.20%
15
2000
3000
9.25%
10
1
2
4
|
You must use exponent operator to compute P
Exponent Operator in Python is **
1790.85
3219.89
7486.33
arrow_forward
Write the normalization formulas 1FN, 2FN, 3FN
for the following table
مثال ليكن لدينا هذا التصميم البدائي لجدول أبناء الموظفين
Employees
id
Name
children
birth_date
1001
John Doe
Betty, Frank
2-2-88, 4-22
.4-3-90
1002
Jane Doe
Betty, Frank
2-2-88, 4-3-90
Freda Fish
Henry, Jane,
Jill, Bill
1003
44-79, 2-8-84,
7-9-88, 10-3-90
Bill Bass
Hank, April,
Ellen
54-89, 9-9-94,
1004
7-10-98
arrow_forward
A student keeps a record of how the number of times they access their mobile phone on each day of a particular week, and they record the following values
arrow_forward
1
arrow_forward
Mattings
View
Tell me what you w to do
165
M-
AlloCel AaBbCd AaBbC AaBbce AaB ABCD ABOCED A08bCD AaBbCcD ABBCCD AnBbCcl B
1 Normal No low
eping ding 1
Tile
Suositte
Subia Em Loginsess
Qu
1
Q1) If y₁ =sin(x), y2 = cos(x), y₁ = tan(x), where -
arrow_forward
Computer Science
MIPS assembly language program using Procedure to find the grade of a student, given the marks of Final (30%), Midterm (20%), quizzes and homework (25%), and projects (25%). Given the marks of above 4 out of 100 points, we have to print the grade of a student based on the following grade slab.
1. Percentage > 90, grade is an A
2. If 80
arrow_forward
Credit card numbers follow certain patterns: It must have between 13 and 16 digits, and the number must start with:■ 4 for Visa cards■ 5 for MasterCard credit cards■ 37 for American Express cards■ 6 for Discover cards
In 1954, Hans Luhn of IBM proposed an algorithm for validating credit card numbers. The algorithm is useful to determine whether a card number is entered correctly or whether a credit card is scanned correctly by a scanner. Credit card numbers are generated following this validity check, commonly known as the Luhn check or the Mod 10 check, which can be described as follows (for illustration, consider the card number 4388576018402626):
1. Double every second digit from right to left. If doubling of a digit results in a two-digit number, add up the two digits to get a single-digit number.
2. Now add all single-digit numbers from Step 1.
3. Add all digits in the odd places from right to left in the card number.
4. Sum the results from Steps 2 and 3.
5. If the result from…
arrow_forward
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go
east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-
405 services 1-5, and I-290 services 1-90. Note: 200 is not a valid auxiliary highway because 00 is not a valid primary highway number.
Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also
indicate if the (primary) highway runs north/south or east/west.
Ex: If the input is:
90
the output is:
I-90 is primary, going east/west.
Ex: If the input is:
290
the output is:
I-290 is auxiliary, serving I-90, going east/west.
Ex: If the input is:
0
the output is:
0 is not a valid interstate highway number.
Ex: If the input is:
200
the output is:
200 is not a valid interstate highway number.
See Wikipedia for more info on highway numbering
arrow_forward
Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go
east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, 1-405
services 1-5, and 1-290 services 1-90. Note: 200 is not a valid auxiliary highway because 00 is not a valid primary highway number.
Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also
indicate if the (primary) highway runs north/south or east/west.
Ex: If the input is:
90
the output is:
I-90 is primary, going east/west.
Ex: If the input is:
290
the output is:
I-290 is auxiliary, serving I-90, going east/west.
Ex: If the input is:
0
the output is:
0 is not a valid interstate highway number.
Ex: If the input is:
200
the output is:
200 is not a valid interstate highway number.
arrow_forward
Computer Science
arrow_forward
SN= 0194906
use maple please
arrow_forward
Figure 3.1 shows an example of book loans information in a secondary school library.
BookLoans
StulD
S001
S002
5002
S003
5001
(a)
(i)
(ii)
BookCode StartDate
(iii)
EndDate
12/06/2022 22/06/2022
BC111
BC333 01/06/2022 11/06/2022
09/07/2022 19/07/2022
BC222
BC333
15/07/2022 25/007/2022
BC444 21/07/2022 01/08/2022
Book
BookCode
BC111
BC222
BC333
BC444
Student
StudentID
5001
S002
S003
BookName Quantity
Sejarah T3 12
Matematik 20
T5
English T5
Bahasa
Melayu T3
studentName
Jasmine
Michael
Brian
10
15
Figure 3.1 Sample Records from Book Loans
Figure 3.1 shows the tables in a book loans database that have been
normalized to the Third Normal Form (3NF) with three entities namely
BookLoans, Book and Student.
Draw the original table in the First Normal Form (INF).
Based on the answer in Q3(a)(i), identify the primary key of the
relation.
Classroom
3 Berlian
5 Intan
5 Delima
Based on the answer in Q3(a)(i), draw the dependency diagram
showing all dependencies in the relation.
arrow_forward
Let a DFA M = (Q, E, 8, 9,, F) as shown in below figure.
93
9,
arrow_forward
Let A = |2153|. If A-1 = |abcd|, then a + b + c + d =
arrow_forward
* 7 = 6 + 2 → 12 = 7 + 5
true
False
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Related Questions
- Given: Mini-Sudoku 4x4 Assume the following numbers are place in the following cells: C12 = 4 C24 = 1 C31 = 2 C42 = 3 If number 1 is place in cell C11 at the 2nd iteration, what cell is the next number 1 place? C14 C13 C11 C23 C22 C21 C34 C33 C32 C44 C43 C41arrow_forwardEvaluate the following quantities: Blank 1 a)ɛ E 132 131 b) δδ –δ δ Blank 2 33 21 31 23 Blank 3 c) E E 231 113 Blank 1 Blank 2 Blank 3 Add your answer Add your answer Add your answerarrow_forward2. Write a program in C to check Armstrong and perfect numbers using the function. Test Data: Input any number: 371 Expected Output: The 371 is an Armstrong number. The 371 is not a Perfect numberarrow_forward
- ISBN-13 is a new standard for identifying books. It uses 13 digits d1d2d3d4d5d6d7d8d9d10d11d12d13. The last digit d13 is a checksum, which is calculated from the other digits using the following formula: 10 - (d1 + 3d2 + d3 + 3d4 + d5 + 3d6 + d7 + 3d8 + d9 + 3d10 + d11 + 3d12)%10 If the checksum is 10, replace it with 0. Your program should read the input as a string.arrow_forward1. You need to take a trip by car to another town that you have never visited before. Therefore, you are studying a map to determine the shortest route to your destination. Depending on which route you choose, there are five other towns (call them A, B, C, D, E) that you might pass through on the way. The map shows the mileage along each road that directly connects two towns without any intervening towns. These numbers are summarized in the following table, where a dash indicates that there is no road directly connecting these two towns without going through any other towns. Miles between Adjacent Towns Town A B C D E Destination Origin 40 60 50 A 10 65 B 10 20 55 40 20 50 65 55 10 60 E 40 50 10 80 Formulate this problem as a shortest-route problem and find the shortest path.arrow_forwardProblem: Assume that you have been hired at Oman Investment and Finance Co. SAOG (OIFC) to write a java program that prints a summary of customers' bills for water and electricity. Each bill has type, account number, consumption amount (kilowatt/gallon) and the month of the bill. Each bill charges an amount of 16.78 OMR as supply service charges. Electricity bill is either industrial or residential. The electricity total energy charge is computed based on the type of the usage. For industrial each kilowatt consumed costs 12 Baisa while for residential it costs 10 Baisa per kilowatt consumed. The total amount is the sum of the energy charges plus the bill charges. Water bill applies different rates based on the water consumption where the first 5000 gallons cost 2 Baisa per gallon and any gallon more than 5000 costs 2.5 Baisa. Water bill also includes sewage charges which is one third the water charges. The total amount is the sum of the water charges, sewage charges and the bill…arrow_forward
- An elementary school student, Jake, receives his standardized test scores. Jake gives his parents the score sheet. Jake's math score is in the 82nd percentile. This score indicates to the parents that: a. 82% of observations lie at or below the score b. 18% of observations lie at or below the score C. 82 observations lie below the score d. 18 observations lie below the scorearrow_forwardFind the h °g and g °h for following: a. If g(x) = Vx – 4 and h(x) = x³ + 4 b. If g(x) = x² +1 and h(x) = x +2arrow_forwardOutput for Sample Input 1 3+ Copyarrow_forward
- Primary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Note: 200 is not a valid auxiliary highway because 00 is not a valid primary highway number. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west. Ex: If the input is: 90 the output is: I-90 is primary, going east/west. Ex: If the input is: 290 the output is: I-290 is auxiliary, serving I-90, going east/west. Ex: If the input is: 0 the output is: 0 is not a valid interstate highway number. Ex: If the input is: 200 the output is: 200 is not a valid interstate highway number.arrow_forwardPrimary U.S. interstate highways are numbered 1-99. Odd numbers (like the 5 or 95) go north/south, and evens (like the 10 or 90) go east/west. Auxiliary highways are numbered 100-999, and service the primary highway indicated by the rightmost two digits. Thus, I-405 services I-5, and I-290 services I-90. Note: 200 is not a valid auxiliary highway because 00 is not a valid primary highway number. Given a highway number, indicate whether it is a primary or auxiliary highway. If auxiliary, indicate what primary highway it serves. Also indicate if the (primary) highway runs north/south or east/west.arrow_forwardPython Programming: Option Pricing Using Monte Carlo Simulationarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks ColeC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr