Part 1 Prepare a complete year 2023 federal corporate tax return (Form 1120) for Acme Corporation, including all necessary schedules and attachments. Balance Sheet 1/1/24 12/31/24 Cash 40,000 600,000 Investments 60,000 Accounts Receivable 200,000 Equipment (less depreciation of $30,000) 40,000 Total Assets 40,000 900,000 Accounts Payable 260,000 Common Stock 40,000 40,000 Retained Earnings 600,000 Total Liab. And Equity 40,000 900,000 Income Statement Sales 4,000,000 Tax exempt interest 30,000 Dividends Received on Microsoft Stock 120,000 Salaries and Wages (2,800,000) Supplies and materials (180,000) Meals (50% deductible) (140,000) Depreciation (30,000) Charitable contributions (400,000) Book Income 600,000 Other Information ● You are the sole shareholder of Acme Corporation. ● Please note that the financial statements have already been issued using the information above and will not be amended. ● You formed Acme by contributing $40,000 to the corporation in return for 100 shares (i.e., 100%) of stock on 1/01/24. You named yourself to the role of President and every other officer position. Your Acme salary for the year 2024 was $500,000. (This is included in the salary amount reported on the income statement.) Running Acme is your full time job. ● Acme’s sole depreciable asset was equipment purchased on 7/01/24 for $70,000. For tax purposes, you will maximize the depreciation expense. ● Acme also received a 2024 K-1 for a partnership interest it owned during the year. The K-1 showed ordinary income of $80,000 and interest income of $10,000. No partnership income was recorded on the financial statements. ● Acme owns less than 1% of Microsoft stock outstanding. ● Acme has no cost of goods sold. ● Please make up appropriate non-financial information that is not included above (e.g., address, etc.). ● IRS forms can be obtained at: https://www.irs.gov/forms-instructions Part 2 Complete an entirely separate year 2024 tax return (Form 1120-S) for Acme Corporation where an S election was made 1/1/24. The information from the Tax Return Assignment (copied below) will be used to complete this separate S corporation tax return and is copied below. Balance Sheet 1/1/24 12/31/24 Cash 40,000 600,000 Investments 60,000 Accounts Receivable 200,000 Equipment (less depreciation of $30,000) 40,000 Total Assets 40,000 900,000 Accounts Payable 260,000 Common Stock 40,000 40,000 Retained Earnings 600,000 Total Liab. And Equity 40,000 900,000 Income Statement Sales 4,000,000 Tax exempt interest 30,000 Dividends Received on Microsoft Stock 120,000 Salaries and Wages (2,800,000) Supplies and materials (180,000) Meals (50% deductible) (140,000) Depreciation (30,000) Charitable contributions (400,000) Book Income 600,000 Other Information ● You are the sole shareholder of Acme Corporation. ● Please note that the financial statements have already been issued using the information above and will not be amended. ● You formed Acme by contributing $40,000 to the corporation in return for 100 shares (i.e., 100%) of stock on 1/01/24. You named yourself to the role of President and every other officer position. Your Acme salary for the year 2024 was $500,000. (This is included in the salary amount reported on the income statement.) Running Acme is your full time job. ● Acme’s sole depreciable asset was equipment purchased on 7/01/24 for $70,000. For tax purposes, you will maximize the depreciation expense. ● Acme also received a 2024 K-1 for a partnership interest it owned during the year. The K-1 showed ordinary income of $80,000 and interest income of $10,000. No partnership income was recorded on the financial statements. ● Acme owns less than 1% of Microsoft stock outstanding. ● Acme has no cost of goods sold. ● Please make up appropriate non-financial information that is not included above (e.g., address, etc.). ● IRS forms can be obtained at: https://www.irs.gov/forms-instructions
1. In this question you need to fix an error in each of two function designs. First, read the data definitions, then fix the error in Problem A, and then fix the error in Problem B. ## Data Definitions from cs103 import * from typing import NamedTuple, List Expense = NamedTuple('Expense', [('cost', int), # in range [0, ...) ('desc', str)]) # interp. an expense with its cost in whole Canadian dollars and its description E1 = Expense(120, 'textbook') E2 = Expense(4, 'coffee') # template based on compound def fn_for_expense(e: Expense) -> ...: return ... (e.cost, e.desc) # List[Expense] # interp. a list of expenses L0 = [] L1 = [E1, E2] # template based on arbitrary-sized and the reference rule def fn_for_loe(loe: List[Expense]) -> ...: # description of the acc acc = ... # type: ... for e in loe: acc = ... (fn_for_expense(e), acc) return acc a. [2 marks] When the following code is run, a typecheck error is generated. The error message is shown beneath the code. Fix the error by neatly editing the code. @typecheck def is_expensive(e: Expense) -> bool: """ return True if e cost more than $100, False otherwise """ #return False # body of the stub # template from Expense return e.cost > 100 @typecheck def num_expensive(loe: List[Expense]) -> int: """ return the number of expenses that cost over $100 """ #return 1 # body of the stub # template from List[Expense] # acc contains the number of the expenses over $100 seen so far acc = 0 # type: int for e in loe: if is_expensive(e.cost): acc = acc + 1 return acc start_testing() expect(is_expensive(E1), True) expect(is_expensive(E2), False) expect(is_expensive(Expense(99, "shoes")), False) expect(is_expensive(Expense(100, "gift")), False) expect(is_expensive(Expense(101, "theatre tickets")), True) expect(num_expensive([]), 0) expect(num_expensive([E1, E2]), 1) summary() b. [2 marks] When the following code is run, a TypeError is generated. The error messages are shown beneath the code. Fix the error by neatly editing the code. (You do not need to finish the incomplete function designs.) @typecheck def has_description(e: Expense, d: str) -> bool: """ return True if e's description is d, False otherwise """ return False # body of the stub @typecheck def match_description_only(loe: List[Expense], d: str) -> List[Expense]: """ return a list of expenses from loe that have the description d """ return [] # body of the stub start_testing() expect(has_description(E1, 'textbook'), True) expect(has_description(E1, 'text book'), False) expect(has_description(E2, 'textbook'), False) expect(match_description_only( [], ‘’ ), []) expect(match_description_only([E1, E2], 'textbook'), [E1]) summary() 2. [20 marks] For each statement below, circle whether you think it is true or false and write a brief justification explaining your choice. a. In a function design, the body of the stub returns the most likely return value. True False Justification: The body of the stub just has to match the return type in the signature. It doesn’t matter what value it is as long as the type matches. b. In a function design that has a bool return type, there should be at least two tests (one that expects True and one that expects False). True False Justification: We should test all possible values. c. Examples in the form. of expects are an important part of the How to Design Data Definitions recipe because they show programmers how to use data of that type. True False Justification: Expect calls are used in function designs. Data definitions need to have examples of what the data should look like. d. Assume I want my program to read information from a file, filter out the data that I don’t want to plot, and then plot the data on a line chart. The function composition given below calls the helper functions in the correct order. filter_data(plot_line_chart(read(filename))) True False Justification: plot_line_chart() and filter_data() are switched around. e. When a function design includes an accumulator, the accumulator type is always the same as the return type. True False Justification: The accumulator stores information that we will need in the final answer but there is no guarantee that it holds the actual answer to the question. For example, if my question took in a list and returned a bool indicating whether the list had more than five items that met a certain criteria, the accumulator could be an int counting the number of items that met the criteria but the actual return value of the function is a bool. f. When designing a function that takes an enumeration as input, you must copy the enumeration’s template and use it without changing the if/elif/else structure. True False Justification: We shouldn’t collapse the if/elif/else structure because it lowers readability. g. Functions cannot contain more than one return statement. True False Justification: You can have as many return statements as you want but when the function executes, the first return statement it encounters will be where the function ends. h. If the information that you are trying to represent are two distinct values that are opposites of each other, you should use an enum. True False Justification: A bool is a better representation. i. A test failure means that your code has syntax errors and does not run. True False Justification: It means that your expected value and actual value did not match up, not that your code cannot run. j. The template you should use in a function design depends on the type of its parameter. True False Justification: The type of parameter determines which data template we need to copy over. 3. [19 marks] You are building an online ordering app for Mercante, a pizza restaurant, and need to design data definitions for their menu items. You have their menu items in a .csv file. Here are the first few rows of the .csv file. Menu Item Category Cost Vegetarian margherita pizza food 8.95 Yes pizza bianca food 9.95 Yes alla salsiccia pizza food 9.95 No latte non-alcoholic beverage 4.00 Yes house red wine alcohol 8.50 Yes Mercante only has three categories of menu items that it sells (food, non-alcoholic beverage, alcohol). Design data definitions to represent all of the information as data in your program. Marking scheme Enum Data Definition (Category) • 1 for a meaningful name • 1 for data type definition • 1 for interpretation • 1 note that examples are redundant • 1 correct template • 1 correct template rules Compound Data Definition (MenuItem) • 1 for a meaningful name • 1 for data type definition • 1 necessary fields present • 1 fields have the right type • 1 for interpretation - must include units for amount • 1 for at least one correct example • 1 correct template • 1 correct template rules List Data Definition (List[MenuItem]) • 1 for data type definition and interpretation • 2 for at least two correct examples (one empty, one non-empty) • 1 for correct template • 1 for correct template rules 4. [9 marks] Design a data definition to represent the amount of snow at UBC on a particular day. Sometimes the amount of snow is unknown (e.g. the sensor wasn’t working that day). Snow = Optional[float] # in range[0, ...) # interp. the amount of snow on a particular day, measured in mm, or None # if the amount is unknown S1 = 4.5 S2 = None # template based on Optional def fn_for_snow(s: Snow) -> ...: if s is None: return ... else: return ... (s) Marking scheme Optional Data Definition (Snow) • 1 for a meaningful name • 1 for Optional data type • 1 for stating the range of the int or float • 2 for interpretation - must include units and a description of what None represents • 2 for at least two correct example (one must be the normal case and one must be the None case) • 1 correct template • 1 correct template rules 5. [2 marks] Give one concrete example of how the planning steps of the How to Design Analysis Programs recipe make building the program easier. • It forces you to take a look at the data that you have and the question you want to answer to determine what information you are lacking before you start. That way, you can plan accordingly to figure out a way to get all the pieces of information you need. • Writing down what you expect first will ensure that your program is actually doing what you want. When you program too much, sometimes you forget what you are trying to do. Having the planning steps first helps ensure that you have a clearly defined goal. 6. [7 marks] You want to go on vacation after your last exam and have been searching for airfares. You’ve been keeping the information in a .csv file and want to read it in to a program for analysis. Here are some of the airfares that you’ve found. Departure date Departure time Departure City Arrival Date Arrival Time Arrival city Price 20-Dec-17 14:53 YVR 21-Dec-17 14:00 CUN 339 20-Dec-17 22:00 YVR 21-Dec-17 16:59 CUN 473 20-Dec-17 8:05 YVR 21-Dec-17 17:22 HUX 516 This information is available in csv format in the file airfares.csv. Here are data definitions that can be used to represent the relevant parts of this information as data in your program. THE PROBLEM STATEMENT IS ON THE NEXT PAGE. from typing import NamedTuple, List from cs103 import * import csv Airfare = NamedTuple('Airfare', [('dept', str), ('arr', str), ('cost', float)]) # in range [0, ...) # interp. an airfare with its departure city, arrival city, and cost in CAD A1 = Airfare('YVR', 'CUN', 339.0) A2 = Airfare('YVR', 'CUN', 473.0) A3 = Airfare('YVR', 'HUX', 516.0) # template based on compound def fn_for_airfare(a: Airfare) -> ...: return ... (a.dept, a.arr, a.cost) # List[Airfare] # interp. a list of airfares L0 = [] L1 = [A1, A3, A3] # template based on arbitrary-sized and the reference rule def fn_for_loa(loa: List[Airfare]) -> ...: # description of the acc acc = ... # type: ... for a in loa: acc = ... (fn_for_airfare(a), acc) return acc Continuing Problem 6: Design a read function to read this information from a file and store it as data in your program. We have provided the read template and suggest that you neatly edit it rather than re-writing your read function. Assume that the information is in a file named “airfares.csv”. If you need to create another information file, you can draw a table that shows the information (as above) and label it with the filename. def read(filename: str) -> List[Consumed]: """ reads information from the specified file and returns ... """ # loc contains the result so far loc = [] # type: List[Consumed] with open(filename) as csvfile: reader = csv.reader(csvfile) next(reader) # skip header line for row in reader: # you may not need to store all the rows, and you may need # to convert some of the strings to other types c = Consumed(row[0], ... ,row[n]) loc.append(c) return loc Marking scheme • 1 – update return type • 1 – update purpose • 1 – update acc type • 2 – correctly update line that creates the Airfare (including call to parse_float) o 1 mark for correctly using parse_float instead of parse_int o 1 mark for using the correct column indicies • 2 – at least two correct examples 7. [13 marks] Perhaps you’ve been searching for a flight for your vacation for quite some time and have been tracking the cost of a particular flight over time. Every day you’ve searched for the best price and have saved that information in a .csv file that uses the same format as “airfares.csv”. Design a function that takes a list of airfares and plots the airfares over time on a line chart. You can assume that the airfares are in the order in which they should be plotted and that your x-axis values can just be the record numbers (1, 2, 3, etc.). You can assume that the function get_range (below) works correctly. (You must use the data definitions from Problem 6.) def get_range(n: int) -> List[int]: """ returns a list of integers from 1 to n """ # description of the accumulator acc = [] # type: List[int] count = 1 while count
MAT223H5S - Linear Algebra I - Winter 2025 Term Test 2 - Version A 1 1.1 (2 points) Let d = and a = . Determine whether or not d and a are orthogonal. 1.2 (3 points) Compute ||projd (a)||. Use d and a as above. You do not need to simplify fractions, roots, etc. 1.3 (1 point) Let T be a linear transformation with matrix AT = . What is the domain of T? (Is it R2 , R3 , or something else?) You do not need to justify your answer. 1.4 (4 points) Let A = Is d in im(A)? (Use d as on the previous page.) 2 2.1 (5 points) Find the equation of the plane through the points P = (1, 2, 3), Q = (−1, 9, −2), R = (1, 0, 4). Give your answer in the form. ax + by + cz = d. You should only use the methods taught to you in this course to solve this problem. In particular, do not apply any formulas or shortcuts from outside the course. 2.2 (5 points) Show that the function F : R2 → R2 given by is not a linear transformation. 3 3.1 (4 points) Show that the set U defined below is a subspace. As part of your answer, find a spanning set for U. 3.2 (6 points) Let For each of the three subspace axioms below, determine whether the set V satisfies it or not. In particular, if you think that V satisfies a given axiom, explain why. If you think that V does not satisfy a given axiom, give an example showing that. (1) 0 ∈ V. (2) For all u, v ∈ V, we have u + v ∈ V. (3) For all v ∈ V and t ∈ R, we have tv ∈ V. 4 Let T : R2 → R2 be the linear transformation which reflects across the line y = −2x and then stretches in the x and y directions, each by a factor of 5. You may assume that 4.1 (5 points) Sketch a single copy of R2 which contains the following: • e1, e2, T(e1) and T(e2), • The fundamental parallelogram for T (i.e. the image of the unit square under T), • The lines y = −2x and y = 2/1 x. Note: For the questions on this page, you must justify your answers using only geometric explanations explicitly relying on and referring to your drawing from the previous part, or to a new drawing. Algebraic work (e.g. computations involving AT) can be used to check your work, but will not be marked. 4.2 (2.5 points) Explain geometrically why your drawing from the previous part implies that neither e1 nor e2 is an eigenvector for AT. 4.3 (2.5 points) Determine two basic eigenvectors v1 and v2 for AT geometrically using your drawing from the first part of this question (You do not need to determine the eigenvalue(s) associated to those basic eigenvectors.) 5 (2.5 points each = 10 points) Determine if the statements below are true or false. Make sure to justify your answers! You will receive no credit for simply selecting “true" or “false", or providing little explanation. 5.1 True or False: Let A be an n × n matrix, and b ∈ Rn be arbitrary. Then the set of solutions to the system Ax = b is a subspace. 5.2 True or False: If a, b, c ∈ R3 and span{a, b, c} is a plane, then span{a, b} is also plane. 5.3 True or False: The system of equations below represents three planes in R3 that intersect in a line: 5.4 True or False: Suppose that U is a subset of R3 such that is in U, but and are not in U. Then U is not a subspace of R3 .
1. [4 marks] For each of the following code snippets, write the value that is stored by the variable on the last line after the code snippet has been run. Marking scheme: 1 mark per answer a. def times_three (x): return x * 3 n = 2 times_three(n) n 2 b. x = 2 y = 3 t = x x = y y = t y 2 c. def are_equal (x, y): return x == y x = 1 a = 3 y = 1 n = are_equal (a, y) n False d. a = 2 b = 3 a = b b = b + 1 a 3 2. [5 marks] When you’re designing a function that takes a user-defined type (i.e. a type that is defined by a data definition, not by Python), in which steps of the How to Design Functions recipe do you need to consult the data definition? For each step in which you do need to consult the data definition, which part(s) of the data definition are you consulting and why? Marking scheme: 1 mark per row Step Do you need to consult the data definition? (yes/no/it depends) Which part(s) of the data definition are you consulting? Why do you need to consult this part (or these parts)? signature yes type name and possibly the interpretation type name: to ensure that you’re using the correct name interpretation: to understand what information this data type represents purpose it depends interpretation In many cases you won’t need to consult the data definition, but may need to understand what information the data type represents when you write the purpose examples yes data type definition and/or examples data type definition: to see how to form. data examples examples: to check if you can use existing data examples in your function design and/or to see how to form data of this type template yes template to copy the template from the appropriate data definition function body no it’s unlikely that you’ll need to consult the data definition once you’re working on the function body because you’ll already have examples and the template, but you may want to go back to any part of the data definition to double check that your understanding of the type is correct 3. [7 marks] Design a function that takes two strings and returns True if they have the same length. Marking scheme: 2 marks for the correct signature (-1 per error) 1 mark for a clear and correct purpose 3 marks for tests (empty case, same length, different length) 1 mark for correctness 4. [18 marks] Your friend has decided to start tracking their expenses so that they can create a budget. Here are the first few rows of the .csv file that your friend has been using to track the expenses. Expense Category Payment Amount coffee food cash 1.95 theatre tickets entertainment credit card 88.40 rent bills cheque 580 groceries food debit card 54.10 There are many, many different categories (including ones not shown above) and your friend is likely to continue to create more categories over time. Your friend only uses cash, credit card, cheque, or debit card to pay for things. Design data definitions to represent all of the information as data in your program. Marking scheme Enum Data Definition (PaymentType) • 1 mark for the correct data type definition • 1 mark for the interpretation • 1 mark for the note about examples • 1 mark for the correct template • 1 mark for the correct note about origin of template Compound Data Definition (Expense) • 1 mark for a meaningful name • 1 mark for the correct data type definition • 1 mark for the necessary fields • 1 mark if the fields have the right type • 1 mark for interpretation - must include units for amount • 1 mark for at least one correct example • 1 mark for the correct template • 1 mark for the correct template rules List Data Definition (List[Expense]) • 1 mark for the correct data type definition and interpretation • 2 marks for at least two correct examples (one empty, one non-empty) • 1 mark for the correct template • 1 mark for the correct template rules from enum import Enum from typing import NamedTuple, List PaymentType = Enum('PaymentType', ['ca', 'cc', 'ch', 'dc']) # interp. a payment type that is either cash ('ca'), credit card ('cc'), cheque ('ch'), # or debit card ('dc') # examples are redundant for enumerations # template based on one of (4 cases), atomic distinct (4 times) def fn_for_payment_type(pt: PaymentType) -> ...: if pt == PaymentType.ca: return ... elif pt == PaymentType.cc: return ... elif pt == PaymentType.ch: return ... elif pt == PaymentType.dc: return ... Expense = NamedTuple('Expense', [('name', str), ('cat', str), ('payment', PaymentType), ('amount', float)]) # interp. an expense with a name, category ('cat'), payment type, and amount in CAD E1 = Expense('coffee', 'Food', PaymentType.ca, 1.95) E2 = Expense('theatre tickets', 'Entertainment', PaymentType.cc, 88.40) # template based on compound and the reference rule def fn_for_expense(e: Expense) -> ...: return ... (e.name, e.cat, fn_for_payment_type(e.payment), e.amount) # List[Expense] # interp. a list of expenses L0 = [] L1 = [E1, E2] # template based on arbitrary-sized and the reference rule def fn_for_loe(loe: List[Expense]) -> ...: # description of the acc acc = ... # type: ... for e in loe: acc = ... (acc, fn_for_expense(e)) return acc 5. [2 marks] We could write a correct program (i.e. a program that works as expected) that does not follow the helper rules. Why is it important to follow the helper rules when you design programs? Give one concrete reason and justify your answer. 6. [7 marks] You have snow reports from your favourite mountain in the following form. Date Temperature Visibility Freezing Altitude Base Snow New Snow 19-Apr-17 -2 21.2 1700 370 4 20-Apr-17 -3.2 4.7 1750 374 2 21-Apr-17 1.8 18.3 1750 376 8 22-Apr-17 0.3 9.0 1750 384 13 This information is available in csv format in the file snow_report.csv. Here are data definitions that can be used to represent the relevant parts of this information as data in your program. THE PROBLEM STATEMENT IS ON THE NEXT PAGE. from typing import NamedTuple, List from cs103 import * import csv SnowReport = NamedTuple ('SnowReport', [('temp', float), ('vis', float), # in range [0, ...) ('base', int), # in range [0, ...) ('new', int)]) # in range [0, ...) # interp. an alpine snow report with its temperature ('temp') in degrees Celsius, # visibility ('vis') in kilometres, snow base ('base') in cm, and amount of # snow in the last 24 hours ('new') in cm SR1 = SnowReport(-2.0, 21.2, 370, 4) SR2 = SnowReport(-3.2, 4.7, 374, 2) SR3 = SnowReport(1.8, 18.3, 376, 8) # template based on compound def fn_for_snow_report(sr: SnowReport) -> ...: return ... (sr.temp, sr.vis, sr.base, sr.new) # List[SnowReport] # interp. a list of snow reports L1 = [] L2 = [SR1, SR2] # template based on arbitrary-sized and the reference rule def fn_for_losr(losr: List[SnowReport]) -> ...: # description of the acc acc = ... # type: ... for sr in losr: acc = ... (acc, fn_for_snow_report(sr)) return acc Continuing Problem 6: Design a read function to read this information from a file and store it as data in your program. We have provided the read template and suggest that you neatly edit it rather than re-writing your read function. Assume that the information is in a file named “snow_report.csv”. If you need to create another information file, you can draw a table that shows the information (as above) and label it with the filename. @typecheck def read(filename: str) -> List[SnowReport]: """ reads information from the specified file and returns a list of snow reports """ # losr contains the result so far losr = [] # type: List[SnowReport] with open(filename) as csvfile: reader = csv.reader(csvfile) next(reader) # skip header line for row in reader: sr = SnowReport(parse_float(row[1]), parse_float(row[2]), parse_int(row[4]), parse_int(row[5])) losr.append(sr) return losr start_testing() expect(read('snow_report.csv'), [SR1, SR2, SR3]) # plus one more test (will vary depending on the extra table they created) summary() Marking scheme • 1 mark for updating the return type • 1 mark for correctly updating the purpose • 1 mark for correctly updating the accumulator type • 2 marks for correctly updating the line that creates the SnowReport (including calls to parse_*) • 2 marks for at least two correct examples 7. [10 marks] Design a function that takes a list of snow reports and returns the average snow base. (You must use the data definitions from Problem 6.) Marking scheme 2 marks for the correct signature 1 mark for a clear and concise purpose 1 mark if the function consistently deals with the empty case in a reasonable way 1 mark for correct accumulator types (must both be correct) 1 mark for correct accumlator descriptions (must both be reasonable) 1 mark for the template being based on List[SnowReport] 2 marks for at least two correct examples 1 mark for correctness 8. [12 marks] Design a function that takes a list of snow reports and plots a line chart of the snow base over time. You can assume that the reports are in the order in which they should be plotted. You can assume that the function get_range, as described below by its signature and purpose, is fully implemented and works correctly. (Again, you must use the data definitions from Problem 6.) def get_range (n: int) -> List[int]: """ returns a list of the first n integers """ Marking scheme Helper function 2 marks for the correct signature 1 mark for a clear and concise purpose 1 mark if the function is based on correct template 1 mark for having at least one correct example 1 mark for correctness Plot function 2 marks for the correct signature 1 mark for a clear and concise purpose 1 mark for correctly setting the title, x-axis label, and y-axis label 1 mark for correctly calling both helpers 1 mark for the correct call to plot
BSTA011 Business statistics WEEK 2 TUTORIAL A Activity 2: The marks of Quiz 1 in Business Statistics BSTA001 a few semesters ago were normally distributed with an average of 32 marks, out of a maximum of 60 with a standard deviation of 6 marks. a. What percentage of the students would score between 20 and 44 marks? b. What percentage of the students would score more than 44 marks?( Near pod ) c. What percentage of the students would score more than 50 marks?( Near pod) d. Between what marks would approximately 68% of the students score between?
Research Plan and Outline Introduction/Background Introduction This dissertation aims to explore maternal warmth and control from the perspectives of both mothers and children within Chinese families. Maternal warmth is a significant aspect of parenting that encompasses behaviors indicative of affection, acceptance, and support. The understanding of how maternal warmth is perceived and experienced by both mothers and their children provides valuable insights into the dynamics of familial relationships and their impact on child development. Given the cultural context of China, where collectivism plays a substantial role in family structures, this study seeks to contribute to the literature by examining the nuances of maternal warmth within a specific cultural setting. Background The notion of maternal warmth is central to attachment theory, which emphasizes the importance of a secure base provided by caregivers, particularly mothers, for optimal child development. Previous research has shown that children who experience high levels of maternal warmth tend to develop better social competencies, exhibit fewer behavioral problems, and enjoy enhanced mental health outcomes. However, the manifestation of maternal warmth can differ significantly across cultures, influenced by societal norms and expectations. In China, the socio-economic status (SES) of families can influence parenting styles and the expression of maternal warmth. Middle and upper-class families might afford different resources and opportunities that shape maternal interactions with children. This dissertation will focus on families belonging to these socio-economic strata, recruiting twenty mothers and their corresponding children aged between nine and ten years old to participate in the study. The recruitment process aims to ensure a representative sample that allows for meaningful analysis of the perceptions and experiences of maternal warmth among Chinese families. Participants will be engaged through semi-structured interviews, ensuring informed consent is obtained from parents. Confidentiality and anonymity will be maintained to protect participant privacy, and any discomfort expressed during interviews will be addressed by allowing participants to skip sensitive questions. The data will be securely stored and accessed only by the research team, further safeguarding participant information. By examining maternal warmth from dual perspectives, this study hopes to illuminate the complexities and nuances of maternal-child relationships within Chinese households, contributing to a broader understanding of family dynamics and child development practices in a culturally specific context. - This study explores the role of parental attachment and perceived support as mediators of adolescent adjustment, highlighting the significance of maternal warmth. These references provide a theoretical foundation for the discussion of maternal warmth within the context of child development and cultural influences. Literature Review Maternal warmth is a fundamental dimension of parenting that involves supportive, affectionate, and nurturing behaviors directed toward the child. It is a key component of the attachment theory, first proposed by John Bowlby, which suggests that early emotional bonds formed with primary caregivers, especially the mother, are crucial for healthy development (Bowlby, 1969). The quality of these early attachments has been shown to affect children's later social, emotional, and cognitive functioning. Research indicates that children who experience high levels of maternal warmth tend to develop stronger social skills, exhibit fewer behavioral issues, and generally enjoy better mental health outcomes compared to those who receive less nurturing (Collins & Repinski, 1999). Such positive associations highlight the importance of maternal warmth in promoting healthy child development. Cultural contexts play a significant role in shaping parenting practices, including expressions of maternal warmth. In China, where collectivism is deeply ingrained, parenting styles often emphasize communal values over individualistic ones. Chao (1994) introduced the concept of "cultivation" within Chinese parenting, which stresses the importance of fostering children's talents and moral development, reflecting a unique blend of warmth and guidance. However, despite the general benefits of maternal warmth, its manifestation can vary widely depending on socio-economic status (SES) and cultural norms. Middle and upper-class families in China, for example, may have more resources and opportunities that allow for greater expressions of maternal warmth, such as more time for engagement in activities that promote emotional bonding (Chao, 1994). This dissertation will delve deeper into the understanding of maternal warmth from the perspectives of both mothers and their children in Chinese families. By focusing on middle and upper-class families, we aim to explore how socio-economic factors interact with cultural values to influence the expression and perception of maternal warmth. Through qualitative methods, such as semi-structured interviews, we hope to capture the nuanced experiences of participants and contribute to the existing body of knowledge on parenting practices within the Chinese context. Research Questions or Hypotheses 1. How do mothers perceive and express maternal warmth towards their children in Chinese families? o This question seeks to understand the subjective experiences of mothers regarding their expression of warmth and how cultural and socio-economic factors influence their behavior. 2. What are the children's perceptions of maternal warmth within their family environment? o This question aims to uncover the children's perspectives on the warmth received from their mothers and how these perceptions may vary based on individual experiences and family dynamics. 3. What are the potential effects of maternal warmth on children's emotional and behavioral development within the Chinese cultural context? o This question addresses the broader implications of maternal warmth on children's well-being, considering the collectivist nature of Chinese society and the value placed on family cohesion and social harmony. Chosen Methodology and Data Collection Method Methodology: The study will employ a qualitative research method, specifically semi-structured interviews, to gather in-depth data on personal experiences and views. This method is chosen because it allows for a nuanced exploration of the participants' perceptions and feelings regarding maternal warmth. Participants: The sample will consist of 20 mothers and their children aged 9 to 11 years old. This demographic is selected because children at this age can articulate their thoughts and feelings effectively while still being influenced heavily by parental behavior. Data Collection: Semi-structured interviews will be conducted with both mothers and children separately. The interviews will cover topics such as the mother's self-reported parenting style, the child's perception of their mother's warmth, and the socio-economic context of the family. Each interview will be recorded, transcribed verbatim, and analyzed for thematic content. Data Analysis: Content analysis will be used to identify common themes and patterns across the interview transcripts. This process involves coding the text and grouping similar codes into broader categories, which will be further developed into themes that reflect the main ideas emerging from the data. References 1. Bowlby, J. (1969). Attachment and Loss: Vol. 1. Attachment. New York: Basic Books. 2. Chao, R. K. (1994). Beyond parental control and authoritarian parenting style. Understanding Chinese parenting through the cultural notion of cultivation. Journal of Marriage and Family, 56(3), 549–561. 3. Collins, W. A., & Repinski, D. J. (1999). Parental attachment and adolescent adjustment: The mediation of perceived support. Developmental Psychology, 35(2), 475–486.
Picture Books in Children’s Culture – HUMA/CCY 3691A, Summer 2025 4-page Analytical Writing Exercise Weight: (20%) Length: 4 pages typed, doubled-spaced in MLA format, plus Works Cited Due: Tuesday, July 8th on or before 11:59 p.m. Toronto time. Assignment Instructions: Applying the ideas from at least two scholarly readings in the course, give a close description & analysis of the images and words (if applicable) on chosen pages from one of the picture books in the list below. Your analysis should answer these two questions: what techniques are the illustrators using to tell the story on your chosen pages, and what ideas or expectations about children, childhood, or youth are implied by those illustrations? What To Do: 1. Sign up on eClass to choose a specific picture book & pages. The available books are: The Only Child, Night Song, Don’t Let the Pigeon Drive the Bus, Antiracist Baby, What Makes a Baby, Wait, What? A Comic Book Guide to Relationships, Bodies, and Growing Up, or From the Stars in the Sky to the Fish in the Sea. 2. In the opening sentence of your introductory paragraph, identify the book, the author, and the page with you will be working. Here’s a completely made-up example: On the opening page of The Tale of Crunchywitch and the Cats, by Sara Thompson, a child with deep brown skin, of indeterminate age & gender, is painting a picture of a bright blue cat. 3. Your introductory paragraph might also contain a brief description of the types of image in the book (i.e. line drawings with marker pen, abstract watercolour images of children and flowers in a garden, brightly-coloured collage, photographs of quilts that seem to be related to fairy tales). OR it might name the scholars whose work you will be using and citing to support your analysis. OR it might tell me a little about the plot of the tale (in a sentence, maybe – keep it short!) and where your pages fit in the story. It MUST contain a thesis statement (the results of your analysis) that answers the questions listed above. 4. There are two parts to this paper. The first two (or two and a half) pages are concerned with the surface level of reading & meaning: what features & techniques are the illustrators using in their pictures, and how do those features or techniques help provide information about the author’s story or message? (Think about our class discussions: this section concentrates on the overt or explicit meanings. Is the character happy, sad, lonely, hungry? What is a sperm shaped like?) 5. Your paper should demonstrate a high level of familiarity with the page(s) that you have chosen, describing it in clear and careful detail. Think about colour, line, style, but also who and what is included on the page, and where they are placed. Ask yourself: how does the image add information that is not conveyed by the words? Does it reinforce the message of the words? Or does it contradict the words, or complicate them a little? If there are no words, what is being communicated by the image? 6. Include the words in quotation marks when & if you discuss them. Consider capitals, font, and placement of the words. 7. This first part should apply the explanations about how images are manipulated (positioned, coloured, etc.) from Cueto & Brooks, Nodelman, Nikolajeva & Scott, or Lewis, using direct quotations. You may use more than one of these scholars, but you must use at least one in these paragraphs. 8. Yes: Paragraphs, plural. A standard page in MLA style. has two or two and a half paragraphs on a page, and each paragraph looks at a slightly different aspect of the material. (If you are talking about the colour of the cat, that might be one paragraph; if you’re still talking about colour but now you’re looking at the background, that’s a separate paragraph.) 9. The second part of the paper expands from your analysis to consider the ideological positions being implied by the images, or the ways that certain attitudes are being encouraged. These paragraphs are where you talk about the less obvious messages about race, gender, environmentalism, sexuality, age, ability, nationalism, family, etc. 10. This second part should apply the ideas about ideology from Nodelman, Hunt, or Cueto & Brooks using direct quotations. These ideas will probably support the claims you are making, but you may also use them in “BUT” statements if you are very sure of yourself. You may use more than one of these scholars, but you must use at least one in these paragraphs. 11. You may only use the pages that make up the main narrative for your analysis (no cover, acknowledgements, etc., unless they are included as part of the story), but you may refer briefly to other pages, the cover, etc., if relevant. 12. You should include a short concluding paragraph on the 4th page, which might point to other scholars or picture books, or consider the ways that your page fits into the story on the whole. Does it reinforce the overt or main message(s) or moral(s) of the book? Does the whole story suggest other, less obvious, ideologies? Take a look at Nodelman, Hunt, and Cueto & Brooks for good examples. 13. Include a Works Cited list that is complete & correct in MLA format. You should be able to complete this assignment using the course texts & without searching for other people’s interpretations on the internet or elsewhere. However, IF you use material or ideas from ANYWHERE, or if you talk about another book/film/song/etc., you must include proper citations both in-text and in the Works Cited list. What Not To Do: 1. Do not make this a 5-paragraph essay. See the note above on paragraphs. 2. Don’t just say, “she’s angry”. Tell me how you know: close description pays attention to details and doesn’t assume that I can guess what you’re thinking. 3. Avoid historical claims: “women never had any rights” or “children have always been able to read” are not only inaccurate but also unprovable without waaaay more space and research than you have time for. 4. Don’t try to “prove” something about “real children” using the books that are aimed at them. Similarly, avoid generalizations about what child readers can or cannot understand, given that the legal definition of a child is any human being from birth to age 18... 5. Avoid general opinion claims. “Making it relevant”, “to entertain”, and “to keep it interesting” are weak statements reasons because they’re all opinion – presumably most books intend to entertain and be interesting (and some to teach as well). 6. Don’t confuse the scholars ’ ideas/explanations with their examples. 7. Don’t overdo the “I” statements: “I think” and “in my opinion” aren’t necessary. You are writing, so it must be your thoughts and opinions – but those opinions should be informed by our course discussions & scholarly readings. 8. Don’t use so many scholarly quotes that you have no room for your own ideas. 9. Don’t go above 4 ½ pages. I will stop reading. Try to stick to four. Grades are assigned based on the following criteria: 1. Does the paper fulfill the requirements of the assignment? (Number of pages, MLA format, etc.) 2. Is there a clear, easy-to-understand thesis statement? Does it answer the question? 3. Does the paper contain strong descriptions ofthe image, with relevant details? 4. Does the paper move beyond that description to offer a logical analysis? Is that analysis supported by the details provided in your description? 5. Does that analysis reflect the claim made in the thesis statement? 6. Does the analysis incorporate direct quotations, properly cited, from the required scholars? 7. Is the paper using clear vocabulary? (Remember our discussion about synonyms & the dreaded thesaurus function…) 8. Are paragraphs used properly? Is the paper proofread for spelling, punctuation, and good grammar? (Does it show evidence that you’ve taken into account my earlier feedback on writing skills?) 9. Does the Works Cited list contain the book that is being analyzed and any other source that you used for ideas or help, or about which you wrote in the paper? Please keep in mind the late policy for this course, but also be aware that it’s generally a good idea to get feedback early in a course so that you know the professor’s expectations and can improve on future assignments. As well, as I’ve said above, be VERY careful to properly cite ALL material which you have used in any way, whether that material is scholarly or not. Academic honesty is a serious matter. Finally, if you want more information on my grading practices, see the Notes of Grading and Evaluation, available through eClass.
Take Home Essay Task Instructions Instructions · You need to write a 1500-word (+/- 10%) academic essay answering one of the questions below. · Cite and reference any sources used using Harvard style. referencing. You need to provide a full reference list at the end of the essay (this is not part of the word count). · You need to use a minimum of 4 of the sources from the Reading List and a minimum of 3 sources you have found yourself. · You must complete the cover sheet and submit as the first page in the same file as your essay. · This work must be entirely your own. Please see ‘Use of Technology’ section below for further details. In addition, note that use of a proofreader (either a professional or a friend) will be seen as an Academic Integrity offence. · Submit on Canvas by the deadline (any submissions one minute after deadline will be counted as late; any submissions more than 3 days late will not receive teacher feedback). · Clearly label your submitted file in English only using the following format: first name / last name / student ID / task name (e.g., Jane Smith 24789122 THE) · Use Arial or Calibri font size 12. Lines should be 1.5 spaced and margins justified. Questions: Option 1: Culture and Study Abroad ‘Ecochard and Fotheringham (2017) argue that the challenges faced by international students can be grouped into three main types: linguistic, socio-cultural, and academic differences from prior learning experiences. Which of these types of challenges do you think is hardest for international students to overcome? Justify your answer.’ Option 2: Artificial Intelligence ‘Developments in Artificial Intelligence offer a range of benefits to students, especially when used correctly and in accordance with university guidelines. However, the use of AI could also potentially harm students' abilities in critical thinking, creativity, and communication. Is AI more likely to harm or benefit students? Include these three areas when justifying your answer.’ Option 3: Sustainability ‘Climate change is a pressing global issue with long-term consequences. Individuals, governments, and companies all play roles in impacting and addressing climate change. Which one of these stakeholders plays a more significant role in mitigating the effects of climate change?’ Use of Technology: For this task, you can: · Use online dictionaries. · Use citation tools (e.g., Cite This For Me) that help format citations and references. · Use tools that suggest corrections to inaccuracies in your written work (eg Microsoft Word’s spellchecker, Grammarly). You cannot: · Use technology to translate texts (in whole or in part) into another language. · Ask AI tools to produce any of the essay, or copy text from AI tools. · Use tools that scan the essay and insert citations to sources. · Write the essay (in whole or in part) in another language and then translate it into English.
CMPM 146 (Game AI) Summer 2025 COURSE INFORMATION This class examines the use of Artificial Intelligence (AI) in games. It covers AI technologies for search, control, and learning, while exploring a wide variety of roles that AI has played and can play in games. We will examine the use of AI in multiple commercial games, while discussing the broader application of AI for character control, level design, difficulty adjustment, play testing, player tutorials, drama management, interactive narrative, novel experiences, and more. The course requires 6 one-week long programming assignments (half done solo, half in teams of two), readings, a midterm, and a final project (done in teams of four). Through this work, students will gain familiarity with multiple AI paradigms and learn how selected AI techniques can be applied to improve game design, game development and game play. My research focuses on the application of machine learning to build novel interactive experiences, like translating touch into lyric poetry, and on the creation of enabling technology, e.g., by extracting a rich model of affect from LLMs. I worked for 30 years in general theories of cognition, which was the original dream of AI; brain in a box, human level capabilities for planning, problem solving, and acting in a machine. I came to UCSC’s CM department because games are a natural customer for cognitive systems. LEARNING OUTCOMES By the end of this class students should be able to: 1. identify a core set ofAI techniques relevant to game development tasks, 2. implement and/or apply those techniques to address game development tasks, 3. creatively employ AI techniques to accomplish a novel purpose in games, and 4. explain how AI has been employed in a variety of existing games. In addition, students will develop skills for: 5. remote collaboration on design and programming tasks, 6. defining a prototype that efficiently illustrates a novel purpose in games, and 7. reviewing and constructively commenting on projects pursued by other students. More broadly, students will develop an appreciation for the breadth of possible AI applications in games, which will provide them with a novel, and valuable perspective on work in game studies and in the game industry. PREREQUISITES/COREQUISITES Students need a basic facility with programming and data structures to complete this class. As a result, we list Computer Science 101 (or equivalent) as a prerequisite. Experience using Python is a plus, but not required. No prior exposure to AI is required. Students with a design emphasis are welcome, and there will be opportunities to employ design skills in programming assignments and the final project. REQUIRED MATERIALS, TEXTBOOKS AND TECHNOLOGY This class has no textbook, but it makes extensive use of readings available on the web. The readings include blogs, videos of game play, conference talks, and primary research articles. Students will need access to a computer capable of running a zoom session, ideally with a camera input to enhance interaction in the lab sessions. COMMUNICATION The course activities consist of lectures, a weekly 1-hour lab session attended by the instructor and TAs, office hours, a discussion forum, and homework assignments. All activities will be online. Most lectures are asynchronous, some are synchronous. Students can absorb the asynchronous lectures at their own pace, but the content is necessary for completing the weekly assignments during the first half of the class. The introductory class, the midterm review session, the final project plan review session, guest lectures, and final project presentations are all synchronous. The lab sessions are synchronous. They focus on: • group discussion of topics suggested by class materials to deepen understanding of that content • Q&A regarding readings and lecture content, • assistance with weekly programming assignments, and • collaboration and constructive review of work in progress I will hold 4 office hours each week. I strongly encourage students to make use of office hours. It’s one of the things I enjoy most as a professor. Also, students who inhabit office hours routinely do better in the class. The TAs are responsible for alternate programming assignments and will hold 9 office hours during “on” weeks (for assignments they grade), and 2 office hours on “off” weeks (while the other TA is “on”). Students can contact me, or the TAs by email outside of office hours. It generally takes us a day to respond. The class employs Canvas for course announcements and Q&A, and Discord as an unmonitored discussion forum. ASSIGNMENTS & ASSESSMENT Game AI is a project-oriented course. The class structure backchains from this goal. I introduce a variety of AI techniques in the first 6 weeks of the class (via lectures, readings, and programming assignments) so students can draw on that base to select and pursue a creative project in the last 3-4 weeks. The class requires: • 6 one-week long programming assignments, half done solo and half in teams of two (30% of grade), • ~ 14 readings with Q&A (10% of grade) • a midterm (30% of grade), • a final project done in teams of four (30% of grade) Several programming assignments and additional readings offer opportunities for extra credit. The asynchronous lectures present a great deal of information about AI paradigms, algorithms, and their use in games. Students will need to study this material to complete the weekly programming assignments. The weekly programming assignments and final project are major course activities. The programming assignments are thought provoking, and require students to internalize, understand and implement/apply AI paradigms (addressing learning outcomes 1 and 2). The final project addresses the objective to creatively employ AI in games (learning outcome 6). The two-person programming assignments and the team project both develop collaboration skills (outcome 5). The asynchronous lectures, synchronous lab sessions, and readings support this work. The lecture content and readings address the goals to communicate AI techniques and their use in existing games (outcomes 1 and 4). Lab discussions help students understand, implement, and creatively apply AI techniques in games (outcomes 2 and 3), hone their design/implementation prototype (outcome 6), and exercise constructive review and collaboration skills (outcome 7). The class emphases on teamwork, applications of AI, and remote interaction all mirror common game industry settings, and develop student skills requisite for job environments (learning outcome 5). The programming assignments include a series of success tests and are graded against those standards. Program clarity (comments and style) play a role only when partial credit is required. The readings employ multiple choice and short answer questions. Final project evaluation is based on a project plan, a short final writeup, and a c. 10-minute group presentation given in the final week of class. We provide a final project presentation template and urge students (strongly) to rehearse their talks. Chief evaluation criteria are the clarity of that presentation, the technical difficulty, and the technical achievement of the work. Peer assessments ofthose features contribute to a project’s score, as does its selection as a class top-3 favorite (and separately, a staff top-3 favorite). Student reviews of each other’s project plans and final presentations contribute to the reviewer’s final project grade. Students will be able to look up their grade (in progress) on Canvas at any time. Students are welcome to discuss their grade and their work with the course staff at any time. GRADING POLICY The late policy for this class is designed to keep students (and their programming partners) from falling further behind as each weekly assignment is due and the next is released. • Unexcused late work (any category of work) receives a 20% deduction, with an additional 20% deduction each week it is late • No late work will be accepted in finals week I will grant 1-day extensions only with prior discussion. Two-day extensions are exceedingly rare. If you encounter health issues, emergencies, or similar difficulties, come talk to me. The late policy is there to prevent avoidable problems, not to create new ones. We intend to provide one-week turnaround on programming assignments and two-week turn- around on the midterm so students will have up-to-date feedback on their work. We provide feedback on final project plans within one week. STUDENT HOURS FOR COURSE Students should be aware that Game AI is a hard course. The pace during the first 6 weeks is fast. The lectures communicate a great deal of material (augmented by the readings), while the programming assignments have taken c. 15 hours of work per student per week in the past. The lab sessions serve as a forum for discussing the current assignment and reducing that total. The pace decreases in the second half of the term to give students more time to collaborate on their final projects; the programming assignments end, the readings mostly end, and the lectures address topics of interest (mostly the AI in commercial games). A few synchronous lectures feature guest speakers. There is no final exam; that time is used for final project presentations.
Question 2: Memory Management (Max Mark: 20 / 100) It is sometimes useful to know which pages in a user program’s virtual address space have been accessed (read or write or both). This assignment requires you to write a system call for xv6 that checks which page in a process’s virtual address space has been accessed. Note that a good understanding of Task 6.2 will be helpful. The kernel function ptableprint() could be useful for debugging the code for this assignment. Therefore, you may want to use the same copy of xv6 that you have used for Task 6.2 for this question. Task: Write a system call named pageAccess() that will modify a bitmap that indicates which of the 64 physical memory pages have been accessed. The function prototype of this system call for user programs will be: int pageAccess(char* buf, unsigned int npages, unsigned int* bmp); This function should return a negative value if unsuccessful (for any reason). Any other returned value indicates success. buf points to the start address of the virtual address space that needs to be checked for access. npages gives the number of pages that should be examined. It should be not larger than 64. bmp is a pointer to an unsigned integer that acts as a bitmap which indicates if a page has been accessed. Each bit of the unsigned integer corresponds to a page. Since an unsigned integer is 64 bits in size, npages is limited to 64. As an example, if pages 1, 2, and 30 have been accessed, the lower 32 bits of this integer should have 1’s only for bits 1, 2 and 30 (the rest are 0’s), giving a decimal value of 230+22+21 = 1073741830 (hexadecimal $40000006) as shown below. This function should return a negative value if unsuccessful (for any reason). Any other returned value indicates success. An example test program for your system call has been provided in the file pgaccess_test.c. This program should be compiled as a user program in xv6. It also serves as an example of how the system call is to be used. The bitmap should be set to the above value for this example test program. But you should check that your system call returns the values correspondingly if other pages have been accessed. A skeleton code of your kernel function of this system call, sys_pageAcess(), can be found in the file sys_pageAccess.c. Note that sys_pageAcess() does not take any arguments. This is because the call to pageAccess is made in the user program (in user mode). Therefore, these arguments cannot be passed directly to a kernel function (in kernel mode) in the usual way. Instead, you will need to access the arguments in sys_pageAcess() using argaddr and argint as demonstrated in the skeleton code. With the bitmap pointer, it is easier to store it in a variable in this function and then copy it to the user space before returning using copyout(). The code to do this has also been provided. The remaining code to implement this kernel function will need to be supplied by you. Submission Requirements: Clean up (remove) all the object files and executable files using the command make clean (in the directory where the Makefile is located). Then, in the parent directory of xv6-riscv, run the tar command to archive the whole xv6riscv directory (with its sub-directories including user, kernel, and mkfs). Name this tar file q2-.tar where is your student ID. Question 4: CPU Scheduling Implementation (Max Mark: 40 / 100) In this lab assignment, you will be implementing a Priority Scheduler for xv6. The default process scheduling policy of xv6 is Round Robin. In Lab 7, you have gone through the process of implementing a First-Come-First-Served (FCFS) scheduler. You will need to start with the code you have from Lab 7. Task 1: To implement priority scheduling, you will first need to do the following: (1) Add a variable in struct proc to indicate the nice level of a process. Use a range of 0 to 20, with 20 being the lowest and 0 the highest priority. (2) Determine the default priority of a process when it is created and add the code to do so. Usually, it is somewhere in the middle of the range. (3) Implement a system call: int setnice(int pid, int n); to change the nice value of process pid to n. The returned value should be the original nice value of this process. (4) Implement a second system call: int getnice(int pid); that returns the nice value of a process. Task 2: Add code to implement priority scheduling if PRIORITY (rather than RR or FCFS) is defined. Do not remove the RR and FCFS codes from Lab 7. Use #ifdef to determine which code should be compiled from the compiler command line as you have done in Lab 7. Use schedtest2.c provided to test your implementation. Task 3: Obtain the average run time, waiting time and sleep times with Round Robin, FCFS, and Priority scheduling for 1, 2, and 3 CPUs. You will be compiling xv6-riscv with, for example, make qemu SCHEDULER=PRIORITY CPUS=2 for Priority scheduling and 2 CPUs. You should use SCHEDULER=RR and SCHEDULER=FCFS to compile for Round Robin and FCFS respectively (same as what was done in Lab 7). Tabulate your results and answer the following questions: (a) Comparing these average timings you have obtained, are they that you would expect? (b) Provide justifications for your answer to (a) above. Note that you will need to use the user program schedtest for Round Robin and FCFS, and schedtest2 for Priority scheduling. Submission Requirements: Clean up (remove) all the object files and executable files using the command make clean (in the directory where the Makefile is located). Then, in the parent directory of xv6-riscv, run the tar command to archive the whole xv6riscv directory (with its sub-directories including user, kernel, and mkfs). Name this tar file q4-.tar where is your student ID. The code you added/modified should be documented with appropriate comments. Your tabulated timing results and answers to the questions should be provided in a Microsoft Word or PDF file separate from the tar file. Question 5: Pipes (Max Mark: 12 / 100) This question requires you to implement a user program in xv6-riscv. This program will make use of system calls fork, pipe, read, and write. Task: Write a user program in xv6, name it pingpong. It should do the following: (a) Create a child process. (b) The parent will send an integer to this child process. (c) Upon receiving this integer, the child process prints its PID followed by the value of the integer it received. (d) The child process should multiply the received integer by 4 and send the resulting integer back to the parent. (e) The parent prints its PID followed by the value of the integer it received from the child. Example of usage: $ pingpong 4 Integer from parent = 4 3 Integer from child = 16 Requirements: Communication between the parent and child process should be through pipe. Your implementation must only establish a single pipe. Marks could be deducted for lack of comments in your program. Submission Requirements: Clean up (remove) all the object files and executable files using the command make clean (in the directory where the Makefile is located). Then, in the parent directory of xv6-riscv, run the tar command to archive the whole xv6riscv directory (with its sub-directories including user, kernel, and mkfs). Name this tar file q5-.tar where is your student ID.
ELEC9714 Electricity Industry Planning + Economics t2 2025 Assignment 1 This assignment will be distributed to you in week 3 via the course Moodle. It is due on Sunday midnight of week 5 (just before the start of flexibility week). The assignment must be submitted via Moodle as a single pdf file. Aim to make your assignment look like a professional consultancy report and paste in Excel plots and calculation tables. The assignment must be submitted individually and must be your own work. The UNSW policy on student plagiarism can be found on the www.unsw.edu.au website. Note also the information on plagiarism detailed in the elec9714 Course Outline which is available on the course Moodle. Note that UNSW uses automated plagiarism software. Because of this, all text and tables need to be ‘searchable’ within the pdf - ie. not pasted in as graphics. Again, the only acceptable pasted graphics are the plots, not any tables and not any of your discussion. If the marker spots text graphics your assignment will not be marked. You are also required to upload your Excel Spreadsheet or similar working file. This will not be marked but may be checked if there are concerns about assignment similarities across two or more students. Be sure to include the standard EE&T assignment coversheet. The assignment will be marked out of 100, with an overall marks breakdown for each part. For each part, 25% of the marks is for explaining how you undertook the analysis, 50% of the mark is for your answers, and 25% of the mark for your discussion of the findings. If you don’t discuss your results then you can only get maximum 75% of the assigned mark, assuming you explained your method and got the right answer. Finally, no spurious precision please. You are modelling industry costs in 2050 using heroic assumptions. I expect 3 digits maximum (eg. $2.15b rather than $2,147,362,014.32). Keep this mind during analysis – you might want to make simplifying assumptions in your estimations rather than trying to get your calculations exact. The two assignments over the course are in total worth 25% of your final assessment. This assignment therefore contributes 12.5% of your final mark. Note that late submission without good reason will see you lose 10% of your mark per day it is late. I suggest you contact me prior to the submission date if you expect to be late in order to discuss arrangements. An Excel spreadsheet is available on the Moodle. It provides data from the CSIRO Gencost report. It also contains 30 minute demand data and representative State utility PV and wind traces, using actual NEM data from calendar year 2024 (provided by NEMSight). You are strongly encouraged to use Excel or a similar spreadsheet package to undertake this assignment – indeed, you will need to use some form. of data analysis software. You will also want to spend the time to work out how to automate the calculations as much as possible. There are lots of parts to this assignment that extend the initial analysis - make it easy to change key parameters such as the carbon price by making it an external parameter which your formulas references, rather than hard-coding it in. A little automation will make your life much easier, and it is very valuable to have good Excel skills - it is the one techno-economic energy modelling tool that you can guarantee will be available to all power system engineers in whatever role they have. As an energy policy analyst working for the Queensland Government you are part of a team intended to advise the State Government on what to do given the former State Government’s ambitious decarbonization targets for 2050, concerns regarding renewables by the current government and the current energy crisis across the Australian National Electricity Market due to coal and gas market pricing shocks, and an aging coal and gas generation fleet in the State. Note that the State Government is concerned that the National Electricity Market is incapable of providing the State with secure affordable power and is actively considering ‘going it alone’ including government funding of generation investment, and no reliance on interconnector flows with NSW or any of the other States. Coal generation investment is now again under active consideration. You have been given the responsibility to estimate the optimal 'new build' generation plant mix for the Queensland Electricity Industry in 2050. This will be an input into Government decision making on what types of generation deployment they should be facilitating over the coming 25 years. Note that you can assume that no current plants in Queensland will still be operating at that time. The Gencost database provides estimated technical and economic characteristics for a range of potential new build plant including overall capital costs, economic life, fixed O&M costs, variable O&M costs, efficiency, fuel costs as well as CO2 emissions intensity and CO2 storage costs where relevant. Note that these are summarized for technologies relevant to Queensland in the assignment spreadsheet. These numbers have been modified from the latest (December 2024) Gencost estimates for several technologies in the assignment. A particular challenge is assessing the impact of a future carbon price on emissions from the electricity sector in Australia. Rather than making a (large) assumption, you will consider two scenarios of carbon price - $0/tCO2 which is the present situation in Australia, and $100/tCO2 which is roughly the current carbon price in the EU that applies to the electricity sector. While a carbon price might seem unrealistic at present, we can only hope that serious carbon pricing is implemented over the coming two decades. And State governments could of course choose to ‘shadow’ price carbon for planning purposes even in the absence of concerted Federal Government or international progress. Keep in mind that when generators pay a carbon tax, then the government earns revenue. This revenue can be used to reduce other taxes and, arguably, therefore doesn’t actually represent an industry cost. However, carbon pricing also reflects, at least in part, the damage costs associated with each tCO2 (ie. the government may need those revenues to pay for the overall economic damage that climate change is causing). Another challenge for the team is that the government is not yet clear if it will have to make the investment directly, or whether it will aim to incentivize private market participants to invest in the ‘optimal’ generation mix. The State government can effectively borrow money at 5%, while private market participants argue that they can only finance projects at 10%. To date, state governments in Australia have undertaken some investment directly, but also contracted to buy power purchase agreements from private providers. The potentially relevant generating plants for your analysis are provided in the assignment spreadsheet. You’ll note there is no brown coal or biomass or new hydro costings given that brown coal is not relevant in Queensland and there are only very limited new biomass and hydro opportunities in the State Of course, not all these plants are fully dispatchable and capable of operating at up to 100% Capacity factor over the year so you will need to think carefully about which plants you include for part a) and consequent analysis. Annualised fully dispatchable technology costs: (a) Plot the total annual costs ($/MW/yr) for each of the appropriate 'new build' plants available for Queensland with the capacity factor of the plants varying from 0 to 1 over a year (representing 0 to 8760 hours of operation in a year) for two scenarios, 5% discount rate and $100/tCO2, and 10% discount rate with no carbon price. Use the capital, economic lifetime and O&M, plant efficiency, and fuel costs provided specifically for the State in the spreadsheet. Note that these are based on the 2030 Gencost estimates given the challenges of projecting longer-term future costs, even though you are solving the optimal generation mix for 2050. Cost forecasts have proven pretty hopeless over just a few years, let alone decades. You will need to calculate fixed ($k/MW/year) for each relevant generation option for the two interest rates (5% and 10%) and variable ($/MWh) costs (for no carbon price and $100/tCO2) for each technology. The assignment spreadsheet provides you with a plotting template to assist you in drawing these plots once you have calculated these costs for each technology for each of the two scenarios. Note that the solar thermal cost is higher than in Gencost because it has been adjusted to be capable of 100% capacity factor operation. In practice this is very challenging as these plants need clear skies. However, no generation technologies offer 100% CF operation in practice over extended periods due to maintenance, forced outages etc. Also, note that the hydrogen engines are zero emissions because it is assumed the hydrogen is from renewable sources. Highlight the economically optimal (ie. lowest annual cost) plant type as capacity factor increases from 0 to 1 and estimate or calculate the ‘break point’ capacity factors. Think carefully about which technologies can actually be included in such analysis – the ability to operate the plant at any overall annual capacity factor up to 1 (ie. plant runs at rated output for the entire year) and to definitely be available when needed (such as those peaking plants which won’t run often but have to be there when there is high demand)) is key here. Discuss briefly both how you undertook this analysis (ie. explain what you did with the data to get the plots), and what these findings highlight about comparative technology costs and the impacts of carbon pricing and interest rates on these. You might also want to consider the implications of including currently technical unproven technologies in your analysis. Note that this discussion is not optional - engineers need to explain how they do their quantitative (numerical) analysis, yet also what it means. Remember, your client here is the Queensland Government - the senior executives will generally not have engineering backgrounds. (20 marks) Optimal dispatchable generation mix: AEMO has provided you with estimated half hourly demand data for Queensland for the calendar year 2024. They estimate that electricity demand will increase by 30% to the year 2050 as businesses and households move from using gas to electricity for heating (space and water) and cooking, and industry also electrifies more processes currently using gas, coal or oil. You can, however, assume that the general 'shape' of the demand profile won't change over that time (ie. you can just scale the 30 minute data to estimate a 2050 demand trace for Queensland). We will come back to this question of load profile later. (b) Using this data and growth projection, estimate and plot a load duration curve for Queensland for the year 2050, ordered from highest to lowest demand over the year. (5 marks) (c) From this load duration curve, and economically optimal plant capacity factor estimates from (a) above, estimate the optimal plant capacity mix for Queensland for the 5% discount rate and $100/tCO2 carbon price scenario for 2050. Ignore issues of existing Queensland generation plant (much of which can be expected to be retired over the next 25 years or so). You can also assume that all new build generating plant is 100% reliable. Again, think carefully about which technologies can actually be included in such analysis. You can eyeball your generation plot against the load duration curve as shown in the lectures or convert the breakpoint capacity factors to the 30 minute dispatch across the year (capacity factor X 17520 30 minute dispatches). Discuss briefly how you undertook this analysis (ie. explain what you did with the data to get the plots), and what these findings highlight about Queensland likely ‘least cost’ new build generation mix with a significant carbon price. You will also want to provide your generation mix results in a Table. (15 marks). d) Now estimate the total annual cost ($m/yr) of the electricity industry in 2050 for the 5% discount rate and $100/tCO2 scenario. Include of course annualised capital costs, the associated fixed O&M costs, and the variable O&M, fuel and carbon costs associated with actual operation of the plants. Also estimate the total electricity industry greenhouse gas emissions. An easy way to estimate operating costs is by measuring the areas under the load duration curve (LDC) for each of the technologies in the optimal mix. That gives you hours X dispatch MW with an associated variable cost $/MWh for each plant. You really should spend the time to work out how to automate this as you will be doing more of these annual industry cost calculations in the assignment. Think of how to automate the process of taking your generation mix estimates (MW of each technology) and then breaking down the dispatched energy in the LDC by which generation technology is providing it. (10 marks). Fully dispatchable and non-constrained variable renewables: With sufficient energy storage, it might be argued that wind and solar can be made fully dispatchable and non-energy constrained plant, in a similar way to the solar thermal plant. For wind and PV this would involve oversizing wind and solar and adding a lot of battery storage. If you had a PV site with full sunshine every day, close to the equator so you get 12 hours of sun per day regardless of season, then assuming 6 hours of full sunshine a day (yes a big assumption), the PV plant will generate 1MW for those 6 hours and store 18MW for later use in the other 18 hours. For a slightly more realistic example, let’s assume a 1MW 100% capacity factor PV plant would require 5MW of PV and 36MWh of battery storage (three full nights of storage for the 1MW plant to cover occasional cloudy days and losses.) Assume battery costs of $150k/MWh, which seems very plausible given current price falls (although CSIRO’s Gencost report doesn’t agree) and a total fixed O&M cost of $150k/MW/year for this plant with no variable O&M. For simplicity assume a 20 year economic life (very long for battery energy storage plants its true, but short for the PV which is about half the capital cost) e) Add this dispatchable generator to your generation options plot and present it here. Would such a PV plant capable of 100% CF operation be part of the optimal generation mix under the 5% and $100/tCO2 carbon scenario? Discuss your findings for this ‘extreme’ case of making variable renewables equivalent to full dispatchable and non-constrained plant. (10 marks) Incorporating demand side participation (DSP): AEMO estimates that Queensland might have around 3GW of price responsive demand in 2050. Effectively, this demand will choose not to run if the price is very high (here we assume $5000/MWh (which is well below the current market ceiling price but does represent an extraordinary electricity price for many industry participants). AEMO estimates capital costs to create such load flexibility of on average $100k/MW with no fixed or variable O&M costs and an economic life of 20 years. You might consider this equivalent to a peaking generator that has very low capital costs, but a $5000/MWh operating cost. Assume again the 5% discount rate and $100/tCO2 scenario. g) Estimate how many MW and how many hours a year this demand side participation might actually be called upon in the Queensland electricity industry in 2050. Briefly discuss your findings, and their implications for the value of demand side participation. You can add this DSP as another generation technology in your plot to see over what range of capacity factors it’s the least cost ‘generation’ option. Do not include the dispatchable PV plant in this calculation You’ll want to check how many MW of demand will optimally be met by DSP – is the projected 3GW enough? (5 marks) Incorporating variable wind and PV: AEMO has also provided you with 30 minutes traces of well performing PV and wind generation in Queensland. These have been normalized as 1MW of PV and wind capacity profiles. By assuming that PV and wind have sufficiently low operating costs that they will always be fully dispatched (unless spilling), you can create a residual load duration curve for different penetrations of PV and/or wind, which you then use to determine the optimal dispatchable generation mix. h) Estimate the optimal generation mix of the Queensland electricity industry when adding 8GW of PV and 8GW of wind. Do not include the dispatchable PV plant or DSP calculated above. What % of wind and solar generation is spilt? Assume the 5% discount rate and $100/tCO2 scenario. Recall that the traces you are given are for 1MW of solar and 1MW of wind so you will need to scale accordingly. i) Estimate the optimal generation mix of the Queensland electricity industry when adding 12GW of PV and 12GW of wind. What % of wind and PV generation is spilt? Briefly discuss your findings – in particular, does wind and/or PV reduce overall industry costs? How much spill of wind and solar are you seeing? (15 marks). Incorporating high renewables and storage: Are you interested to know what the whole mix might look like with high renewables as well as storage to avoid at least some of that renewables spill, and avoid having to run as much conventional generation? Estimate the total annual cost of the Queensland electricity industry for the case where there is 12GW of utility solar and 12GW of utility wind for the 5% $100/tCO2 scenario in 2050. However, the State also installs 5GW of battery energy storage, with 6 hours of storage (ie. 30GWh energy capacity). Assume again this storage costs $150k/MWh, ignore O&M costs, and there are no roundtrip losses (actually around 10% losses with Li-ion energy storage). Does the storage make economic sense in terms of reducing total industry costs? Do not include the dispatchable PV plant or DSP calculated above. There are many ways to model such storage but the simplest is to assume that you’ll operate the storage to reduce the periods of highest demand, while charging during the periods of lowest (negative demand). With 6 hours storage you might assume that over the year the plant charges for around 2000 hours and discharges for 2000 hours. So you effectively have 5GW of extra load for 2000 hours of lowest (ideally negative) demand and 5GW of generation for another 2000 hours of the highest demand. You can estimate a new residual load duration curves and solve the least cost mix of dispatchable generation. More complex techniques are to solve actually battery plant dispatch for the 30 minute demand trace over the year but I don’t suggest you try this unless you enjoy linear programming. (10 marks) Incorporating EV charging: l) Discuss how you might incorporate EV charging into the analysis. Let us assume that rapid transport electrification means that there are 4 million EVs in Queensland in 2050. Assume also each vehicle typically charges at 3kW (note that typically they already charge at around 7kW for household charging, let alone supercharging). Each vehicle drives around 40km/day (around 14600km/year), consuming around 6kWh/day or 2.2MWh/year (EV efficiency around 150Wh/km). Total daily consumption charging these EVs is therefore around 24GWh. Consider two extreme cases for vehicle charging. 1) on average vehicles charge between 6-10pm every day, starting when people get home from work. This effectively adds a block of new Queensland demand of say 6GW for that 4 hours. 2) all vehicles charge between 10am-2pm every day, utilizing a wide range of work based and public charging infrastructure. Again, there is additional Queensland demand of 6GW for those 4 hours every day. For both cases, estimate the optimal generation mix for the 5% discount rate and $100/tCO2 carbon price scenario and 12GW of wind and 12GW of utility solar. Don’t include the demand-side participation, dispatchable PV or utility PV in the analysis. Calculate the total industry cost. What is the difference in total annual industry cost depending on which charging profile is used. And does the average $/MWh for electricity increase or decrease for each scenario. Briefly discuss the value of thoughtful EV battery charging. Think of ways to modify the load duration curve given this new load, and then reordering to get a ‘residual’ duration curve that you can then use to determine the optimal generation mix. There is a useful demand profile tool in the assignment spreadsheet that allows you to enter a daily controllable load profile, which then gets scaled up over the entire year. (10 marks)
STAT3600 Assignment 1 (submit Q15, Q16, Q17) Deadline: 24/2/2025 Note: (1) Numeric values should be presented in 4 decimal places. (2) Do not use computer and show the intermediate steps for Q1 to Q12, Q15 to Q16.1. 1. For the matrices below, obtain (1) A+B, (2) A B, (3) AC, (4) ABT, (5) BTA State the dimension of each resulting matrix. 2. Let A and B be defined as follows: a) Are the column vectors ofA linearly dependent? b) What is the rank ofA? c) Calculate the determinant of A. d) Calculate the inverse of A. e) Repeat (a) – (d) for B. 3. Is A given below idempotent? 4. a) Find a matrix A of the quadratic form. b) For the matrix: Find the quadratic form. of the observations Y1,Y2, and Y3. 5. Are the following matrices positive definite or non-negative definite? 6. The data of five pairs of two random variables are given as follows. x1 x2 a) Calculate the sample mean vector for b) Calculate the sample covariance matrix for c) Calculate the sample correlation matrix for 7. The mean vector and the variance-covariance matrix for a random vector given as, a) Calculate the mean and variance for Z = 2Y1 - 3Y2 +5Y3 b) Calculate the mean vector and variance-covariance matrix for Z1 = Y1 +Y2 - Y3 +2 Z2 = 2Y1 - 3Y2 +Y3 -1 8. It is given that a) Calculate P(Y1 ≤ 2) b) Calculate P(Y1 ≤ 4IY2 = -1,Y3 = 2) c) Show that whether the following two random variables are independent or not. Z1 = Y1 - Y2 +Y3,Z2 = 2Y1 +Y2 9. Suppose Y~Nn(μ, Σ) with Σ nonsingular. Let A be a d × n constant matrix of rank d. a) Determine the distribution of A(Y - μ). b) Determine the distribution of (AΣAT)-1/2 A(Y - μ). c) Using (b) or otherwise, show that (Y - μ)TAT(AΣAT)-1A(Y - μ)~xd(2) . 10. Suppose Y~Nn(μ, Σ), and there exists an m × n matrix Q such that QΣQT = Im and Qμ = 0. Define Z = QY. a) What is the distribution of Z? b) What is the distribution of ||Z||2 = ZTZ? 11. Let x~x5(2) and Z~N(0,1) be independent random variables. a) Calculate the 5% upper quantiles of X, Z2/x and Z/√x . b) Denote your answers to (a) by x,f, t, respectively. Calculate i. P(x ≤ x), ii. P(Z2/x ≤ f), iii. P(x/Z2 ≤ f), iv. P(Z/√x ≤ t), v. P(|Z| > t √x) c) Calculate the 2.5% upper quantile of Z/√x. Show that its square equals f. Explain. 12. The data of n observations is given as x1,x2, … ,xn. The sum of the squared errors is defined as SSE = (xi - μ)2. Derive the formula of the least square estimator for μ . 13. A random sample of 18 U.S. males was selected, and the following information was recorded for each individual: x = weight (in g) offat consumed per day, y = total cholesterol (in mg) in blood per deciliter. The data are given in ‘fat.csv’. a) Ployy against x. b) Fit a simple linear regression model to the dataset and plot the fitted regression line on the graph obtained in (a). Report the least squares estimates of the regression coefficients. c) Test at the 5% level whether “daily fat intake” is effective in explaining the variation in cholesterol level among the U.S. males. d) Construct a 95% confidence interval for the expected cholesterol level for people whose daily fat intake is 100g. e) Construct a 95% prediction interval for the cholesterol level of an individual whose daily fat intake is 100g. f) A margarine manufacturer claims that the difference between the expected blood cholesterol level of individuals consuming 100g of fat per day and that of those consuming 40g of fat per day does not exceed 35 mg/dl. If his claim is true, then perhaps some people would be willing to include extra fat in their diets, thinking that the resulting increase in cholesterol is small enough so that there is no need for concern. Carry out a size 0.05 test for the manufacturer’s claim. 14. The time (y) required for a merchandiser to stock a grocery store shelf with Coca Cola bottles and the number of cases of Coca Cola stocked (x) are stored on ‘cola.csv’. A simple linear regression model is proposed to regress the response y on the explanatory variable x, assuming i.i.d. N(0; σ2) random errors. a) Calculate the least squares estimates of they-intercept and the slope of the regression line. b) Carry out a t test to determine if there is a significant linear relationship between x andy at the 5% level. c) Based on your fitted regression line in (a), estimate the expected time required to stock zero case of Coca Cola. d) Do you think your answer to (c) is reasonable? Suggest a more reasonable model, which is a special case of the simple linear regression model, to describe the relationship between x andy. e) Conduct an appropriate t test at the 5% level to test whether the model suggested in (d) is acceptable in place of the more general simple linear regression model. 15. Consider a linear regression model when Y is regressed on X for 10 observations. It is given that a) Calculate the least squares estimates of the intercept and the slope. b) Calculate the sum of squared errors and the unbiased estimate of the variance of the error. c) Calculate the standard errors of the estimated intercept and slope. d) Construct a 90% confidence interval for the intercept and the slope. e) Predict an individual value of Y when X = 2. Construct a 99% prediction interval for the prediction. 15.1 Refer to Q15 a) Estimate the covariance between the estimate of intercept and the slope. b) Test at the 5% level of significance whether the slope is —1.5. c) Estimate the mean of Y when X = 2. Construct a 90% confidence interval for the estimate. 16. Four observations of two variables are given as follows. Consider a linear regression model when Y is regressed on X. It is given that a) Write down the data matrix. b) Calculate the least squares estimates of the intercept and the slope. c) Calculate the sum of squared errors and the unbiased estimate of the variance of the error. d) Estimate the covariance matrix of the estimators ofthe intercept and the slope. e) Calculate the standard errors of the estimated intercept and slope. f) Test at the 10% level of significance whether the slope is 1.5. g) Estimate the mean of Y when X = 1.5. Construct a 95% confidence interval for the estimate. 16.1 Refer to Q16 a) Construct a 95% confidence interval for the intercept and the slope. b) Predict an individual value of Y when X = 2.5. Construct a 90% prediction interval for the prediction. 17. The study presents the linear regression model of moisture detection technique in the building material. The permittivity (F/m) and the moisture (vol%) of a number of bricks are stored in ‘material’. a) Ploy moisture against permittivity. Is a linear regression appropriate? b) Fit a simple linear regression model to the dataset and plot the fitted regression line on the graph obtained in (a). Report the least squares estimates of the regression coefficients. c) Interpret the intercept and the slope quantitatively. d) Test at the 5% level of significance whether permittivity is effective in explaining the variation in moisture. e) Predict the moisture of an individual brick with permittivity = 3.6 F/m. Construct a 95% prediction interval for the prediction. 17.1 Refer to Q17. a) Construct a 90% confidence interval for each of the estimates in (b). b) Test at the 5% level of significance whether the slope is 0.1 vol% (F/m)-1 . c) Estimate the expected moisture of the bricks with permittivity = 4.4 F/m. Construct a 90% confidence interval for estimate. d) Construct a 95% prediction interval for the difference between the average moisture of two groups of bricks. The first group of bricks have permittivity as 3.4 and 3.5 and the second group of bricks have permittivity as 4.1 and 4.3.
MGSC 661: Individual Assignment #3 General Information This assignment must be submitted via the submission folder for Assignment #3 via myCourses before its due date. This is an individual assignment and more instructions on this assignment and due date can be found in the module Assessment Overview for Assignment #3. In this assignment, you will be also assessed based on the effectiveness of your visualizations. This assignment is worth 100 points (30% of your marks). All the questions are listed below. You can find the complete grading rubric breakdown in this assignment submission folder. Assignment Goal The aim of this assignment is to build unsupervised learning models. On the first problem, you will use K-means clustering for image compression. You will reduce the number of colours in an image by clustering similar colours and replacing them with the centroid of the cluster. This will help you understand how K-means clustering can be applied to image data for compression purposes. On the second problem, you will use a dataset on the performance characteristics of various automobiles to perform principal component analysis to make cross-country of manufacturing comparisons. For all questions in this assignment, you must attach your Python code with your submission along with your outputs. Jupyter notebook code files are accepted as well. Read the following tasks that you should perform to complete this assignment. This assignment contains 2 parts as follows: Part 1: Image Compression using K-Means (50 points) a. (5 points) Downloading of Image from Internet using Python Library: Pick any colour image of your choice. You can use an image from your personal collection or download a sample image from the internet. If the run-time of your algorithm is too slow, you may need to choose a lower-resolution image. Use an appropriate Python library to load the image. Alternatively, you can use the flower.jpg from sklearn.datasets. from sklearn.datasets import load_sample_image flower = load_sample_image(“flower.jpg”) requirement: Image is loaded correctly using an appropriate Python lib, with clear and accurate descriptions. b. (5 points) Image Conversion: Convert the image to a two-dimensional array where each row represents a pixel and each column represents a colour channel (RGB values). requirement: Image is converted correctly to a two-dimensional array with clear and accurate descriptions. c. (10 points) K-Means Implementation: Implement k-means clustering to cluster the pixel colors into k clusters (experiment with different values of k such as 16, 32, 64, etc.). requirement: K-means clustering is implemented correctly with clear and accurate descriptions, experimenting with different values of k. d. (5 points) Colour Replacement: Replace each pixel's colour with the centroid of the cluster it belongs to. requirement: Pixel colors are replaced correctly with the centroid of the cluster with clear and accurate descriptions. e. (10 points) Reconstructing, Comparing & Defining: Reconstruct the compressed image from the clustered pixel data. Compare the original image and the compressed image by visualizing them side by side. Define a metric to quantify the compression achieved, if at all, for the image. requirement: Compressed image is reconstructed correctly and compared with the original using appropriate visualizations, with clear and accurate descriptions of the compression metric. Metric to quantify loss of quality is defined correctly with clear and accurate descriptions, discussing trade-offs between clusters and image quality/ compression. f. (15 points) Metric Definition and Trade-off Discussion: Define a metric to quantify the loss of quality, if at all, between the original image and the compressed image. Discuss the trade-off between the number of clusters and the quality of the image and the compression achieved. requirement: Metric is defined correctly with clear and accurate descriptions, effectively quantifying the loss of quality. Comprehensive discussion with clear and accurate descriptions, effectively addressing the trade-off between clusters, image quality, and compression. Part 2: Principal Component Analysis (50 points) The mtcars dataset is a classic dataset in statistics and machine learning, extracted from the 1974 Motor Trend US magazine and comprises various specifications of 32 different car models. • model: Car make • mpg: Miles per gallon (fuel efficiency) • cyl: Number of cylinders in the engine • disp: Displacement (cubic inches) • hp: Gross horsepower • drat: Rear axle ratio • wt: Weight (1000 lbs) • qsec: 1/4 mile time (seconds) • vs: Engine (0 = V-shaped, 1 = straight) • am: Transmission (0 = automatic, 1 = manual) • gear: Number of forward gears • carb: Number of carburetors In this problem, you have also been provided with an additional feature: country denoting the origin of the vehicle. a. (5 points) Loading of the Dataset: Load the dataset and confirm it has loaded correctly. requirement: Dataset is loaded correctly with clear and accurate descriptions. b. (5 points) Standardization: Standardize all numerical features in the dataset to have a mean of 0 and a standard deviation of 1. This is an essential preprocessing step in many machine learning algorithms and statistical techniques. requirement: Numerical features are standardized correctly with clear and accurate descriptions. c. (15 points) PCA Application: Apply PCA to the standardized numerical features to reduce it to the first two principal components. Also, explain the percentage of variance explained by each principal component. requirement: PCA is applied correctly with clear and accurate descriptions of variance explained by each principal component. d. (5 points) Scatter Plot Creation: Create a scatter plot of the data points in the new 2-dimensional space defined by the principal components. requirement: Scatter plot is created correctly with clear and accurate descriptions. e. (10 points) Colour-Coding by Number of Cylinders: Colour-code the observations by the number of cylinders (cyl). Discuss the separation of the different cylinder categories in the PCA plot. Which cylinder categories are most clearly separated? requirement: Observations are color-coded correctly with clear and accurate descriptions, discussing separation of cylinder categories. f. (10 points) Colour-Coding by Country: Next, colour-code the observations by the country of the models. Discuss and interpret the separation of the cars from different countries in the PCA plot. requirement: Observations are color-coded correctly with clear and accurate descriptions, discussing separation of cars from different countries
TESTING EFFICIENCY OF THE COPPER FUTURES MARKET: NEW EVIDENCE FROM LONDON METAL EXCHANGE(a) ABSTRACT This paper investigates the joint hypothesis of market efficiency and unbiasedness of futures prices for the copper futures contract traded on the London Metal Exchange. This contract is of particular importance given the usage and properties of the underlying commodity and its highest share of trading during the last decade, in an exchange which is the centre of the world’s trading in copper. The data contain prices from two different copper futures contracts (three and fifteen months maturity) covering the decade of 1990s, a very volatile and turbulent period for the copper market worldwide. Unlike previous studies, it tests for both long-run and short-run efficiency using cointegration and error correction model. Our results show that the market is not efficient and do not provide unbiased estimates of future copper spot prices, which has important implications for the users of this market. JEL classification: G14; C12; C32 Key words: Copper Futures Market; Market Efficiency; Unbiasedness Hypothesis; London Metal Exchange I. INTRODUCTION In this paper we investigate the long-run and short-run efficiency of the copper futures contract traded on the London Metal Exchange (LME). This contract is of particular interest given that the underlying commodity is the world’s third most widely used metal, the considerable commercial importance due to its electrical and mechanical properties and the volatile market conditions during 1990s. Furthermore, it had the highest share of trading during the last decade, in an exchange, which is the centre of the world’s trading in base metals. (a) This paper presented at the 2004 B&ESI Conference in Rhodes, Greece. The authors are grateful to the reviewers, the discussant of the paper Prof. J. Polychronis and the participants of the conference for their helpful comments. This paper has been published in Global Business and Economics Review, Anthology 2004, pp. 261-271. The 1990s was a very volatile and turbulent period for the world spot and futures copper market and especially in the LME. At the beginning of 1989 the copper spot price in the LME was a little bit above $3,500 per tonne, while the futures price was $3,150 per tonne for the three months futures contract and $2,170 per tonne for the fifteen months futures contract. By 13/2/1990 these prices had fallen to $2,388, $2,320.9 and $2,100 per tonne respectively. After a new spot price fall to $2,100, it reached close to $3,400 by September 1990. Since that month the price of copper fell gradually for over two years reaching the lowest point in May 1993 ($1,730 per tonne). But the situation will change sharply in the years to come. The continuous rising of the demand for copper by the aerospace, electrical and automotive industry, and above anything else the demand from the rapidly growing industry of information systems over the last decade, combined with the investing spring in China and the stable supply of copper, drove its spot price to high levels ($3,235 in July 1995). However, in the beginning of June 1996, Sumitomo Corporation of Japan- the leading trader in the copper market- reported a loss of $1.8 billion on copper trading due to the activities of one of its traders. The market was shocked and the copper spot price reached $1,830 by the end of June 1996. The market recovered relatively quickly and the copper spot price reached to $2,720 per tonne by the end of June 1997. However, this rise did not last long. The crisis in the economies of the Far East combined with the rise in the supply of copper and the development of new less costly mining methods drove the price of copper to the level of $1,415 on 23rd February 1998. The lowest copper spot price for the last decade occurred at 2/3/1999 ($1,355 per tonne), while reached to $1,773 per tonne by the end of April 2000. During the recent years, over 95% of all copper traded in the world terminal market of non- ferrous metals is traded on the LME. The LME is not a cash cleared market. Its clearing system operates between principals based on bank guarantees and other forms of collateral. Both floor and inter-office trading are covered by a matching system run by the London Clearing House (LCH). LCH acts as a counterpart to trades executed between Clearing Members and thereby reduces risk and settlement costs. If futures markets are to fulfill their price discovery function, in that they provide forecasts of future spot prices, it is necessary that the markets be efficient. Fama (1970, 1991) contends that market efficiency is not testable and that it must be tested jointly with some models of pricing assets. According to the futures markets literature, the model that futures prices are unbiased estimators of future spot prices is the appropriate framework to test efficiency. Using this model, efficiency will necessarily imply that the market price fully reflects available information and so there exists no strategy that traders can speculate in the futures market on the future levels of the spot price exploiting profits consistently. However, if the joint hypothesis is rejected, it is not possible to argue whether the market is inefficient or the asset-pricing model used is inappropriate. This paper is significant for the following reasons: a) It investigates the efficiency of copper futures contract traded on the LME for the decade of 1990s, a very volatile and turbulent period for the copper market worldwide, which has not been covered by earlier relevant studies; b) Unlike previous studies, this paper tests for both long-run and short-run efficiency; and c) It provides new evidence for the efficiency of London copper futures market, examining its consistency with the main earlier studies on LME during 1970s and 1980s. In this paper we argue that while markets could be seen as efficient in the long run, there may be substantial deviations from the equilibrium relationship in the short- run. The long-run efficiency of the copper futures market is tested using both Engle-Granger cointegration tests and the Johansen Maximum Likelihood Procedure and short-run efficiency is examined by constructing and investigating an error correction model. The rest of this paper is organized as follows: Section II discusses market efficiency as it relates to futures trading, while Section III presents a brief literature review, outlining the empirical results of the most significant studies on LME copper futures market. Section IV sets out the methodological issues of our study, involving the cointegration approach and the testing procedure for futures market efficiency. The data used and the empirical results obtained are presented in Section V. Section VI presents the interpretation and implications of the results, while Section VII provides a summary and the conclusions. II. FUTURES MARKET EFFICIENCY: THEORY AND TESTING As pointed out by Fama (1970), a financial market can be considered as efficient if prices fully reflect all available information and no profit opportunities are left unexploited. The agents form their expectations rationally and rapidly arbitrage away any deviations of the expected returns consistent with supernormal profits. Under conditions of risk neutrality, market efficiency implies that St = Ft-n ,t + et (1) This equation states that the futures price, Ft -n ,t for delivery at time t, is an unbiased predictor of the future spot price, St , at contract expiration, given the information set available at time t-n. Therefore, it is the algebraically representation of the Unbiasedness Hypothesis or Simple Efficiency (Hansen and Hodrick, 1980) or Speculative Efficiency (Bilson, 1981). Under this hypothesis, deviations between Ft-n ,t and St should have a mean zero and will be serially uncorrelated. This equation provides a pricing model specification and enables the efficiency of futures markets to be examined. Fama (1991) supports that market efficiency involves testing a joint hypothesis of efficiency and the asset pricing model. Empirical analysis of Equation (1) allows the examination of the joint hypothesis of market efficiency and unbiasedness in futures prices. Equation (1) can also be written by regressing the spot price at maturity on the futures price some time prior to maturity: St = α + bFt −n ,t + et (2) Market efficiency requires that α=0 and b=1. It is also normal to assume that futures prices closer to the expiration dates will provide better estimates of the future spot price than do those further away. Rejection of the restrictions imposed to the parameters α and b means that either the market is inefficient or a non-zero risk premium (α≠0) existed in futures markets. III. LITERATURE REVIEW A significant number of studies have examined the efficiency of copper futures markets during the last three decades, using different methodological techniques. Goss (1981) examines the hypothesis that futures prices are unbiased predictors of the subsequent spot prices for the markets of copper, tin, lead and zinc, using daily price data from the LME for the period 1971-1978. He rejects the unbiasedness of futures prices for lead and tin, while he reports contrary results for the cases of copper and zinc futures contracts. He revised his paper in 1985 by introducing joint tests for the same metals of the LME extending the sample period to 1966-1984. His results show that the Efficient Market Hypothesis (EMH) is not rejected for lead and tin, while is rejected for copper and zinc. Canarella and Pollard (1986) test the hypothesis that the futures price is an unbiased predictor of the future spot price using both overlapping and non-overlapping data for the contracts of copper, lead, tin and zinc covering the period 1975-1983. Using three different estimation methods, they confirm the unbiasedness hypothesis. Fama and French (1987) examine whether the futures prices for copper and other metals contain evidence of forecast power or systematic risk premiums for the period 1967-1984. They show that the copper futures price contains suggestive evidence of both systematic risk premiums and forecasting power. Gross (1988) examines unvaried LME prices starting with the first trading day in 1983 till the last one in September 1984 in order to test the EMH. Based on the mean square error criterion, he provides evidence that the EMH is not rejected for the copper futures market. Sephton and Cochrane (1990, 1991) examine the unbiasedness hypothesis in the LME with respect to six metals for the period 1976-1985. They conclude that the unbiasedness hypothesis is rejected and the LME is not an efficient market. Each of the above studies employs a traditional hypothesis testing procedure, but the issue of the non-stationary behavior of various spot and futures price series raised concern regarding the use of conventional statistical procedures. Among the first studies that suggested the use of Engle-Granger cointegration test is that of Shen and Wang (1990) coming as a response to the remarks of Elam and Dixon (1988). Some of the studies provide evidence of accepting the EMH, supporting that the futures prices are unbiased predictors ofthe future spot prices for the case of copper futures contact. For example, MacDonald and Taylor (1988a) test the EMH for four metals in the LME covering the period 1976-1987. Their basic conclusion is that the copper and lead futures markets can be considered as efficient, whilst the EMH is rejected for tin and zinc. MacDonald and Taylor (1988b) support the ΕΜΗ for the same metals in the LME for the period 1976-1985. Moore and Callen (1995) examine the Speculative Efficiency ofthe LME for six base metals between 1985 and 1989. They show that the long-run speculative efficiency cannot be rejected for the copper and other three metals. On the other hand, the same hypothesis is rejected for the copper futures contract traded on the LME according to Chowdhury (1991) and Beck (1994). IV. METHODOLOGICAL ISSUES: COINTEGRATION AND FUTURES MARKET EFFICIENCY Standard statistical techniques of parameter restrictions as those presented in relation to equation (2) are not reliable in circumstances where data are non-stationary. However, cointegration provides a satisfactory means to investigate (2), in the presence of non-stationary series. When two price series, such as the future and the spot price series, are both integrated of the same order d, a linear combination of two I(d) series can be integrated of an order lower than d. More specifically, it is possible that two series that are non-stationary and contain a unit root, for example I(1), can generate a linear combination that is stationary, I(0). These two series are said to be cointegrated with a cointegrating relationship of the following form. St - α - bFt-n = et (3) Cointegration of two price series is a necessary condition for market efficiency, since the Efficient Market Hypothesis implies that the future price is an unbiased predictor of the future spot price. If the two series are cointegrated, St and Ft-n move together and will not tend to drift apart over time. If this is the case, then the futures price is an unbiased predictor of the future spot price. In order to test for cointegration between the two markets, both the ADF test on the cointegrating regression residuals as described by Engle and Granger (1987) and the Johansen Maximum Likelihood Procedure (Johansen, 1988) are implemented. The latter is a preferred method of testing for cointegration as it provides a unified framework of estimating and testing the cointegration relationships in a VAR error correction mechanism, which incorporate different short-run and long- run dynamic relationships in a system of variables. The Johansen cointegration procedure firstly specifies the following unrestricted N-variable VAR: (4) where xt , = [ ft , , s t , ], µ is a vector of intercepts terms and εt is a vector of error terms. Johansen (1988) and Johansen and Juselius (1990) re-parameterized equation (4) in the form. (5) Equation (5) is now a VAR re-parameterized in error correction form, where Π= - (Π-Π1- …-Πk) represents the long response matrix. Writing this matrix as Π = αβ ,, then the linear combinations β , xt-k will be I(0) in the existing of cointegration, with α being the adjustment coefficients, and the matrix Π will be of reduced rank. The Johansen approach can be used to test for cointegration by assessing the rank (r) of the matrix Π . If r = 0 then all the variables are I(1) and there are no cointegrating vectors. If 0
MAT223H5S - Linear Algebra I - Winter 2025 Term Test 2 - Version B 1 1.1 (2 points) Let d = and a = . Determine whether or not d and a are orthogonal. 1.2 (3 points) Compute ||proja (d)||. Use a and d as above. You do not need to simplify fractions, roots, etc. 1.3 (1 point) Let T be a linear transformation with matrix AT = . What is the domain of T? (Is it R2 , R3 , or something else?) You do not need to justify your answer. 1.4 (4 points) Let A = . Is d in im(A)? (Use d as on the previous page.) 2 2.1 (5 points) Find the equation of the plane through the points P = (1, 2, 3), Q = (−1, 9, −2), R = (2, 0, 5). Give your answer in the form. ax + by + cz = d. You should only use the methods taught to you in this course to solve this problem. In particular, do not apply any formulas or shortcuts from outside the course. 2.2 (5 points) Show that the function F : R2 → R2 given by is not a linear transformation. 3 3.1 (4 points) Show that the set U defined below is a subspace. As part of your answer, find a spanning set for U. 3.2 (6 points) Let For each of the three subspace axioms below, determine whether the set V satisfies it or not. In particular, if you think that V satisfies a given axiom, explain why. If you think that V does not satisfy a given axiom, give an example showing that. (1) 0 ∈ V. (2) For all u, v ∈ V, we have u + v ∈ V. (3) For all v ∈ V and t ∈ R, we have tv ∈ V. 4 Let T : R2 → R2 be the linear transformation which reflects across the line y = 2x and then stretches in the x and y directions, each by a factor of 5. You may assume that AT = . 4.1 (5 points) Sketch a single copy of R2 which contains the following: • e1, e2, T(e1) and T(e2), • The fundamental parallelogram for T (i.e. the image of the unit square under T), • The lines y = 2x and y = −2/1 x. Note: For the questions on this page, you must justify your answers using only geometric explanations explicitly relying on and referring to your drawing from the previous part, or to a new drawing. Algebraic work (e.g. computations involving AT) can be used to check your work, but will not be marked. 4.2 (2.5 points) Explain geometrically why your drawing from the previous part implies that neither e1 nor e2 is an eigenvector for AT. 4.3 (2.5 points) Determine two basic eigenvectors v1 and v2 for AT geometrically using your drawing from the first part of this question (You do not need to determine the eigenvalue(s) associated to those basic eigenvectors.) 5 (2.5 points each = 10 points) Determine if the statements below are true or false. Make sure to justify your answers! You will receive no credit for simply selecting “true" or “false", or providing little explanation. 5.1 True or False: Suppose that U is a subset of R3 such that is in U, but and are not in U. Then U is not a subspace of R3 . 5.2 True or False: If a, b, c ∈ R3 and span{a, b, c} is a plane, then span{a, b} is a line. 5.3 True or False: Let T : Rn → Rn be a linear transformation, and let b be a fixed element of Rn . Then the set {x ∈ Rn | T(x) = b} is a subspace. 5.4 True or False: The system of equations below represents three planes in R3 that intersect in a point:
Picture Books in Children’s Culture – HUMA/CCY 3691A, Winter 2025 10-page Analytical Writing Exercise or Creative Options Weight: (30%) Length: Option#1: 10 page essay typed, doubled-spaced in MLA format, plus Works Cited list. Option #2: 20-page picture book AND 5-page essay in proper MLA format, plus Works Cited list. Option #3: 25-page picture book or comic book summarizing the course, using words and images to explain and exemplify the techniques and central concepts ofthe course. Due: Tuesday, August 5th on or before 11:59 p.m. Toronto time. Assignment Instructions for Option #1: Applying important ideas from at least FOUR secondary readings in the course, analyze one of the final four picture books/graphic novels from our class. As before, your paper should spend time on close reading/viewing of the words & images and discuss several techniques that the author(s) & illustrator(s) have used, supported by the secondary authors. Your analysis should use those observations to make an argument related to one or more of the big ideas (or “The Big Questions”) that we’ve discussed over the term. What To Do: 1. Choose one of the following primary texts: Adora and the Distance, Rabbit Chase, and I Want My Hat Back. 2. Your introductory paragraph should identify the book, the author, the illustrators, and any other relevant contributors to the text. It might also contain a brief description of the types of image in the book, name the secondary writers whose work you will be using and citing to support your analysis, or summarize the plot of the tale in one to two sentences. It MUST contain a thesis statement (that is, the main argument towards which your paragraphs will build.) 3. For your body paragraphs, choose important and/or representative pages or panels – you won’t likely have room to discuss every page, image, or set of words. Still, your paper should demonstrate a high level of familiarity with the text, describing your chosen sections in clear, careful detail and explaining why they are important (that is, are they part ofa pattern that repeats in this book? Do they suddenly break a pattern that’s been set up previously? Etc.). Include the words in quotation marks when & if you discuss them. Consider capitals, font, and placement of the words. 4. Your secondary sources should be used to support your discussion of technique AND to support your analysis about the implicit & explicit messages in the primary texts. You may use more than four of these sources, but you must use at least four in the body paragraphs. Please use direct quotes for most of the secondary sources. 5. Yes: Paragraphs, plural. A standard page in MLA style. has two or two and a half paragraphs on a page, and each paragraph looks at a slightly different aspect of the material. 6. You may discuss the whole primary text, including any paratextual material, in your paper. 7. You may include very short excerpts from non-class sources to support your ideas, but think carefully about doing so – is Shmoop’s plot summary really going to be better than your own explanation? Does that anonymous web page say dumb things about young people that we’ve already debunked? (If so, maybe just feel quietly superior to that page, and don’t use it…) You may also make brief connections to other picture books that we’ve covered in class, as well as any other intertextual references (such as books/films/songs/etc.,). In all of these cases, you must cite them correctly and completely in MLA style. 8. Include a Works Cited list that is complete & correct in MLA format. 9. Try to keep in mind my feedback from the earlier assignments, if you got feedback, as well as our class discussions, so that you’re not repeating mistakes. Consider making an appointment with the Writing Centre: it’s free to students, and if you tell them what kind of feedback you’ve received or what you’re struggling with, they can be very helpful. 10. Consider making an appointment for my office hours to have me look over your draft or discuss your ideas. I love helping students express themselves & demonstrate their understanding of a course! What Not To Do: 1. Do not make this a 5-paragraph essay. See the note above on paragraphs. 2. Don’t just say, “she’s angry”. Tell me how you know: close description pays attention to details and doesn’t assume that I can guess what you’re thinking. 3. Avoid historical claims: “women never had any rights” or “children have always been able to read” are not only inaccurate but also unprovable without waaaay more space and research than you have time for. 4. Don’t try to “prove” something about “real children” using the books that are aimed at them. Similarly, avoid generalizations about what child readers can or cannot understand, given that the legal definition of a child is any human being from birth to age 18... 5. Avoid general opinion claims. “Making it relevant”, “to entertain”, and “to keep it interesting” are weak statements reasons because they’re all opinion – presumably most books intend to entertain and be interesting (and some to teach as well). 6. Don’t confuse the scholars’ ideas/explanations with their examples. 7. Don’t overdo the “I” statements: “I think” and “in my opinion” aren’t necessary. You are writing, so it must be your thoughts and opinions – but those opinions should be informed by our course discussions & scholarly readings. 8. Don’t use so many scholarly quotes that you have no room for your own ideas. 9. Don’t go above eleven pages. I will stop reading. Try to stick to ten. 10. Don’t send me a draft by email and ask for email feedback – make an appointment to meet me on Zoom, and THEN send the material so that I can look it over & discuss it with you in real time. Assignment Instructions for Option #2: Applying important ideas from at least FOUR secondary readings in the course, create a picture book or comic book. Then write a short essay explaining which techniques you used & why, the explicit messages, and the implicit ideologies. What To Do: 1. Be creative! Write & illustrate a story or a non-fiction work of 20 pages. 2. Think about your intended audience: are they young children? Pre-teens? Teens? (If they’re quite young, think about that dual audience…) 3. Think about the point you want to make, or the thing you want your audience to see clearly at the end of your book. 4. Think about the kinds of assumptions/viewpoints you want to encourage or challenge implicitly (that is, not saying it right out, but still putting the message out there). 5. Be consistent about the style. – don’t use abstract symbols made by markers on one page & collage on the next and semi-realistic cartoon styles on the next. 6. Use at least four artistic techniques (colour, line, interplay of words & images, font, size/position, panels, bleeds, etc., etc.,) to create particular effects (drawing the eye in a direction, for example, or indicating motion, or disrupting racial stereotypes…) 7. Include a cover with a title & paratextual material, including your name as you would want it published. Number your pages. 8. Write a five-page essay in proper MLA format analysing your own book using the scholarly & secondary readings from the course to discuss both technique & ideology on some of the most important pages. (Yes, that means you need a thesis statement, body paragraphs, etc., just as you have in the other essays this term.) Consider getting help from the Writing Centre or making an appointment with me for office hours. 9. TELL me what you’ve done, and on what page – don’t ask me to play “find the example” . 10. You must directly quote (and cite) the ideas of at least four secondary writers. Do NOT confuse ideas with examples. You need a Works Cited list. 11. Your paper should also connect your book briefly to at least a couple of primary texts in this course. This shows your sense of context: where does your work fit into the material created for young people? 12. Save the book and the essay as a PDF and upload it to Turnitin, or submit the essay to Turnitin & submit the book to me as a physical object. (Since I will not be answering my door at 11:59 on Friday night, this option likely means you need to turn the book in on the last Tuesday of class to receive feedback…) What Not To Do: 1. Do not make your 5-page paper a 5-paragraph essay. See the note in Option #1 about paragraphs. 2. In fact, see the whole section in Option #1 about what to do and not to do, and adjust for the required page length. You can use “I” here, but “I chose this style. because” is much stronger than “In my opinion children are …” 3. Do not choose this option if you hate trying to make art or are going to excuse a lack of effort by saying “I can’t draw”. Consider the different types of images we looked at: many of them were not highly realistic, but they conveyed lots of information. 4. Do not create a picture book that encourages hateful or stereotypical viewpoints. (DO feel free to call out and criticize racism, sexism, ableism, transphobia, and more!) 5. Do not claim that your work offers the “first ever” queer fairy tale or indigenous superhero or Muslim queen or asexual narrator or gender-fluid dragon slayer or neurodivergent love story. You’d be amazed – and maybe kinda happy – at what’s out there, though there’s certainly not enough diversity, and your story can add to that. (You can certainly claim that your book fits into a growing body of work aimed at a diverse audience and encouraging progressive views of the world & of young people. If your work does that, obvs.) Assignment Instructions for Option #3: Create a picture book or comic book of 25 pages that summarizes the big questions & ideas from our course. Your images & words should work together to explain and demonstrate important concepts from the secondary readings, applying them in examples to the primary readings. What To Do: 1. Be creative! Write & illustrate a book of 25 pages. You can make it a work of fiction or non-fiction, as you choose. Include a cover with a title & paratextual material, including your name as you would want it published. Number your pages. 2. Think about your intended audience: it’s mostly me, so you need to show that you understand the material we read/viewed this term; however, you might also imagine this book as a set of study notes for someone getting ready for a test, or as an explanation for someone who is thinking of joining the class next term. 3. Plan to provide an overarching argument or central set of concepts. Think about how you’re going to organize this book. 4. Use as many different styles and techniques as needed to show that you “get” the course concepts. If you only talk about lines and colour, it will seem like you missed a lot of the readings. 5. Refer to & cite both primary & secondary sources – please use direct quotes for the secondary sources. You need a Works Cited list at the end of your book. 6. Feel free to talk about non-class texts briefly (just be sure to cite them), but focus on course material. 7. Consider making an office hours Zoom appointment with me if you’re nervous about your ideas. 8. Save the book as a PDF and upload it to Turnitin, or submit the book to me as a physical object. (Since I will not be answering my door at 11:59 on Friday night, this option likely means you need to turn the book in on the last Tuesday of class to receive feedback…) What Not To Do: 1. Do not write an essay. Use the words & images together to explain the course concepts. 2. Don’t overdo the “I” statements: “I think” and “in my opinion” aren’t necessary. (See more pointers in Option #1.) 3. Do not choose this option if you hate trying to make art or are going to excuse a lack of effort by saying “I can’t draw”. Consider the different types of images we looked at: many of them were not highly realistic, but they conveyed lots of information. 4. Don’t aim this one AT children: this assignment is thinking about the material we give young people, but it’s not intended for them. Use the vocabulary we’ve built in the class. 5. Don’t go totally formal and incomprehensible, though: remember that the idea is to show that you understand the course, so your writing should be really clear to help you get that across. 6. Don’t forget to have fun! GRADES: Grades for the essays are assigned based on the following criteria: 1. Does the paper fulfill the requirements of the assignment? (Number of pages, MLA format, number of scholars, etc.) 2. Is there a clear, easy-to-understand thesis statement? Does it answer the question? 3. Does the paper demonstrate a clear understanding of the story’s plot and messages? Does it contain strong descriptions with relevant details? 4. Does the paper move beyond that description to offer a logical analysis? Is that analysis supported by the details provided in your description and by the work of the secondary texts? 5. Does the analysis incorporate the required scholars accurately and effectively? That is, does it demonstrate a strong grasp of the theoretical material from our course? 6. Does the analysis reflect the claim made in the thesis statement? 7. Is the paper using clear vocabulary? (Remember our discussion about synonyms & the dreaded thesaurus function…) 8. Are paragraphs used properly? Is the paper proofread for spelling, punctuation, and good grammar? (Does it show evidence that you’ve taken into account my earlier feedback on writing skills?) 9. Does the Works Cited list contain the book that is being analyzed and all other sources that you used for ideas or help, or about which you wrote in the paper? Grades for the creative portions are assigned based on the following criteria: 1. Does the book fulfill the requirements of the assignment? (Number of pages, number of techniques, creative title, etc.) 2. Is there a clear narrative and/or flow to the book? Does it offer a logical progression? 3. Does the book clearly have an intended audience? Can I tell that through the images, vocabulary, and subject matter? 4. Does the book show evidence of artistic effort? (It doesn’t have to be perfect or beautiful, etc., but it shouldn’t look like a game of Pictionary…) Do the pictures show care in creating the images, choosing the colours, deciding on styles? 5. Do the words show evidence of proofreading, care in choosing the words, and thought in terms of size, font, colour, and placement? 6. Do the words and the images work together to convey ideas and information? That is, if I had only the words, would I be missing ideas or information by not having the pictures? 7. Does the book demonstrate an understanding of the theoretical material in the way it uses techniques? Please keep in mind the late policy for this course, but also be aware of the final deadline for the semester. As well, as I’ve said above, be VERY careful to properly cite ALL material which you have used in any way, whether that material is scholarly or not. Academic honesty is a serious matter. Finally, if you want more information on my grading practices, see the Notes of Grading and Evaluation, available through eClass.
CS 120 (Summer 25): Introduction to Computer Programming II Long Project #2 - Twine due at 7pm, Tue 24 Jun 2025 1 Restrictions Do not use any of the following Python features in your code: ● import of libraries (except if explicitly allowed) ● List comprehensions ● Generators ● Type annotations ● with open - Explicitly open and close the file instead ● Ternary operator ● Recursion (until we study it) ● Lambda expressions ● Nested functions ● Closures 2 Overview In this program, you’re going to track a person’s path as they wander through a forest. As the person walks around, they will unroll a ball of twine so that they can find their way back - and you will keep track of where the twine is. 3 Background - Stacks A stack is a data structure which only allows you to add and remove from one end. We often draw them vertically (which is why we call them “stacks”), but an array is a handy way to track one. Each time that we want to “push” on to the stack (that is, add a new element), we will simply append to the array. Each time that we want to “pop” (that is, remove one), we will take it off of the tail end of the array. In fact, this is such a common thing to do that Python provides a method for it. Given an array of values, you can call pop() to remove one of the values. It will remove the last element from the array (that is, element [-1]), and return it: data = . . . a Python list, with at least one element . . . last = data.pop() # data is now shorter by one element There are a number of different ways to implement stacks - an array is only one of them. But it’s the one that I want you to use for this project! 4 twine . py In this program, you are wandering through the forest; you are lost! Happily, you’ve brought with you a ball of twine, that you unroll as you go. That way, you can always get back to where you started. (Sadly, there’s no way out of the forest. Sorry about that!) In this program, you will model this as a small interactive game. You will prompt the user with your current state, and then they will type a command; based on that command, you will update the state, print out some sort of response, and then prompt them for another command. The commands that you must support include: n,s,e,w (move one square in that direction), back (retrace your steps by one space), crossings (tell the user how many times they’ve been at the current location), map (print a map of the space you’ve travelled), and ranges (give the x and y bounds of your path so far). Note that none of these commands have any parameters. 4.1 The History You will model the twine using a stack, and the stack must be implemented as an array; each element in the stack must be an (x,y) tuple, giving your position at that point in the path. If the user gives the back command, you must pop the most recent value off of the stack, effectively moving you backwards in time. Your start position is always (0,0), and it must always be included, in the first element of the stack; you must not pop it off. 4.2 The First Question Before the very first prompt of the game (at the very beginning of your program) print() the following message. Please give the name of the obstacles filename, or - for none: Then, get one input() from the user (but ignore it completely). Once the rest of your program is working, you will update this, adding the “Obstacles” feature, which is documented at the bottom of this spec. 4.3 Prompt The prompt, before every command, must be exactly three lines, like this: Current position: (3,2) Your history: [(0,0), (1,0), (2,0), (3,0), (3,1), (3,2)] What is your next command? and after you have printed out the response to any command, you must add a blank line before the next prompt. (To make the output from GradeScope look a little nicer, please print out the third line of the prompt using print() - and then use input(), with no argument, to read the command.) 4.4 Errors If the user types any command which is not valid, print out an error message. For this program, error messages must begin with ERROR: and the autograder will ignore the rest of the message. However, your TA will inspect your code to see if you are printing out useful error messages, which would help the user. You must detect the following user errors: ● The user types more than one word on the command line. Since no com- mands take any parameters, this is an error. ● The user types a command which you don’t recognize. ● (When you implement Obstacles): The obstacles filename is blank ● (When you implement Obstacles): The obstacles filename doesn’t exist ● (When you implement Obstacles): The obstacles file has invalid data in- side it 4.5 EOF When the autograder runs your program, it will hook up a file to the input of your program. If you call input() when you are already at the end of that input file, Python will throw an EOFError. (EOF stands for ”End Of File”.) While we are not going to learn about exceptions in depth yet, I would like you to use the following code snippet: try: user_data = input() except: do_something_here This code protects you from EOFError. If you are able to read from the user, then the user data variable gets set, and you just move on to the next block of code. But if an exception occurs, then it will jump you into the except block - and in there, you can do whatever you want to handle the error. (For instance, you might want to break the loop that you’re in.) 5 twine . py - Command Details 5.1 Blank Lines If, when you’re expecting a command, the input instead is a blank line, then don’t treat this as an error. Instead, print out the following message, then go back and prompt for another input. You do nothing . 5.2 n,s,e,w The four directional commands are fairly self-explanatory; move in that direc- tion, pushing your new location onto the stack. (In this map, North is in the +y direction, and East is +x.) It’s perfectly OK if the user overlaps a place they’ve been before; this just means that the twine crosses over an older piece. In your program, this means that multiple entries in the stack will have the same value. You don’t have to print anything; just go ahead and print the blank line, and then print the new prompt. (You will add obstacle checking to this, later.) 5.3 back This command simply pops one value off of the stack - unless the stack only has one element. Normally, you would simply print You retrace your steps by one space but, if there is only one remaining value on the stack, then print Cannot move back, as you are at the start! 5.4 crossings Count how many times your current position is in the stack (including your current position as 1), and print out the result, like this: There have been 3 times in the history when you were at this point . NOTE: The crossings, map, ranges commands should all print out infor- mation only based on the current stack - to not try to keep additional in- formation. If you move backwards, your program should completely forget where you previously had been. 5.5 map Print out a grid of characters, which shows a map of the area near your starting point. It will show the origin (0, 0), your path, and the obstacles (once you’ve implemented that). Sometimes, the user may walk far enough away from the origin that part of their path is off the map; that’s OK; we simply won’t see that part of it. The map should always be exactly 11 characters wide, and 11 characters tall: it represents the world from (-5, -5) to (5, 5). Draw a box around it, as I’ll demonstrate in the example below. Print out the following characters: ● Print a + (plus) at the player’s current location - even if it is also the origin. ● Print a * (asterisk) at the origin (that is, (0, 0)), unless the player is there. ● Print a . at any location where the player has been, but which is not the origin or the player’s current position. ● Print a X at any obstacle. (If you haven’t implemented obstacles yet, then this doesn’t doesn’t apply to you yet.) ● Print a blank space otherwise. For example, if your stack contains [(0,0), (1,0), (2,0), (2,1), (2,2)], and the only obstacle is at (1,2), then print the following: NOTE: See the NOTE in crossings above. If the player has backtracked their path, only show the current path. 5.6 ranges This command scans through the current history (that is, the unrolled twine) and gives the furthest West, East, South, and North that the player has walked. The furthest West your twine goes is 0 The furthest East your twine goes is 2 The furthest South your twine goes is 0 The furthest North your twine goes is 2 NOTE: See the NOTE in crossings above. If the player has backtracked their path, only show the statistics for the current path. 6 Obstacles You can get most of the credit for this assignment without this feature. So, for your first version of this program, simply print out the prompt shown below, but ignore the first line typed by the user, and ignore the existence of obstacles. Add this feature later. Before the first prompt to the user, you must get the name of an “obstacles” file and read it. It gives a list of locations which are blocked, and the player cannot enter. 6.1 Code to Add to Your Movement Commands To implement obstacles, you will need to add a new check to your movement commands: n,e,s,w . You have only one thing to check for: if the user attempts to move into a location that has an obstacle, then print You could not move in that direction, because there is an obstacle in the way . You stay where you are . and then don’t push a new location onto the stack. If you succeed in moving, however, you don’t have to print anything; just go ahead and print the blank line, and then the new prompt. 6.2 How to Read the Obstacles File First, give the user a prompt: Please give the name of the obstacles filename, or - for none: and then, on the next line, read the filename. If the user gives you "- ", then you must not attempt to open any file; instead, just record that there are no obstacles to worry about in your variables, and start the game. If the user gives you anything else, then attempt to open the file given - if it works, then read the file to get the obstacles list. If it fails, then report an error message to the user (see below), give them the prompt again, and then ask again - loop until either the user gives you "- ", or a file that you can read. How do you detect the condition that the file does not exist? That’s easy! Python will throw an exception if you try to open a file, and it doesn’t exist. Look at this little example snippet (it’s very much like the EOFError handler above): try: my_file_obj = open("some_filename.txt") # if the file existed, then your code will reach this comment except: # if the file didn’t exist, then the code will go here . # make sure to write some code to do something in this case . 6.3 The Format of the Obstacles File The obstacles file simply contains a set of (x,y) pairs, one pair per line. Blank lines are allowed, although this time comments are not. The obstacles file can be of any size (including zero valid lines). A valid line in the obstacles file is simply two integers, separated by whites- pace, like this: 1 2 -3 10 0 1 So long as the values are both integers (and there’s nothing else on the line), you don’t have to do any more error checking. In particular, you may ignore strange things like having duplicate entries, having a (0,0) entry, or having exceptionally large entries - I won’t test any of these. 6.4 How to Store the Obstacles? There are a variety of ways that you could store obstacles as you read them from the file, and you are allowed to use whatever data structure you want. The simplest way to do this, from your perspective, is simply to use an array of tuples: each time that you read a new obstacle from the file, you add it with append(). This makes for simple, handy code - since you can use the in operator to search the list of obstacles, to see if it contains a given location. But arrays are pretty poor, when it comes to searching. You have to look at all of the elements, one at time, to figure out whether or not the array contains what you’re looking for. (Sure, the in operators means that you don’t have to write much code - but Python is doing a lot of work under the covers.) A better data structure, if you’d like to try it out, is a set. Down in the guts, it’s basically a dictionary - meaning that the in operator is lightning fast. But, unlike a dictionary, it doesn’t have any values; it only stores the keys. To create a new set object, do this: x = set() to an a new element to the set (if you try to add a duplicate, the set will silently ignore you): x.add(new_value) and you can use the in operator, just like a dictionary: if some_value in x: 7 Turning in Your Solution You must turn in your code using GradeScope.
DEGREES OF MSci, MEng, BEng, BSc, MA and MA (Social Sciences) INFORMATION RETRIEVAL M COMPSCI 5011 Wednesday 13 May 2020, 09:30 BST SECTION A 1. (a) The following documents have been processed by an IR system where no stemming has been applied: DocID Text doc1 france is world champion 1998 doc2 croatia and france played each other in the semifinal doc3 croatia was in the semifinal 1998 doc4 croatia won the semifinal in russia 2018 (i) Assume that the list of stopwords is the following: and, in, the, was, each, other. Build an inverted file for these documents, showing clearly the dictionary and posting list components. Your inverted file needs to store sufficient information for computing a simple tf*idf term weight, where wij = tfij *log2(N/dfi) [5] (ii) Compute the term weights (wij) of the terms ‘world ’ and ‘ 1998 ’ in doc1. Show your calculations. [2] (iii) Assuming the use of a best match ranking algorithm, rank all documents after computing their relevance scores for the following query: 1998 semifinal Show your calculations. Note that log2(0.75)= -0.4150 and log2(1.3333)= 0.4150. [4] (iv) Typically, a log scale is applied to the tf (term frequency) component when scoring documents using a simple tf*idf term weighting scheme. Explain why this is the case illustrating your answer with a suitable example in IR. Explain through examples how models such as BM25 and PL2 control the term frequency counts. [4] (b) Assume that the set of relevant documents for a query q is Rq, where: Rq = {doc1, doc2, doc5, doc7, doc8} An IR system ranks the top 10 results for this query as follows (the leftmost item is the top ranked search result): doc1 doc12 doc7 doc6 doc4 doc5 doc2 doc8 doc9 doc3 (i) Show the computed precision and recall values at each rank of the produced ranking for the query q. [3] (ii) Show the calculation of the interpolated precision values at the 11 standard recall levels for the ranking produced by the system for the query q. [2] (iii) Compute the average precision of query q for the returned ranking. Show your calculations. [2] (iv) Based on your understanding of the average precision measure, explain whether the obtained average precision score for query q was expected. Justify your answer. [3] (c) In various DFR models, term frequency tf is replaced with a normalised term frequency tfn as follows: Using an example of at least two documents of varying length, explain why such a normalisation is needed. Describe in detail how the above formula will behave for your chosen example documents. What is the role of the c parameter in the formula? [5] 2. (a) Consider a corpus of documents C written in English, where the frequency distribution of words approximately follows Zipf’s law r * p(wr |C) = 0.1, where r = 1, 2, … , n is the rank ofa word by decreasing order of frequency. wr is the word at rank r, and p(wr |C) is the probability of occurrence of word wr in the corpus C. Compute the probability of the most frequent word in C. Compute the probability of the 2nd most frequent word in C. Justify your answers. [4] (b) Suppose we have a corpus of documents with a dictionary of 6 words w1, ..., w6. Consider the table below, which provides the estimated language model p(w|C) using the entire corpus of documents C (second column) as well as the word counts for doc1 (third column) and doc2 (fourth column), where ct(w, doci) is the count of word w (i.e. its term frequency) in document doci . Let the query q be the following: q = w1 w2 Word p(w|C) ct(w, doc1) ct(w, doc2) w1 0.8 2 7 w 2 0.1 3 1 w3 0.025 2 1 w4 0.025 2 1 w 5 0.025 1 0 w6 0.025 0 0 SUM 1.0 10 10 (i) Assume that we do not apply any smoothing technique to the language model for doc1 and doc2. Calculate the query likelihood for both doc1 and doc2, i.e. p(q|doc1) and p(q|doc2) (Do not compute the log-likelihood; i.e. do not apply any log scaling). Show your calculations. Provide the resulting ranking of documents and state the document that would be ranked the highest. [3] (ii) Suppose we now smooth the language model for doc1 and doc2 using Jelinek-Mercer Smoothing with λ = 0.1. Recalculate the likelihood of the query for both doc1 and doc2, i.e., p(q|doc1) and p(q|doc2) (Do not compute the log-likelihood; i.e. do not apply any log scaling). Show your calculations. Provide the resulting ranking of documents and state the document that would be ranked the highest. [4] (iii) Explain which document you think should be reasonably ranked higher (doc1 or doc2) and why? [3] (c) Assume that a user’s original query is bargain books bargain DVDs really bargain books. The user examines two documents, d1 and d2. She judges d1, with the content books bargain bestsellers really bargain books, as relevant and d2 with the content bargain great DVDs as non-relevant. Assume that the IR system is using raw term frequency (with no IDF). Moreover, for relevance feedback, suppose the use of Rocchio’s Relevance Feedback (RF) algorithm, with alpha= 1, beta= 0.75, gamma= 0.25. First, provide the original query vector, clearly stating its dimensions. Provide also the vector representations for d1 and d2. Next, provide the reformulated query that will be run by the IR system after the application of Rocchio’s RF algorithm. Terms in the reformulated query with negative weights can be dropped, i.e. their weights can be changed back to 0 (please list all the vector dimensions in alphabetical order). Show your calculations. [7] (d) Explain, with a suitable example, why the terms added in a query that has been reformulated by a query expansion approach are weighted. [4] (e) Using an appropriate analogy from Computer Science of your choosing, explain in detail why positive feedback is likely to be more useful than negative feedback to an information retrieval system. Illustrate your answer with an example from a suitable search scenario. [5] 3. (a) A Web search engine receives a large number of ambiguous queries. Briefly discuss three possible techniques a Web search engine might use to deal with such queries. [4] (b) Using a suitable example, explain why Precision at Rank R (P@R) is not a good metric to use for learning an effective learning-to-rank model. What metric would you suggest to use instead and why? [5] (c) A posting list for a term in an inverted index contains the following three entries: id=3 tf=2 id=6 tf=2 id=8 tf=3 Applying the delta compression of ids, show the binary form of the posting list when compressed using Unary compression for both ids and frequencies. What is the resulting (mean) compression rate, in bits per integer? [5] (d) Given the following hyperlink structure among five web pages, and assuming teleportation, show the step by step construction of the Google matrix for PageRank with a teleportation factor λ = 0.1. You need to write down all the matrices and intermediate results but you do not need to compute the final PageRank scores. NB: You can indicate matrices in plain text like a table, or write matrices row by row, e.g. ([a,b];[c,d]) shows a matrix with two columns and two rows where the first row is [a,b] and the second row is [c,d]. Explain which web page you think should intuitively have the highest PageRank value and why? [6] (e) The University of Glasgow has deployed a new search engine to support students and staff accessing up-to-date information. The University’s search engine receives a large number of time-sensitive queries such as ‘exams timetable ’ and ‘graduation ceremony’ as well as queries where the users aim to find a particular web page (e.g. ‘international student support appointments ’ or ‘assessment scale’). The University would like its search engine to be evaluated and appoints you to be in charge of this evaluation. Using a maximum of 750 words, explain how you will evaluate such a system. As part of your answer, you will need to describe a number of alternative evaluation approaches you will suggest to the University, what resources you will require from the University and how you will practically deploy these approaches, describing their advantages and disadvantages as well as the evaluation metrics you will use. Which evaluation approach you would recommend to the University and why? [10] SECTION B 4. (a) In the classical offline retrieval evaluation method, given a corpus of documents and a set of queries, the assessors judge the relevance of each document in relation to each query. The relevance of a given document is also assessed independently from other documents. Apart from the cost of developing a test collection, using suitable examples, briefly describe the three other main limitations of this type of evaluation. [3] (b) Consider the following TF*IDF ranking formula: where ct(w,d) is the raw count of word w in document d (in other words, the term frequency TF of w in d), and IDF(w) is the IDF of word w. (i) Provide three reasons why the ranking formula above is unlikely to perform well. [3] (ii) How would IDF(w) change (i.e., increase, decrease or stay the same) in each of the following cases: (1) adding the word w to a document; (2) making each document twice as long as its original length by concatenating the document with itself; (3) Adding some documents to the collection. [4] (c) Suppose that on a four-point relevance scale, we give a 0 score for a non-relevant document, 1 for a partially-relevant document, 2 for a relevant document, and 3 for a perfect document. Suppose also that a query q returns five results doc1, doc7, doc20, doc15, doc2 (in that order) that are assessed as: perfect, relevant, non-relevant, perfect, and relevant, respectively. Assume that 1/log2 (rank) is used as the discount factor. You might wish to note that: log2 2 = 1; log2 3 = 1.59; log2 4 = 2; log2 5 = 2.32. (i) Provide the ideal DCG values for the perfect ranking for the given query q. [2] (ii) Compute the Normalised Discounted Cumulative Gain (NDCG) at rank 5 for the given query q (provide NDCG with 2 decimal places). Show your calculations. [3] (d) Consider a query with two terms, whose posting lists are as follows: term1 -> [id=3, tf=2], [id=8, tf=1], [id=12, tf=1] term2 -> [id=3, tf=5], [id=12, tf=4] Explain and provide the exact order in which the above two posting lists will be traversed by the TAAT & DAAT query evaluation strategies and the memory requirements of both strategies for obtaining a result set ofK documents from a corpus of N documents (K