2023F T4 with solutions Q
.pdf
keyboard_arrow_up
School
University of Toronto *
*We aren’t endorsed by this school
Course
PHL245
Subject
Computer Science
Date
Jan 9, 2024
Type
Pages
3
Uploaded by BailiffMosquito3073
For questions 1-5, symbolize the sentence using the provided abbreviation scheme. Each question is worth 4 points. 1.
Aviva’s father is not Yoona’s best friend, but he (Aviva’s father) is loved by all the kids in the neighborhood. A
1
: {1} is a kid. B
2
: {1} is in {2}. L
2
: {1} is loved by {2}. a
0
: Aviva. d
0
: Yoona. g
0
: The neighborhood. b
1
: The best friend of {1}. f
1
: The father of {1}. f(a)
≠b(d) ∧ ∀x(Ax∧B(x
g
)→L(f(a)x
)) (Ax→(B(x
g
)→L(f(a)x
))) NOTE: You can use b(d) instead of f(a) in the L predicate NOTE: You cannot put the inequality within the scope of the universal 2.
Some person in Toronto doesn’t like any radio stations broadcasted from Buffalo. A
1
: {1} is a person. D
1
: {1} is a radio station. F
2
: {1} is in {2}. G
2
: {1} is broadcasted from {2}. L
2
: {1} likes {2}. a
0
: Toronto. b
0
: Buffalo ∃x(Ax∧F(xa)∧∀y(Dy∧G(yb)→~L(xy))
) →(G(yb)→
~∃y(Dy∧G(yb)∧L(xy))
NOTE: In this form you can introduce the radio stations �irst
3.
Everyone enrolled in PHL245 other than Ming drinks a cup of coffee in the morning. A
1
: {1} is a person. D
1
: {1} is a cup of coffee. B
2
: {1} is enrolled in {2}. F
2
: {1} drinks {2} in the morning. g
0
: Ming. h
0
: PHL245. ∀x(Ax∧B(xh)∧x
≠
g→∃y(Dy∧F(xy))) ∧ Ag∧B(gh) Brackets around this part are optional NOTE: This is technically ambiguous. You can start this with the ∃ for the coffee, and it will then mean that everyone other than Ming drinks the SAME cup of coffee. We will accept that.
4.
Steve doesn’t like gardens unless there are at least two �lowers in them. F
1
: {1} is a �lower. G
1
: {1} is a garden. L
2
: {1} likes {2}. M
2
: {1} is in {2}. a
0
: Steve. ∀x(Gx → (∼ L(ax) ∨ ∃y∃z(Fy ∧ Fz ∧ y≠ z ∧ M(yx) ∧ M(zx)))) ∀x(Gx ∧ L(ax) → ∃y∃z(Fy ∧ Fz ∧ y≠z ∧ M(yx) ∧ M(zx)))
∀x(Gx →(L(ax)→
∀x(Gx→ (~AT LEAST TWO→~L(ax)))
∀x(Gx∧~AT LEAST TWO → ~L(ax))
5.
The slowest car on the 401 has at least one chip in its windshield. A
1
: {1} is a chip. D
1
: {1} is a car. B
2
: {1} is on {2}. F
2
: {1} is slower than {2}. L
2
: {1} is in the windshield of {2}. a
0
: The 401. ∃x(Dx∧B(xa)∧∀y(Dy∧B(ya)∧x≠y→F(xy))∧∃z(Az∧L(zx)))
Can swap things around lots. Be careful of scope errors. Biconditional Form: ∃x(∀y(Dy∧B(ya)↔x=y)∧∃z(Az∧L(zx)))
6.
Translate the following symbolic sentence into an IDIOMATIC English sentence using the abbreviation scheme provided. (4) ∀x(Ax∧B(xf)∧D(xa)→∀y(Ay∧B(yf)∧D(ya)→∀z(Az∧B(zf)∧D(za)→z=x∨z=y)))
A
1
: {1} is a song. B
2
: {1} is on {2}. D
2
: {1} is despised by {2}. a
0
: Rheya. f
0
: The kid’s playlist. At most two songs on the kid’s playlist are despised by Rheya. Rheya despises at most two…
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
Whoever must play, cannot play def subtract_square(queries):
Two players play a game of "Subtract a square", starting with a positive integer. On their turn to play, each player must subtract some square number (1, 4, 9, 16, 25, 36, 49, ...) from the current number so that the result does not become negative. Under the normal play convention of these games, the player who moves to zero wins, leaving his opponent stuck with no possible moves. (In the misère version of the game that has otherwise identical rules but where you win by losing the original game, these definitions would be adjusted accordingly.)
This and many similar combinatorial games can be modelled with recursive equations. This game is an example of an impartial game since the moves available to both players are exactly the same, as opposed to “partisan games” such as chess where each player can only move pieces of one colour. A game state is therefore determined by the remaining number alone, but not by which player has…
arrow_forward
in a shop ,there are 10 employee and 20 kinds of goods,goods id between 1-20
EMPLOYEE id first name last name gender
10001, 'Tom', 'Brown', 'F'10002, 'Elizabeth', 'Tremblay', 'F'10003, 'Gladys', 'Julie', 'F10004, 'John', 'Taylor', 'M10005, 'Amelia', 'Smith'10006, 'Logan', 'Katherine'10007, 'Leo', 'Brown'10007, 'Lem', 'Thompson'10009, 'Tom' 'Smith'10010, 'Emma', 'Campbell'
------------
and I want to add a name library in it ,like this
how could i create a HTML file ,with will randomly create customers with these employee .
there is a start button on the page .
press "start "bottom ,and it will It will randomly match 10 items, customers, and goods, display goods id ,customername and gender ,employer name , id and gender .
how to do such a page ?
arrow_forward
The following is a table of applicants to be considered for admission into 07BSAM:
POINTS
MATH
SYMBOL
123
450
NAMES
STUDENT
NUMBER
ENG SYMBOL
To qualify for admission, an applicant should have at least 25 points, minimum of B symbol in
Mathematics and a minimum of E symbol in English. If an applicant has a C symbol in Mathematics,
then the applicant must pass an entrance test to be considered for admission.
Hints:
There are three modes of study: The Full-time mode, the Part-time mode and the Distance mode.
Applicants can choose which mode they want provided there is space in that mode. Each of the Full-
time and the Part-time modes cannot accommodate more 30 admitted students. After these two
modes are full, every other qualified applicant is admitted in the Distance mode. The admission
exercise is first come first served.
Write a pseudocode that identifies the applicants that qualify for admission and outputs their names,
student numbers and modes of study. Use a FOR-LOOP /…
arrow_forward
¥ Question Completion Status:
Given a truth table below with the first two columns of truth values provided:
b.
(p.q)
1
2
T F
4.
Which of the answers below contains the truth values for the third column when
f(p,q) = p q ?
Column 3
Column 3
Column 3
truth values:
Column 3
truth
Column 3
truth values:
truth values:
truth values:
values:
1 T
1 F
1 F
1 F
1 T
None of the other answers
O 2 F
O 2 T
2 T
2 T
provided is correct.
2 F
3 F
3 F
3 T
3 T
3 F
4 T
4 F
4 T
4 F
4 T
Save All Answers
Save and Su
Click Save and Submit to save and subrmit. Click Save All Answers to save all answers.
0 日
la
(99+
here to search
3.
arrow_forward
The histogram chart below has a single bar for every state in the United States. Each state is placed in a bucket, or range, based on its area in square miles.
Count of States by Area in Square Miles
24
Area
(Square
Miles)
(count)
18
12
50,000
100,000
150,000
200,000
Which of the following conclusions is BEST supported by the histogram chart?
More than half of all states are smaller than 50,000 square miles
B The most common size of states is between 50,000 and 100,000 square miles
© Some states are larger than 200,000 square miles
D More than half of all states are larger than 100,000 square miles
arrow_forward
A senior one learner has reported in her class and has settled on a desk . support: the classroom is arranged in rows and columns its big a class with each learner having his or her own desk.resource: knowledge of horizontal and vertical lines is rows and columns coordinates. Knowledge: counting numbers task:the mathematics teacher has asked her to explain how she can access her seat, starting from the entrance of the class. Discuss whether there are other ways of reaching her seat.
arrow_forward
Question Completion Status:
QUESTION 7
Given a truth table below with the first two columns of truth values provided:
d.
b.
f(p.q)
1 T
T.
2 T
3 F
4 F F
Which of the answers below contains the truth values for the third column when
f(p,q) = (p vq)e (pa)?
Column 3
truth values:
Column 3
truth values:
Column 3
truth values:
Column 3
truth values:
Column 3,
truth
values:
1 F
1 T
1 F
1
None of the other
1 F
O 2T
|O 2 F
2 T
O answers provided is
2 T
2 T
correct.
3 T
3 T
3 F
3 F
3 T
4 T
4 F
4 F
4 T
4 F
Click Save and Submit to save and sub7mit. Cick Save All Answers to save all answers.
Save All A
O Type here to search
0 日
a
+66
arrow_forward
Display all the student names whose grade is C.
Display the Section-Identifier and Course-name whose Course-number is “MATH2410”.
Display the Student Name and the Course Name in which he has got “A” grade.
arrow_forward
Kevin plans to use a Boolean operator since he wants to learn about two distinct topics. Kevin has to use the right Boolean operator while doing a search if he wants accurate results.
arrow_forward
The box plots show student results in Maths and Science test scores.
What is the lowest mark in the Science test?
Compare the distribution of the marks in the Maths test and marks in theMaths test.
arrow_forward
Task 4
Assume, you have been given a tuple with details about books that won the Good Reads Choice Awards.
book_info = (
("Best Mystery & Thriller","The Silent Patient",68821),
("Best Horror","The Institute", 75717),
("Best History & Biography","The five",31783 ),
("Best Fiction", "The Testaments",98291)
Write a Python program that prints the award category, the book name, and its total votes earned as shown below.
[Must use Tuple unpacking for printing and need to handle the quotation marks as a part of the output]
Output:
The Silent Patient won the 'Best Mystery & Thriller' category with 68821 votes
The Institute won the 'Best Horror' category with 75717 votes
The five won the 'Best History & Biography' category with 31783 votes
The Testaments won the 'Best Fiction' category with 98291 votes
arrow_forward
The InstantRide Driver Relationship team wants to learn how many travels each driver has done in the month of October. You need to send them the DRIVER_ID, and two calculated columns: DAY and RIDES. The DAY column is calculated using the DAY() function with the TRAVEL_START_TIME as the argument. The RIDES column is calculated by using the COUNT() function to determine the number of rides given for each day. Filter the results with the MONTH function.
arrow_forward
Company Dinner
Lili works part-time in a restaurant near her campus as a waitress. One day, a boss from a company down the street decided to hold a company dinner in the restaurant she worked at. Before the dinner, the food is arranged in a sorted order A according to their type. Moments later, the manager of the restaurant confronted Lili and asks Q questions, each one asks how many foods of type Bi are there. Lili has asked you as her friend to help her count and answer as fast as possible.
Format Input
A single line with two integers N and Q denoting the number of food and the number of question respectively, followed by a line containing N elements denoting the type of the foods and another Q lines each containing a single integer denoting the number of occurrences of the type of food asked by the manager.
Format Output
Q lines each with a single integer denoting the number of occurence of Bi
in A.
Constraints
• 1 ≤ N, Q ≤ 10^5
• 1 ≤ Ai, Bi ≤ 10^9
• Ai ≤ Aj for all 1 ≤ i ≤ j ≤ N…
arrow_forward
Question 03:
Write a simplified sinmulation of Ping-Pong according to the following rules:
• Ranks 0 and 1 participate
• Rank 0 starts with the ball
• The rank with the ball sends it to the other rank
Both ranks count the number of times they get the ball
After counting to 1 million, the rank gives up
• There are no misses or points
arrow_forward
Get the regular expression for 3 questions
arrow_forward
SQL Data Manipulation
Consider the following tables with sample data:
Hospital (hospitalNo, name, address, city, capacity)
Doctor
(doctorNo, name, specialty, salary, hospitalNo)
Patient (patientNo, name, phoneNo, age, doctor)
Hospital
hospitalNo
city capacity
address
1493 Cambridge St Boston
2 East 101st St New York 700
name
H117
Cambridge
600
H120
Mount Sinai
*******E
潮
...***
Doctor
cpecialty salary hospitalNo
| 180000
| 225000 H120
doctorNo
name
D201
Cardiologist
Robert Donald
Xin Wang
H117
D205
Neurologist
林
******
淋 琳
業
Patient
patientNo
P366
name phoneNo
Arthur Gluck
age doctor
D201
72
617-482-5801
P351
Lisa Hershman
212-353-1463 46
D205
Perform the following tasks using SQL statements:
arrow_forward
Question 64
arrow_forward
5)ln cell G9, write a formula to determine if any
of the bidders has a True value for Rule 1. Copy
the formula across the row to analyze the
remaining rules.
6)ln cell G10, write a formula to determine if
none of the bidders has a True value for Rule 1.
Copy the formula across the row to analyze the
remaining bidders. Copy the formula across the
row to analyze the remaining rules.
PO 527 Bidder List Financial Evaluation
D&B
Composite
Credit
Previous
D&B D&B Stress
Experience Net Worth Appraisal PAYDEX Risk Class
Grade
(Dollars)
Ribba Technology Satisfactory $ 5,000,000
286,000
Bidder List
(1 Best) (100 Best) (1 Best)
89
79
Rule 1 Rule 2 Rule 3
1
False
False
True
False
True
TDR Corporation Satisfactory
ComputerX Assoc. Satisfactory
Exceed WR
Roberts Inc.
True
True
True
True
2
False
4,560,000
1,089,000
True
False
93
None
45
3
2
Unsatisfactory 23,459,000
68
False
False
False
312N
arrow_forward
Task 4:
You have been given a spreadsheet that contains details of invoices. The column headers for the
spreadsheet are:
date, invoice number, invoice amount, invoice tax, invoice total, cust number, cust name, cust street, cust
city, cust state, cust postal code, cust nation, product code, product price, product quantity, salesrep
number, salesrep first name, salesrep last name, salesrep district, district name, and district size.
Create a high fidelity data model. In other words, list the set of tables (=entities) with their respective
column headers. If easier, and alternatively, you can draw an ERD diagram. (Optional: Add some sample
data).
arrow_forward
The expression =IF(A1 > 12, 3*A1, 6*A1) is used in a spreadsheet.Find the result if A1 is 2 Find the result if A1 is 13.
arrow_forward
SQL question help
arrow_forward
calculate_new_balance
Given a starting balance (a number), and a list of transaction tuples, calculate the final balance for an account. Transaction tuples are of the shape ("description", amount, "withdrawal") , or ("description", amount, "deposit"). The last entry in the tuple will be either "withdrawal" or "deposit". Every withdrawal decreases the balance of the account by the specified amount, and every deposit increases the balance. The return value is the new account balance, as a number. (which could be negative)
Sample calls should look like:
>>> calculate_new_balance(100, [("payday", 20, "deposit"), ("new shoes", 50, "withdrawal"), ("illicit winnings", 200, "deposit")])270>>> calculate_new_balance(100, [])100
arrow_forward
Which values are marked for deallocation after the sequence?
Integerobj1=newInteger(10);Integerobj2=newInteger(20);Integerobj3=obj2;Integerobj4=newInteger(40);obj2=null;obj4=obj1;
only 20
only 40
20 and 40
no values are marked for deallocation
Which expressions for XXX, YYY, and ZZZ output "Great job" for scores above 90, and "Nice try" otherwise? Choices are in the form XXX / YYY / ZZZ.
intscore;score=scnr.nextInt();if(XXX){System.out.println(YYY);}else{System.out.println(ZZZ);}
score < 91 / "Great job" / "Nice try"
score < 91 / "Nice try" / "Great job"
score > 90 / "Nice try" / "Great job"
(Not possible for given code)
The program should determine the largest integer seen. What should XXX be if the input values are any integers (negative and non-negative)? All variables are integers and have…
arrow_forward
A6. Suppose a farmer decided to keep individual records for the new cattle. His records show 4 bred heifers valued at $900; 5 cows valued at $1,000, and 1 bull valued at $2,000. Using the chart below, setup the individual records for each animal for year 1. Make sure that your animal ID for each type of animal is different, for example, bred heifers can start at 22-1, etc.; cows can start at 22- 01, and the bull can be 22-001.
arrow_forward
The following table is in 1NF. Convert it to 2NF using proper notation:Facilitator (FacilitatorID, LastName, FirstName, Street, City, ZipCode, (ForumNum, ForumDate, CustomerNum, LengthOfForum, PresentationCode))
arrow_forward
Complete questions 2-7
Note:
Complete questions 2-7 in part B of the Garden Glory Project on p.129 and 130 of the textbook (8th
edition).
There may be more than one service performed at a property on a given date. Use this information when you answer questions.
Comment on each question whether a given design is good and provide reasons for that. For example, the answer for Q1 is “This design is not appropriate because the designated Primary
Key (PK) (PropertyName) in the table cannot determine some other attributes of the same
table (e.g., ServiceDate, Description, Amount); in other words, the designated PK is not unique”. Your answers need to be specific and should clearly pinpoint the design problem with references to the relevant attributes in the table and the reason of violation. Any vague answer like “This design is bad because the PK is not good”, are wrong.
Note that the foreign keys are italicized instead of dashed underlined.
Clearly label answers for each question.…
arrow_forward
Explain the difference between the this keyword and the super keyword. When should each be used?
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Related Questions
- Whoever must play, cannot play def subtract_square(queries): Two players play a game of "Subtract a square", starting with a positive integer. On their turn to play, each player must subtract some square number (1, 4, 9, 16, 25, 36, 49, ...) from the current number so that the result does not become negative. Under the normal play convention of these games, the player who moves to zero wins, leaving his opponent stuck with no possible moves. (In the misère version of the game that has otherwise identical rules but where you win by losing the original game, these definitions would be adjusted accordingly.) This and many similar combinatorial games can be modelled with recursive equations. This game is an example of an impartial game since the moves available to both players are exactly the same, as opposed to “partisan games” such as chess where each player can only move pieces of one colour. A game state is therefore determined by the remaining number alone, but not by which player has…arrow_forwardin a shop ,there are 10 employee and 20 kinds of goods,goods id between 1-20 EMPLOYEE id first name last name gender 10001, 'Tom', 'Brown', 'F'10002, 'Elizabeth', 'Tremblay', 'F'10003, 'Gladys', 'Julie', 'F10004, 'John', 'Taylor', 'M10005, 'Amelia', 'Smith'10006, 'Logan', 'Katherine'10007, 'Leo', 'Brown'10007, 'Lem', 'Thompson'10009, 'Tom' 'Smith'10010, 'Emma', 'Campbell' ------------ and I want to add a name library in it ,like this how could i create a HTML file ,with will randomly create customers with these employee . there is a start button on the page . press "start "bottom ,and it will It will randomly match 10 items, customers, and goods, display goods id ,customername and gender ,employer name , id and gender . how to do such a page ?arrow_forwardThe following is a table of applicants to be considered for admission into 07BSAM: POINTS MATH SYMBOL 123 450 NAMES STUDENT NUMBER ENG SYMBOL To qualify for admission, an applicant should have at least 25 points, minimum of B symbol in Mathematics and a minimum of E symbol in English. If an applicant has a C symbol in Mathematics, then the applicant must pass an entrance test to be considered for admission. Hints: There are three modes of study: The Full-time mode, the Part-time mode and the Distance mode. Applicants can choose which mode they want provided there is space in that mode. Each of the Full- time and the Part-time modes cannot accommodate more 30 admitted students. After these two modes are full, every other qualified applicant is admitted in the Distance mode. The admission exercise is first come first served. Write a pseudocode that identifies the applicants that qualify for admission and outputs their names, student numbers and modes of study. Use a FOR-LOOP /…arrow_forward
- ¥ Question Completion Status: Given a truth table below with the first two columns of truth values provided: b. (p.q) 1 2 T F 4. Which of the answers below contains the truth values for the third column when f(p,q) = p q ? Column 3 Column 3 Column 3 truth values: Column 3 truth Column 3 truth values: truth values: truth values: values: 1 T 1 F 1 F 1 F 1 T None of the other answers O 2 F O 2 T 2 T 2 T provided is correct. 2 F 3 F 3 F 3 T 3 T 3 F 4 T 4 F 4 T 4 F 4 T Save All Answers Save and Su Click Save and Submit to save and subrmit. Click Save All Answers to save all answers. 0 日 la (99+ here to search 3.arrow_forwardThe histogram chart below has a single bar for every state in the United States. Each state is placed in a bucket, or range, based on its area in square miles. Count of States by Area in Square Miles 24 Area (Square Miles) (count) 18 12 50,000 100,000 150,000 200,000 Which of the following conclusions is BEST supported by the histogram chart? More than half of all states are smaller than 50,000 square miles B The most common size of states is between 50,000 and 100,000 square miles © Some states are larger than 200,000 square miles D More than half of all states are larger than 100,000 square milesarrow_forwardA senior one learner has reported in her class and has settled on a desk . support: the classroom is arranged in rows and columns its big a class with each learner having his or her own desk.resource: knowledge of horizontal and vertical lines is rows and columns coordinates. Knowledge: counting numbers task:the mathematics teacher has asked her to explain how she can access her seat, starting from the entrance of the class. Discuss whether there are other ways of reaching her seat.arrow_forward
- Question Completion Status: QUESTION 7 Given a truth table below with the first two columns of truth values provided: d. b. f(p.q) 1 T T. 2 T 3 F 4 F F Which of the answers below contains the truth values for the third column when f(p,q) = (p vq)e (pa)? Column 3 truth values: Column 3 truth values: Column 3 truth values: Column 3 truth values: Column 3, truth values: 1 F 1 T 1 F 1 None of the other 1 F O 2T |O 2 F 2 T O answers provided is 2 T 2 T correct. 3 T 3 T 3 F 3 F 3 T 4 T 4 F 4 F 4 T 4 F Click Save and Submit to save and sub7mit. Cick Save All Answers to save all answers. Save All A O Type here to search 0 日 a +66arrow_forwardDisplay all the student names whose grade is C. Display the Section-Identifier and Course-name whose Course-number is “MATH2410”. Display the Student Name and the Course Name in which he has got “A” grade.arrow_forwardKevin plans to use a Boolean operator since he wants to learn about two distinct topics. Kevin has to use the right Boolean operator while doing a search if he wants accurate results.arrow_forward
- The box plots show student results in Maths and Science test scores. What is the lowest mark in the Science test? Compare the distribution of the marks in the Maths test and marks in theMaths test.arrow_forwardTask 4 Assume, you have been given a tuple with details about books that won the Good Reads Choice Awards. book_info = ( ("Best Mystery & Thriller","The Silent Patient",68821), ("Best Horror","The Institute", 75717), ("Best History & Biography","The five",31783 ), ("Best Fiction", "The Testaments",98291) Write a Python program that prints the award category, the book name, and its total votes earned as shown below. [Must use Tuple unpacking for printing and need to handle the quotation marks as a part of the output] Output: The Silent Patient won the 'Best Mystery & Thriller' category with 68821 votes The Institute won the 'Best Horror' category with 75717 votes The five won the 'Best History & Biography' category with 31783 votes The Testaments won the 'Best Fiction' category with 98291 votesarrow_forwardThe InstantRide Driver Relationship team wants to learn how many travels each driver has done in the month of October. You need to send them the DRIVER_ID, and two calculated columns: DAY and RIDES. The DAY column is calculated using the DAY() function with the TRAVEL_START_TIME as the argument. The RIDES column is calculated by using the COUNT() function to determine the number of rides given for each day. Filter the results with the MONTH function.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage