MUSI 1310 Assignment 7 1. Harmonize the following two-note melodies in F major with cadences in root position. (write chords in the bass-clef staff. (2 points each) 2. Harmonize the following two melodies with standard progressions in D major. Both can be harmonized with a standard progression, with a regular harmonic rhythm. (12 points each) Write chords in both staves so that it could be played on a piano. No note should be higher than the melody line. Block chords are OK, but feel free to make your accompaniment more interesting.
Bioc0003 Capstone assessment 2024/25 Deadline and instructions for upload The Bioc0003 capstone will be submitted via a Cadmus assignment that you access via moodle (like the formative essays). The deadline is 12noon on Tuesday 20th May. Before starting to write your essay you should read the instructions in their entirety. Choose a protein that you consider to be interesting; it can be from a mammalian, bacterial or viral source. You should choose a protein for which the encoding gene has been cloned and that can be expressed and purified in a recombinant form. Write an essay about your protein and include the following four sections (replace ‘protein X’ with the name of your protein): 1.Introduction to Protein X In this section you should describe your protein of choice, giving details of its properties, biological roles and importance. Include information on the known structure and function of your protein, its properties, and biological relevance. You can discuss biological, medical or industrial applications also. You should write the introduction at a level that could be understood by a first year undergraduate. If terminology is used that is beyond our curriculum it must be clearly explained to your reader. We will expect there to be a diagram or some other relevant illustration in your introduction. 2. Cloning of the gene encoding protein X We want you to describe how you would clone the coding sequence for your named protein, from a named organism. Assume that you have access to relevant cells/tissue, from that organism, and that these express your protein. You must start from the cellular sample and not use plasmids that already have the coding sequence within them or chemically synthesised DNA. Describe the different experimental stages required to insert the relevant sequence into an expression vector. We do not need a precise methodology (eg details of how much enzyme and how long incubations last) but we do want you to show your understanding of the molecular mechanisms by describing all the relevant steps and their purpose. Include the cloning steps on a flow diagram (this can be combined with the flow diagram for part 3 if you wish. If you are using ‘older’ research papers to give you ideas then some of the techniques may now be obsolete. We want you to consider the techniques discussed within Bioc0003 and use these as the basis for your answer. 3. Purification of protein X In section 3 we are expecting you to use primary sources (i.e. peer reviewed original publications) to find details on a purification strategy for your protein. We then want you to explain the methodology that is described in the paper but we do not need fine details i.e. you do not need to tell me that 20 units of enzyme X were used and incubated at 37°C for 30 minutes. You should not give a prescriptive account of the methodology (i.e. not a ‘recipe’) but instead explain the principles behind each of the different techniques and illustrate the overall process with a flow diagram. 4. Characterisation of a novel homologue of protein X. Assume that you have identified an uncharacterised homologue of your chosen protein; the two proteins only share 25% sequence identity. Assume that the novel protein can be purified using the method that you have already described in the previous section (you do not need to repeat this information here). Explain how you could characterise this novel protein using a biochemical, biophysical or computational method covered in the Bioc0003 lectures. Outline the question that your experiment would address and speculate as to what results you might expect to obtain. Your experiment should address a question that you consider to be important. As you are characterising a novel and hypothetical protein you will have to think about how best to do this – higher marks will be given for clearly explained and innovative ideas. In choosing your experimental approach you should consider the most important or interesting characteristics of the protein that you have chosen. How might you test whether the novel homologous protein shares these properties or has other novel interesting properties or functions? In this section you should clearly explain the question that you will address, outline how you will perform. the experiment, speculate as to the possible outcomes of your experiment, and explain how you would interpret them. Essay structure and formatting You should use no more than 2200 words and remember that this is an essay question NOT a short answer question; you need to structure your answer using a stepwise style. to introduce and explain concepts. Use headings as suggested above for each separate section. You can use diagrams in your answer. If these are taken directly from a published source then you should reference this. You should write a legend for each figure (use your own words and don’t copy directly from any source) but we will not include the words in the overall word count. You should also list the references used throughout your essay using the style. explained below. We are expecting you to use textbooks and scientific publications not web sources. Where possible use modern references over older ones and our expectation is that you can successfully complete this assignment with a maximum of ten sources. The reference list is not included in the word count. Referencing style.: When listing your references, you should use the Vancouver style. to cite your sources. References cited in the text must be given in numerical order and with the number in square brackets, in-line with the text i.e. not super- or sub-scripts e.g. [1], [2] etc. In the reference list you will place the references cited in number order. Books Author, initial, Book Title, Edition, Place of publication, publisher, date of publication Papers: Single author Other AN (2009) The sky is blue. J. of Sky Colour. 4:12-14. Two authors Other AN and Friend B (2006) Is the sky blue? J. of Sky Colour. 1:28-32. If there are more than six authors follow the sixth name with et al. Other AN, Friend B, Smith C, Li J, Shephard E and Taylor A et al (2007) Is the sky blue? J. of Sky Colour. 1:28-32. Note: The following are given in the reference examples above. Author surname and initials Year of publication Journal Title Volume (in bold) Page numbers (these are the numbers that follow the colon e.g. 28-32 ) Do NOT use webpages as the only source to substantiate a statement you have made
FUNDAMENTALS OF WATER ENGINEERING - CVEN9625 Assignment 2 Hydraulics Individual Assignment Requirements 1.1 Introduction This assignment covers the Hydraulics component of CVEN9625. You should complete them independently, by having first mastered the CVEN 9625 lecture material as well as having completed the specified Workshop problems. To guide you, the general topic related to each question is identified. 1.2 Assignment Value The value of this assignment towards your CVEN9625 final course mark is 20%. 1.3 Submission Place, Date and Time You should submit your solutions to this assignment electronically by uploading it to Moodle. The due date and time are: 11:00 pm (Sydney time) on 27/04/2025. Please note that (i) late assignments (including those submitted after 11:00 pm on the due day) will attract a penalty of 5% per day, capped at five days (120 hours, including weekends), after which the submission will not be accepted. (ii) computer or printer malfunction are not accepted reasons for late submissions. You can submit handwritten solutions, but please ensure that they are legible and easy to read. 1.4 Important Points Relating to the Assignments Please note: • You are expected to complete all calculations and setting out yourself - copied assignments (irrespective of whether the assignment was the original or not), may well result in 0 marks being awarded and these assignments will not be returned. • Submission transmitted electronically, must be contained within a single file. Multiple files of any type containing this assignment will not be accepted, • The front page of your submission must contain your name, student ID number and your email. • It is considered that the questions are reasonably straightforward and sometimes a hint is provided to enable you to complete all questions independently. If any well-based queries arise, responses by the Lecturer will be forwarded to the entire class. 1.5 Recommended Nominal Values of Various Parameters Unless otherwise specified in each question, you may assume the following values: • p = 1000 kg/m3 = density of fresh water (at 'room' temperature), • v = 10-6 m2/s = kinematic viscosity of fresh water (at 'room' temperature), • g = 9.80 m/s2 = acceleration due to gravity, • Patm = 101.3 kPa = atmospheric pressure, and • Pvap = 2.3 kPa (abs.) = vapour pressure of fresh water. Unless stated otherwise, all pressures used in this assignment are relative (also known as gauge) pressures. For example, a relative pressure would be written as (say) 8.5 Pa while an absolute pressure would be written as 8.5 Pa (abs.). It is strongly recommended that you complete all problems using relative pressure. 1.6 Marks Up to approximately 10% of the total marks for this assignment will be allocated to the clarity of your setting out. Moreover, to encourage you to adopt good problem-solving strategies, you must include one fully annotated diagram for each question, unless otherwise specified. An indicative allocation of marks has been made to each question, but some changes may be made. Question 1: Shear Force on a Moving Plate in a Viscous Oil Layer [12 Marks] A thin 50 cm × 50 cm flat plate is pulled at 3 m/s horizontally through a 3.6-mm-thick oil layer sandwiched between two plates, one stationary and the other moving at a constant velocity of 0.3 m/s, as shown in Figure 1. The dynamic viscosity of the oil is 0.027 Pa.s. Figure 1. A Thin Plate Moving Through a Sandwiched Oil Layer Assuming the thickness of the plate is negligible, and velocity in each oil layer varies linearly, do the following: (a) draw the velocity profile and find the location where the oil velocity is zero [5 marks], and (b) determine the force that needs to be applied on the plate to maintain this motion. [7 marks] [Hint: The point of zero velocity is somewhere in between the moving plate and moving wall, and its distance from the lower plate can be determined from geometric considerations (the similarity of the two triangles).] Question 2: Pressure - Manometer [13 marks] A double column enlarged ends manometer is used to measure a small pressure difference between two points of a system conveying air under pressure, the diameter of U-tube (d) being 1/10 of the diameter of the enlarged ends (D). The heavy liquid used is water, and the lighter liquid in both limbs is oil with a relative density of 0.82. When p1=p2, the fluids are at the same levels. Figure 2. Mano meter readings Assuming the surfaces ofthe lighter liquid to remain in the enlarged ends, determine: (a) The difference in pressure head(in mm of water) for a manometer displacement of Δ=50 mm. [9 marks] [Hint: Think about how the volume of fluid displaced in the enlarged ends relates to the U- tube's displacement. What must be true for the volumes to be equal? Understand this can help you find X.] (b) What would be the manometer reading if carbon tetrachloride (relative density 1.6) were used in place of water, the pressure conditions remaining the same? [4 marks] Note: You do not need to provide an annotated diagram for this question. Question 3: Hydroelectric plant Design This question consists of three tasks related to a hydroelectric plant that discharges water into a large reservoir used to supply water to nearby users, as schematically shown in Figure 3. When data are missing, make your assumptions and state them in your solutions. Figure 3 Scheme of the plant under study Task 3.1. Hydrostatics – Forces on plane surfaces [30 Marks] The artificial reservoir of a hydroelectric plant is obtained via a concrete dam. Water backs up behind the concrete dam, as shown in Figure 3.1a. Leakage under the foundation gives a pressure distribution under the dam as indicated, with pB = γ h and pA = γ hT . If the water depth, h, is too large, the dam will topple over about its toe (point A). The specific weight of the concrete is 25000 N m-3. Dimensions: L = 11 m, hD = 32 m, hT = 2.5 m, L1= 5 m. Figure 3.1 Scheme of a concrete dam for Task 1. Complete the following: (a) In the case of Figure 3.1a, determine the maximum water depth that can be achieved without dam failure. Conduct your analysis based on one unit length of the dam. [20 Marks] [Hint: Consider all forces and their locations, then balance the clockwise and counter- clockwise moments about point A to find h.] (b) If the dam were built with an inclined side upstream (Figure 3.1b), the maximum water depth would change. Calculate the maximum water depth in this second case. [10 Marks] Task 3.2. Momentum - Thrust against the penstock [18 Marks] Given the scheme in Figure 3.2, if the diameter of the pipe is 2 m, the angle α is 60˚, the radius of curvature is 6 m, and the flowrate is 35 m3 s-1. Neglect energy losses. Calculate the thrust of the water against the penstock between the circular sections A and B (provide both magnitude and direction). Figure 3.2 Scheme of a curving portion of the penstock. Task 3.3. Pipe flow – Energy losses [27 Marks] The high-head hydroelectric scheme consists of the reservoir (Figure 3.3) from which the water is delivered to four Pelton turbines through a low-pressure tunnel LT = 10000 m long, 4 m in diameter, lined with concrete. The tunnel splits into four steel pipelines (penstocks) 590 m long, 2 m in diameter each terminating in a single nozzle, the area of which is varied by a spear valve. The maximum diameter of each nozzle is 0.9 m. The difference in level between reservoir and jets is 540 m. Roughness sizes ofthe tunnel and pipelines are 0.1 mm and 0.3 mm respectively. (i) Find information about the main components of the plant (dam, surge chamber, penstock, spear valve) and briefly (1-2 sentences) describe their role in the plant. [5 marks] (ii) Determine the effective area of the jets for maximum power (assume the surge chamber to penstock entrance is smoothly rounded, resulting in no energy loss). [10 marks] [Hint: A commonly used guideline for optimizing hydro systems is that maximum power output is achieved when the total head loss in the system (including friction and local losses) is approximately one-third of the gross head. This balance ensures an optimal trade-off between flow rate and available head, allowing the turbine to operate efficiently while minimizing excessive energy losses. It also aids in determining the ideal nozzle opening for maximum power generation.] (iii) Determine the difference in level between the water in the surge chamber and in the reservoir under the conditions of maximum power. [4 marks] (iv) Draw the Energy and the Hydraulic Grade Lines for the system. [8 marks] Figure 3.3. Scheme of hydraulic plant
CS/EE UY 2204: Digital Logic & State Machine Design Course/Lab Assistants: The course assistants will assist in both the theory and lab components of this class. Their office hours will coincide with the lab hours below, so if you would like to ask a question please ask during their lab hours. You are welcome to use Brightspace forums for questions also. (FPGA) Lab Manager: ● Chris Ng ([email protected]); Contact person for all IT issues and lab access. Course Textbook: ● Fundamentals of Digital Design (With Verilog), Third Edition, Brown and Vranesic. (Please look under Resources on NYU Classes) Optional Reference Book: (Free e-version can be downloaded from NYU Library): Grading: ● Homeworks: 10% (Self-Graded. Note that we will be randomly checking a subset of submitted HW solutions.) ● Labs: 30%, in teams of 2 (Remote: We will be providing log in information to the lab, RH227. Students can also go into the lab during assigned Lab sections if they prefer) ● Midterm: 25% ● Final: 35% Tentative Class Schedule Week # Lecture Contents Labs/HWs Notes Jan 22 Introduction: Digital Hardware, Digital Representations; Boolean Logic Functions 1.1-1.5; 2.1-2.4 You do not need to attend Labs this week, since Lab 1 will only be assigned on Fri. Jan 29 Boolean Algebra and Intro to Verilog 2.5-2.10 Mon: Lab 1 Assigned Mon: HW 1 Assigned Feb 3,5 Minimizing Boolean functions 2.11-2.16 Fri: Lab 1 Due Feb 10,12 Number Representation and Arithmetic Circuits 3.1-3.3; 3.5-3.6 Wed: Lab 2 Assigned (Fabricate your own chip!) Mon: HW 2 Assigned Fri: HW1 Due Feb 17,19 Combination Circuit Building Blocks 4.1-4.5 Thurs: Lab 2 Due No class on Feb 19th (President’s Day) Feb 24,26 Verilog for Combination Circuits 4.6 Fri: HW 2 Due Mar 3,5 Sequential Circuit Building Blocks 5.1-5.4; 5.8-5.9 Mon: Lab 3 Assigned Wed: HW3 Assigned Mar 10,12 Implementation Issues + Verilog Implementation 5.10, 5.13-5.17 Mar 17,19 Mon: Lab 3 Due, Lab 4 Assigned Wed: HW3 Due Mar 24,26 Spring Break Mar 31 April 2 Week of Midterm (Mon: Review Lecture) (Wed: In class midterm) Mon: HW4 Assigned, HW 4 Due Midterm Apr 7,9 Synchronous Circuits Advanced 6.1-6.5 Fri: Lab 4 Due, Lab 5 Assigned Apr 14,16 Digital System Design Instructor Notes Mon: HW 5 Assigned; HW 4 Due Apr 21,23 Digital System Design Continued: Simple Processor Instructor Notes Fri: Lab 5 Due; Lab 6 Assigned Apr 28,30 Optimized Implementations of Digital Circuits 3.4, 3.6, 8.1, 8.2 Mon: HW 6 Assigned; HW 5 Due May 5 Review and Advanced Topics Fri: HW 6 Due Fri: Lab 6 Due May 7- May 13 Final Exam Based on University Schedule Course Policies: ● Lectures: All lectures will be in person. ● TA Help: The TAs are available to help you during their office hours, including help on both the lecture material and labs. Please make use of this resource. ● We will use NYU Brightspace for (1) to post course-related resources, examples, HWs, labs, lecture recordings; and (2) for lab/HW submissions (3) grades and (4) communicating with your classmates and with us, the teaching team. ● Labs: The Labs will be done in teams of 3. Each team will be assigned a computer that they can log in to remotely to access software tools. You can then do the labs on your own time. We will be releasing tutorial videos to help you with the labs.
EC 223. Empirical Application in Mathematical Statistics. Department of Economics. Part A. Modeling economic phenomena using the concepts of probability distributions. I. 1. Let X be a continuous random variable with probability density function f(x) = 2 – 2x, defined on the domain 0 ≤ X ≤ 1. Provide a graph of this function, with clearly labeled axes. 2. Show, that this function satisfies the following requirements of probability density functions: a) f(x) ≥ 0 b) 3. Using the property of the probability density function that states P(a ≤ X ≤ b) = f(x)dx and b are constants within the domain of the function, compute the probability P(0.25 ≤ X ≤ 0.75). 4. What is the cumulative distribution function, F(X), for this random variable X? 5. Compute the probability P(0.25 ≤ X ≤ 0.75) using the cumulative distribution function, F(X), that you determined in part 4 above. 6. Show the probability P(0.25 ≤ X ≤ 0.75) on the graph of the p.d.f. of random variable X. 7. Compute the expected value of random variable X using calculus. 8. Compute the variance of random variable X, using the following property of the variance: 9. Provide an example of possible application of this probability density function in economics. Part B. Implementing statistical analysis in Stata. Suppose that an airplane seat designer must consider the average hip size of passengers in order to allow adequate room for each person, while still designing the plane to carry the profit- maximizing number of passengers. What is the average hip size, or more precisely hip width, of U.S. flight passengers? If a seat 18 inches wide is planned, what percent of customers will not be able to fit? Questions like this must be faced by manufacturers of everything from golf carts to women’s jeans. How can we answer these questions? We certainly cannot take the measurements of every man, woman, and child in the U.S. population. This is a situation when statistical inference is used. Infer means ‘‘to conclude by reasoning from something known or assumed.’’ Statistical inference means that we will draw conclusions about a population based on a sample of data. To carry out statistical inference, we need data. The data should be obtained from the population in which we are interested. For the airplane seat designer this is essentially the entire U.S. population above the age of two, since small children can fly ‘‘free’’ on the laps of their suffering parents. A separate branch of statistics, called experimental design, is concerned with the question of how to actually collect a representative sample. How would you proceed if you were asked to obtain 50 measurements of hip size representative of the entire population? This is not such an easy task. Ideally the 50 individuals will be randomly chosen from the population, in such a way that there is no pattern of choices. Suppose we focus on only the population of adult flyers, since usually there are few children on planes. Our experimental design specialist draws a sample that is shown in the table below and stored in the data file on blackboard under the empirical assignment folder. Table1. The airline data on hip measurements (in inches). 1. A first step when analyzing a sample of data is to examine it visually. Draw a histogram of the 50 data points. Based on this figure, “eyeball” the average hip size in this sample. What is it approximately? Answer: the average hip size in this sample seems to be between … .. and … … inches: Copy-as-a-picture the jhistogram from Stata output and paste it here: 2. For our profit-maximizing designer this casual estimate based on the histogram is not sufficiently precise. He wants to set up a statistical model and starts by considering the hip size data that were obtained by sampling. Sampling from a population is an experiment. The variable of interest in this experiment is an individual’s hip size. Before the experiment is performed, we do not know what the values will be, thus the hip size of a randomly chosen person is a random variable. Let us denote this random variable as Y. We choose a sample of N=50 individuals, Y1; Y2; . . . ; YN , where each Yi represents the hip size of a different person. The data values in Table 1 are specific values of the variables, which we denote as y1;y2;...;yN. The designer assumes that the ec223 students learned about the basics of experimental design and suggests that the population probability distribution of the values of hip size has a center, which we describe by the expected value of the random variable Y, E(Y)=µ. Recall that we use the Greek letter µ (‘‘mu’’) to denote the mean of the random variable Y, and also the mean of the population we are studying. Thus, if we knew µ we would have the answer to the question ‘‘What is the average hip size of adults in the United States?’’ To indicate its importance to us in describing the population we call µ a population parameter, or, more briefly, a parameter. Our objective is to use the sample of data in Table 1 to make inferences, or judgments, about the unknown population parameter µ . The other random variable characteristic of interest is its variability, which we measure by its variance, σ2 , which is also an unknown population parameter: Var(Y) = E[Y – E(Y)]2 = E[Y - µ] 2 = σ2 In the context of the hip data, the variance tells us how much hip sizes can vary from one randomly chosen person to the next. The statistical model is not complete. If our sample is drawn randomly, we can assume that Y1; Y2; . . . ; YN are statistically independent. The hip size of any one individual is independent of the hip size of another randomly drawn individual. Furthermore, we assume that each of the observations we collect is from the population of interest, so each random variable Yi has the same mean and variance, or Yi ~ (µ, σ2). The observations Yi constitute a random sample, in the statistical sense, because Y1; Y2; . . . ; YN are statistically independent with identical probability distributions (random i.i.d. sample). It is sometimes reasonable to assume that population values are normally distributed, which we represent by Yi ~ N(µ, σ2). How shall we estimate the population mean m given our sample of data values in Table 1? The population mean is given by the expected value E(Y)=µ . The expected value of a random variable is its average value in the population. It seems reasonable, by analogy, to use the average value in the sample, or sample mean, to estimate the population mean, denoted y-bar: Compute the sample mean hip size, using data in Table 1. 3. How good is the sample mean as an estimator of the mean ofa population? We do not know the value of the estimator Y until a data sample is obtained, and different samples will lead to different values. To illustrate, we can collect 10 more samples of size N = 50 and calculate the average hip size. The estimates differ from sample to sample because Y is a random variable. This variation, due to collection of different random samples, is called sampling variation. For example, Table 2. Sample means in the repeated sampling context. It is an inescapable fact of statistical analysis that the estimator Y—indeed, all statistical estimation procedures— are subject to sampling variability. Because of this terminology, an estimator’s probability density function is called its sampling distribution. We can determine how good the estimator Y is by examining its expected value, variance, and sampling distribution. a) Show that the expected value of the estimator Y is the population mean µ that we are trying to estimate. How do we call this desirable property of a sample estimator? b) Show that the variance of the sample mean is smaller than the population variance. Recall that the variance of Y can be obtained using the procedure for finding the variance of a sum ofuncorrelated (zero covariance) random variables. We can apply this rule if our data are obtained by random sampling, because with random sampling the observations are statistically independent, and thus are uncorrelated. Furthermore, we have assumed that var(Y) = 。2 for all observations. c) Illustrate the property of consistency of the sample mean by using the graph of its sampling distribution in large samples. Provide a brief comment on your graph. Figure 1. d) Suppose we want our estimate of the population hip size to be within 1 inch of the true value, µ . For the purpose of illustration assume that the population is normal, σ2 = 10 and µ = 40. Compute the probability of getting an estimate of the sample mean that is within ε = 1 inch of the population mean, µ — that is, within the interval [µ-1, µ+1]. Can you tell if this probability would be greater or smaller if the sample size increases from N=40 to N=80? Explain your reasoning. e) We were able to carry out the above analysis because we assumed that the population of hip widths ofU.S. adults, has a normal distribution. A question we need to ask is ‘‘If the population is not normal, then what is the sampling distribution of the sample mean of hip width?’’ State the fundamental theorem that answers this question. f) For example, the hip width distribution can be triangular, with the probability density given by f(y) = 2y for 00.6191 and Prob(t(49) < -0.6191 = ” p_value_test The two-tail p-value is shown in Figure below:
Stat 4914 Final Project 3 Project 3: Free Rein The main goal of this project will be to implement the analysis methods we have discussed this semester on a problem of your choosing. Limit your report to 15 pages, including reproducible code. Hide unnecessary code output (library loading, ggplot code, etc.) but include relevant exploratory and modeling code (collinearity screening, model build- ing, assumption checking, etc.). Caption figures and tables, cite all sources, and proofread your submission. https://sportsandsociety.osu.edu/sports-data-sets Some suggested topics: • MVP or Coach of the Year: choose a league or season and propose a coach of the year or most valuable player based on empirical findings. • Compare Eras: compare and contrast the performance between two eras of a sport. • Playoff Format: propose an alternative format for a league’s playoffs or championship. • Rule Change: propose a rule change to reduce risk of injury, increase competitiveness, or improve a consistent flaw in a game. • Fantasy League: suggest a winning team for a fantasy league and support your choices with data. • Division Realignment: propose a realignment of teams to increase competitive balance. • Draft Grades: determine which teams historicaly perform best and worst in their league draft. a) Data Selection Find a high-fidelity data set of your choosing - please provide a reference. b) Question Formulation Thoroughly motivate and describe the research question you wish to explore. Provide relevant context so the ready can appreciate and understand your motivation and approach. c) Exploratory Analysis Conduct an exploratory analysis of your data, including preliminary variable screening and exploratory plots. Your exploration should be thorough and provide high-level visualizations and interpretation in context. Consider several aspects of a successful college basketball team - offense, defense, experience, coaching, level of competition, etc. d) Analysis Use appropriate statistical methods and tools to explore your research question. Provide necessary plots, figures, and tables. Provide statistical and contextual interpretations of your findings. e) Recommendations and/or Findings Provide a professional write-up of your findings, describing both the statistical and practical findings of your analysis.
Environmental Impact Assessment Study Brief No. SCI508-T1/2025G Project Title: Development of a Geological Heritage Trail on Lamma Island (hereinafter known as the “Project”) 1. BACKGROUND The Applicant will conduct a feasibility study for the development of a Geological Heritage Trail on Lamma Island to promote geotourism and geological education. The trail will connect key geological sites, including Kamikaze Cave ( ), Sok Kwu Wan abandoned quarries, and granite tors near Mount Stenhouse. The proposed trail route spans ~4–5 km and covers an area of~50 hectares, integrating existing footpaths to minimize habitat disruption. Infrastructure will include interpretive signage with QR codes linking to geological explanations, boardwalks over sensitive coastal zones, and viewing platforms at strategic points. Facilities such as rest areas, waste bins, and an information kiosk will also be established. The proposed trail alignment and conservation zones are shown in Appendix A. 2. OBJECTIVES OFTHE EIA STUDY To identify, evaluate and address any potential geological impacts arising from the Project and to propose measures to mitigate these impacts. 3. DETAILED REQUIREMENTS OF THE EIA STUDY 3.1The Scope This EIA study shall address key issues on potential geological impact arising from the construction and operation of the Project. Related issues may include coastal landscape preservation, technical viability, environmental impacts on coastal ecosystems, etc. 3.2Technical Requirements 3.2.1 The Applicant shall conduct the EIA study to address the environmental aspects of the activities as described in the scope as set out above. The assessment shall be based on the best and latest information available during the course of the EIA study. 3.2.2 Geological Impact 3.2.2.1 The Applicant shall follow the criteria and guidelines for evaluating and assessing landscape impact as stated in Annexes 10 and 18 of the TM respectively. 3.2.2.2 The assessment area for the purpose of the geological impact assessment shall include a reasonable area, and any other areas likely to be impacted by the Project. 3.2.2.3 The geological surveys at the Project area shall be carefully planned and carried out so as to avoid potential impacts on geological features or any species of conservation importance. 3.2.2.4 The geological impact assessment for the construction and operation of the Project shall follow the detailed technical requirements given in Appendix B of this EIA study brief. Appendix A Map of the proposed Geological Heritage Trail Appendix B Requirements for Landscape Impact Assessment General Requirements 1. Landscape assessment shall cover the followings: (i) a baseline study to provide for a comprehensive and accurate description of the baseline landscape; (ii) a review of the relevant planning and development control framework; and (iii) recommendations on the required mitigation measures and implementation programme. 2. The Applicant shall appraise and analyse the existing landscape resource and character of the study area. The assessment shall focus particularly on the sensitivity of the landscape framework and its ability to accommodate change. 3. The Applicant shall review relevant plans and studies so as to have an insight to the future outlook of the area affected and the means by which the project can fit into the environment. 4. The Applicant shall recommend mitigation measures to minimize the adverse effects identified in above. The mitigation measures shall include the retention of vegetation, transplanting of mature trees, provision of screen planting, revegetation of disturbed land, reprovisioning of amenity areas, design of structures, provision of finishes to structures, and any measures to mitigate the disturbance to the existing land use. 5. The Applicant shall follow the criteria and guidelines for evaluating and assessing landscape as stated in Annexes 10 and 18 of the TM respectively. Specific Requirements 1. Geological Field Measurements (i) to record the dimensions of granite joints, fractures, or tors (e.g., width, spacing); (ii) to test rock hardness using a simplified Mohs scale kit (e.g., scratching granite with steel nails, glass); and 2. Trail Route Mapping (i) Map the proposed trail route with a suitable scale (1:5000 to 1:10000), marking waypoints for geological sites by showing the types and locations of geological features in the assessment area; (ii) description of the physical environment, including all recognized sites of conservation importance and geological sensitive areas, and assessment of whether these sites/areas will be affected by the Project; and (iii) Conduct a “walkability” assessment of existing paths along the proposed trail (e.g., measuring path width, surface stability).
Mathematics 220 Midterm Practice problems from old exams 1. (a) Write the converse, contrapositive and negation of the following statement: For every integer n, if n is divisible by 3 then n 2 is divisible by 3. (b) Let An be the interval for n ∈ N. Find and (no proof is required). (c) Write R−N as a union of an indexed collection of sets where each set is an interval. 2. Consider the following two statements: 1. ∀n ∈ N, ∃ z ∈ Z such that z = n 2. ∃ z ∈ Z such that ∀n ∈ N, z = n One of the statements is true, and the other is false. Determine which is which and prove both of your answers. 3. (a) Give the definition of the power set P(A) of a set A. (b) Let A = {1, 2, {1, 2}}. Determine whether the following statements are True or False (and provide a brief explanation why). (a) {1, 2} ⊆ A. (b) {1, 2} ⊆ P(A). (c) {1, 2} ∈ A. (d) {1, 2} ∈ P(A). 4. Let A := {n ∈ N : ∃ z ∈ Z such that n = 2z + 1} and let B := {n ∈ N : ∃ k ∈ N such that n = 2k}. Determine the following: 1. A ∩ B, 2. A ∪ B, 3. A − B, and 4. B − A. 5. True or False: You do not have to give explanations. (a) N ⊂ Z. (b) [2, 3] ∈ P(R). (c) 2 ∈ P(R). (d) ∪n∈Z(n, n + 2) = R. (e) Q∩(√2,∞) = Q∩[√2,∞). 6. Using any method you like, prove that the following statements are logically equivalent: Statement 1: Q ⇒ (R ⇒ S) Statement 2: (Q ∧ R) ⇒ S. 7. Let n ∈ Z. Prove that n3 − 5n2 + 13 is odd. 8. (a) Write the negation of the following statement: “For every positive there exists a positive δ such that if |x| < δ then |f(x)| < .” (b) Is the number 0.7(π −3.1415) rational or irrational? (Include a short proof; you can assume without proof that π is irrational). 9. Prove that if n and m are odd integers, then n 2 − m2 ≡ 0 (mod 8) . 10. (a) Prove that √10 is irrational. (b) Prove that the following statement is False: If x, y are both irrational, then x − y is irrational. (c) Prove that √5 − √2 is irrational. 11. (a) Write the negation of the following statement: “For every (a, b) ∈ N × N, if a > b then (a + b)2 ≥ (a − b)2 .” (b) Write the converse and contrapositive of the following statement: “If it is raining outside then this is Vancouver.” (c) Give a precise mathematical definitions of the following sets (d) For any n ∈ N, let Simplify the following sets (e) Let A, B be sets in some universal set U. Suppose that A¯ = {3, 8, 9}, A−B = {1, 2}, B − A = {8} and A ∩ B = {5, 7} Determine A, B, U. 12. (a) Prove or disprove the following statement Let a, b, c, d ∈ R. If ab ≥ cd then a ≥ c and b ≥ d. (b) Prove or disprove the following Let a, b, c, n ∈ Z so that n ≥ 3. If a + b ≡ 1 mod n and b + c ≡ 1 mod n then a + c ≡ 2 mod n. (c) Repeat part (b), but when n = 2. 13. Let n ∈ Z. Prove that n 2 + 1 is odd if and only if 7n + 3 is odd. 14. Determine whether the following four statements are true or false — explain your answers (“true” or “false” is not sufficient). (i) ∀x ∈ R, ∀y ∈ R, if (xy ≥ 0) then (x + y ≥ 0). (ii) ∀x ∈ R, ∃y ∈ R s.t. if (xy ≥ 0) then (x + y ≥ 0). (iii) ∃x ∈ R s.t. ∃y ∈ R s.t. if (xy ≥ 0) then (x + y ≥ 0).
PRACTICE MAT223H1S Final Exam Winter 2025 Section A. Instructions: 1. The problems in this section will ask you to complete a definition or to prove a theorem from the course lecture notes. 2. Definitions must be stated precisely as they are in the course lecture notes (up to rewording). Each definition statement is worth one point and no partial credit will be given. 3. Theorem proofs will each be worth five points, which will be awarded using our standard rubric (which is available in the Section C instructions). A1. (1 point) Complete the following definition: The span of vectors , , . . . , in Rn is . . . A2. (1 point) Complete the following definition: A system of linear equations is called consistent if . . . A3. (1 point) Complete the following definition: The dimension of a vector space is . . . A4. (1 point) Complete the following definition: A non-zero vector is called an eigenvector of a matrix A if . . . A5. (1 point) Complete the following definition: The singular values of a matrix are . . . A7. (5 points) Prove the following Proposition (Proposition 11.10): Let B be an orthonormal basis for R n and take any vectors , in R n. Then, []B · []B = · . Section B. Instructions: 1. Each problem in this section is worth three points. 2. Problems with multiple parts will be worth one point each. Otherwise, no partial credit will be given. 3. You do not need to show your work or provide justification on any problem in Section B. 4. Your answer must be placed in the answer box provided. 5. We have provided extra space for your scratch work on each problem, but nothing outside of the answer box will be considered toward your score on the Section B problems. B1. (3 points) For the systems of linear equations described below, determine whether the system has no solution, exactly one solution, or infinitely many solutions. a) A system whose coefficient matrix is invertible. Answer: The system of linear equations has No solutions Exactly one solution Infinitely many solutions b) A system whose augmented matrix is invertible. Answer: The system of linear equations has No solutions Exactly one solution Infinitely many solutions c) The system with augmented matrix AT , where A is the augmented matrix representing the system in part (a). Answer: The system of linear equations must have No solutions Exactly one solution Infinitely many solutions B2. (3 points) For each linear transformation defined below, determine whether the reduced row echelon form. of its defining matrix has a pivot in every row, every column, both, or neither. a) F : R4 → R3 satisfying that is linearly independent. Answer: Pivots in every row and every column Pivots in every row but not every column Pivots in every column but not every row None of the above b) G = TQ, where Q is an n × n orthogonal matrix. Answer: Pivots in every row and every column Pivots in every row but not every column Pivots in every column but not every row None of the above c) H : R2 → R4 with Answer: Pivots in every row and every column Pivots in every row but not every column Pivots in every column but not every row None of the above B3. (3 points) Calculate the following determinants. a) det(AB) where and B = AT , the transpose of A. det(A) = b) det(F), where F is the inverse of the function G where G: R2 → R2 is the linear transformation which stretches vectors in the + direction by -3 and leaves the − direction unchanged. det(F) = c) Let C be standard defining matrix of F from part (b). Is it possible that C similar to the matrix AB from part (a)? Yes, it is possible No, it is not possible B4. (3 points) Determine which of the following matrices are invertible. If there is not enough information to determine whether the matrix is invertible or not invertible, select “could be either”. a) A 3 × 3 matrix N satisfying that N3 is the zero matrix. Is invertible Is not invertible Could be either b) A symmetric matrix. Is invertible Is not invertible Could be either c) The defining matrix of the linear transformation in R 3 that rotates around the z-axis by an angle of . Is invertible Is not invertible Could be either B5. (3 points) Chapter 10, part B problem (Kevin) Let A be a 3 × 3 matrix with eigenvalues 0, 1, 2. Find the eigenvalues of the following matrices: a) The matrix A2. b) The matrix A − I3. c) The matrix 3(AT )2. B6. (3 points) Let ε be the standard basis of R3. Consider the basis a) Find given that b) Find the change of basis matrix from B to ε. c) Find the change of basis matrix from ε to B. B7. (3 points) Let a) Find the characteristic polynomial of A. Answer: χA(x) = b) Find the dimension of the 1-eigenspace E1. Answer: dim E1 = c) Find an invertible matrix C so that C−1AC is a diagonal matrix. B8. (3 points) Determine which of the following statements are always true and which are always false. If there’s not enough information to determine whether a statement is always true or always false, select “could be true or false”. a) If and are two vectors in Rn such that · = 0, then {, } is a linearly independent set. Always true Always false Could be true or false b) If a linear transformation F : R3 → R3 preserves the angle between every pair of vectors, then its defining matrix A is orthogonal. Always true Always false Could be true or false c) Let V be a vector subspace of Rn. Every basis of V has n elements. Always true Always false Could be true or false Section C. Instructions: 1. Each problem in this section is worth 5 points. 2. You must provide justification for all of your answers in Section C. 3. Points will be awarded based on the rubric below. Note that half points may be awarded, and further rubric items may be added to cover potential cases not outlined below. Points Rubric 5 Solution is presented with clear justification that is logically complete and correct. May include minor typos and computational errors if they do not majorly impact the argument. No important steps are missing or assumed. All assumptions and special cases have been covered. All suggestions for improvement come under the category of “improvements for clarity” rather than “correcting logical errors”. Omission of details will be judged depending on context of the material, with simpler steps being acceptable for omission when covering more advanced topics. 4 Solution is close to full and complete, but contains either a computational error or an error in reasoning that majorly impacts the argument. This score is also appropriate for solutions that are mathematically sound but confusingly written. 3 Solution is incorrect, but understanding of the problem was demonstrated and stu- dent provided a clear outline of a potential approach with information about where they got stuck -or- solution is correct but justification is insufficient or so confus- ingly written that it cannot be followed with a reasonable amount of effort. 2 Solution is incorrect, but student demonstrated understanding of the problem -or- solution is correct and student did not provide justification for their answer. 1 Solution is incorrect and student did not demonstrate understanding of the problem, but did demonstrate some knowledge of relevant material. 0 Solution is incorrect or incomplete, and there was no demonstration of knowledge of relevant material. C1. (5 points) Let A be an m × (n + 1) matrix, and suppose that the system of linear equations in n variables with augmented matrix A has at least one solution. Show that the homogeneous system of linear equations in n + 1 variables with coefficient matrix A has infinitely many solutions C2. (5 points) Let B = {, , . . . , } be a set of vectors in R 4 . Then B cannot be a basis of R4 . If true, provide a proof. If false, provide a counterexample, and justify why this is one. C3. (5 points) Let F : Rn → Rn be a linear transformation and B a basis for R n. Show that if the defining matrix AF is invertible, then AF,B is also invertible. C4. (5 points) Let A be an 6×7 matrix. Is it possible that the nullity of A equals the nullity of its transpose AT ? If yes, find an example and prove that it is an example. If no, prove it.
ACCT 222 REVISION FOR TERM TEST ETHICAL BEHAVIOUR The Alert Company is a closely held investment service group that has been very successful over the past five years, consistently providing most members of the top management group with 50 percent bonuses. In addition, both the chief financial officer and the chief executive officer have received 100 percent bonuses. Alert expects this trend to continue. Recently, Alert’s top management group, which holds 35 percent of the outstanding shares of common stock, has learned that a major corporation is interested in acquiring Alert. Alert’s management is concerned that this corporation may make an attractive offer to the other shareholders and management would be unable to prevent the takeover. If the acquisition occurs, this executive group is uncertain about continued employment in the new corporate structure. As a consequence, the management group is considering changes to several accounting policies and practices that, although not in accordance with generally accepted accounting principles, would make the company a less attractive acquisition. Management has told Roger Deerling, Alert’s controller, to implement some of these changes. Roger has also been informed that Alert’s management does not intend to disclose these changes immediately to anyone outside the top management group. Required: Using the code of ethics for management accountants, evaluate the changes that Alert’s management is considering, and discuss the specific steps that Roger should take to resolve the situation. (Source: Hansen & Mowen (7th ed.): 1-14) SUPPORT DEPARTMENT COST ALLOCATION Barrylou Corporation is developing departmental overhead rates based on direct labour hours for its two production departments, moulding and assembly. The moulding department employs 20 people,- and the assembly department employs 80 people. Each person in these two departments works 2,000 hours per year. The-production-related overhead costs for the moulding department are budgeted at $200,000, and the assembly department costs are budgeted at $320,000. Two service departments, repair and power, directly support the two production departments and have budgeted costs of $48,000 and $250,000, respectively. The production department's overhead rates cannot be set until the service department's costs are properly allocated. The following schedule reflects the use of the repair department's and power department's output by the various departments. Departments Repair Power Moulding Assembly Repair hours 0 1,000 1,000 8,000 Kilowatt hours 240,000 0 840,000 120,000 Required: 1. Calculate the overhead rates per direct labour hour for the moulding department and the assembly department, allocating service department costs directly to production departments, without inter-service department cost allocation. 2. Calculate the overhead rates per direct labour hour for the moulding department and the assembly department, allocating service department costs using the step-down method. 3. Calculate the overhead rates per direct labour hour for the moulding department and the assembly department, using the reciprocal method to charge service department costs to each other and to the production departments. ABSORPTION AND VARIABLE COSTING Ziemble Company uses a predetermined overhead rate based on normal capacity expressed in units of output. Normal capacity is 75,000 units, and the expected fixed overhead cost for the year is $300,000. During the year, Ziemble produced 74,000 units and sold 72,000 units. There was no beginning finished goods inventory. The variable-costing income statement for the year follows: Sales (72,000 units @ $21) $1,512,000 Less variable costs: Variable cost of goods sold (756,000) Variable selling expenses (360,000) Contribution margin $396,000 Less fixed costs: Fixed overhead (300,000) Fixed selling and administrative (84,000) Net income $ 12,000 Any under or over-applied overhead is added to Cost of Goods Sold. Variable cost of goods sold is already adjusted for any variable overhead variance. Required: 1. Ziemble Company needs an income statement based on absorption costing for external reporting. Using the information provided, prepare this statement. 2. Explain the difference between the income reported by variable costing and by absorption costing. (Source: Hansen & Mowen (7th ed.): 15-5) ACTIVITY ANALYSIS AND MANAGEMENT Part 1 The following overhead cost information is available for the Christopher Co. Ltd for the year ended 30 June 20XX: Activity Allocation Base Overhead Cost Purchasing Receiving Machine setups Quality control number of purchase orders number of shipments received number of setups number of inspections $400,000 $100,000 $400,000 $150,000 During the year, 30,000 purchase orders were issued, 25,000 shipments were received, machine setups numbered 2,700, and 22,000 inspections were conducted. A total of 11,000 direct labour hours were charged to various products. The corporate managers are trying to decide whether they should stick with a traditional allocation method, where overhead is allocated based upon direct labour hours, or switch to an activity-based costing system. Required: (a) Assuming costs and activities will be approximately the same in the coming year, determine the overhead rate based upon direct labour hours. (b) Determine the overhead rate for each of the activities. (c) A job card for one particular batch of products had the following specifications: Direct labour hours 7 Purchase orders 7 Shipments received 10 Setups 3 Inspections 3 Compute the estimated overhead that would be allocated to this batch under traditional allocation. Recalculate the overhead that would be allocated to this batch under activity-based costing. (d) Are there any differences in your two answers in (c)? If so, why? Which method do you think is better? Why? Part 2 Identify which of the following items generate capacity-sustaining costs, product- or customer- sustaining costs, batch costs, or unit costs. (a) Piecework labour (b) Long-term lease on a building (c) Energy to run machines (d) Engineering drawings for a product (e) Purchase order (f) Movement of materials for products in production (g) Change order to meet new customer specifications
Research proposal The final project of this course is to ask students to prepare a research proposal by a group of 1-2. The project includes two parts: Part 1: presentation (10 points for your final grade) Deadline: May 5th You will make a presentation on your proposal in the last two weeks. Please prepare your presentation slides (in ppt or pdf). The slides should be around 10-12 pages which summarize your research proposal. The presentation is about 6-8 minutes. Part 2: A written research proposal (30 points for your final grade) Deadline: June 1st About 5-10 pages of proposal with tables and figures (if any) and references. You can choose any topics related to this course. You can organize your proposal as follows: 1. Introduction You may consider your introduction covering the followings: 1.1 Using one sentence to describe your research question. What are you trying to learn in this project? Try to keep your answer focused and succinct. 1.2 Why is this question interesting and important? Why is it important to economics? 1.3 How does answering this question contribute to the existing economic literature? Briefly describe 3-5 related papers. How is what these papers explore similar/different to what you have in mind? What is your contribution? 1.4 How does answering this question contribute to public discourse? Does your question relate to issues being debated by regulators, politicians, activists, etc.? What is the state of that debate? 2. Background and institutional setting 2.1 What are some concrete examples of settings in which you can study your research question? Where will you seek out data to answer your research question? 2.2 Could a similar question be asked in other settings? Now zoom out. Is what you can learn in these settings portable to other settings, industries, locations, or policy areas? 3. Data & Feasibility 3.1 Which data sets exist, or could be collected, to answer your question? What is your ideal data set? Where to get the data 3.2 Which steps should you take to collect new data or obtain access to existing data? If you will be creating your own data, e.g. through scraping a website, briefly explain the process. If listing publicly available datasets, consider potential merging issues. 4. Research Design 4.1 What method do you use? What are the parameters you need to identify in order to answer your research question? 4.2 What do you need to be true about the data-generating process in order for these parameters to be identified? a list of assumptions, and an explanation of how these assumptions help construct a mapping from the data to the target parameters. For instance: Which variables do you assume to be exogenously determined? 4.3 How will you implement estimation? What will you need to do in order to estimate your parameters? Will you be able to apply existing methods? 5. Planning and expectation 5.1 What is a conservative timeline for the project? What are potential bottlenecks? Will you have enough time to get a draft together before the job market? 5.2 What are your expected outcomes? 5.3 What are your two or three main concerns about this project? How do you aim to address those?
EECS 31L: Introduction to Digital Logic Laboratory (Spring 2025) Lab 2: Arithmetic Logic Unit (ALU) (Revision: v1.0) Due: April 27, 2025 (11:59 PM) A central processing unit (CPU) is a core computational unit in a computer. Throughout this course, you will gradually build components of processors (CPUs), and at the end of the course, you will complete a basic single-cycle processor design. In this lab, you will build an important component in processors, arithmetic logic unit (ALU). ALU is a combinational logic circuit that performs arithmetic and bitwise logic operations on integer binary numbers. 1 Verilog Arithmetic Operations As introduced in the lecture, Verilog supports the following arithmetic operations. Operation Description Operand Type Result Type A + B Addition A, B: numeric Numeric A - B Subtraction A, B: numeric Numeric A * B Multiplication A, B: numeric Numeric A / B Division A, B: numeric Numeric A % B Modulo A, B: numeric, not real Numeric, not real A ** B Exponent AB A, B: numeric Numeric {A, B} Concatenation A, B: numeric or array element Same as A N{A} Repetition A: numeric or array element Same as A A 32-bit adder (for unsigned integer addition) can be implemented with arithmetic operators as follows. Code 1: 32-bit Full Adder ` timescale 1 ns / 1 ps // Module definition module fa32 (A , B , Cin , Sum , C out ); // Define I / O signals input [31:0] A ; input [31:0] B ; input Cin ; output [31:0] Sum ; output C out ; // Describe FA behavior assign { Cout , Sum } = A + B + Cin ; end module // 32 - bit full adder 2 32-bit Arithmetic Logic Unit (ALU) The arithmetic logic unit (ALU) is the core computing component in processors. ALU performs the arithmetic operations like addition and subtraction or bit-wise logical operations like AND and OR. In this section, you will design and test a 32-bit ALU in Verilog. The block diagram of 32-bit ALU is shown below. The ALU takes two 32-bit operands (A in and B in) and produces one 32-bit output (ALU out). Accord- ing to the 4-bit control code, which comes from the 4-bit ALU control signal ALU ctrl, the ALU decides which arithmetic or logical operation (ALU operation) should be executed. The values of the ALU control signals and the corresponding ALU operations are shown below. ALU Control Signals (4-bit) ALU Operation 4’b0000 AND 4’b0001 OR 4’b0010 Add 4’b0110 Subtract 4’b0111 Set Less Than (slt) 4’b1100 NOR 4’b1111 Equal comparison Note: The default function for the ALU is add. • The Set Less Than operation (slt) compares the two operands (A in and B in). If A in is less than B in then ALU out would be 32’b1 (represented as a 32-bit binary number 32’b0000 0000 0000 0001), otherwise 32’b0. • The Equal Comparison operation compares the two operands (A in and B in). If A in is equal to B in then ALU out would be 32’b1 (represented as a 32-bit binary number 32’b0000 0000 0000 0001), otherwise 32’b0. • The zero output (which is 1 bit) is 1 when all 32 bits of the ALU out result are 0. • The overflow output (which is 1 bit) is 1 when there is an overflow in Add or Subtract operations. For other operations overflow is always 0. • In the Add operations, the carry out output (which is 1 bit) is set to 1 when you have carry out on the most significant bit (MSB). For other operations, carry out is always 0. • The AND, OR, and NOR are bit-wise logical operations. • The Set Less Than, Add, and Subtract are signed operations. Signed operation can be implemented by casting unsigned value (operand) using $signed(), For example: ALU out = $signed(A in) & $signed(B in). Use the following code template for your module definition. Code 2: ALU module definition ` timescale 1 ns / 1 ps // Module definition module ALU_ 32 ( A_in , B_in , ALU_ ctrl , ALU_ out , carry_ out , zero , overflow ); // Define I / O ports // Describe ALU behavior end module // 32 - bit ALU Write a testbench for your ALU design and run the tests below. Run each test case for 20 ns. Test No. A in B in ALU ctrl 1 32’h086a 0c31 32’hd785 f148 4’b0000 2 32’h086a 0c31 32’h1007 3fd4 4’b0001 3 32’ha86a 0c31 32’h9007 3fd4 4’b0010 4 32’ha86a 0c31 32’h9007 3fd4 4’b0110 5 32’ha86a 0c31 32’h9007 3fd4 4’b0111 6 32’ha86a 0c31 32’h9007 3fd4 4’b1100 7 32’ha86a 0c31 32’ha86a 0c31 4’b1111 8 32’ha86a 0c31 32’h1007 3fd4 4’b1111 Check the outputs (ALU out, carry out, zero, overflow) to see if they are correct. Put a screenshot of the waveform. in your report. Add more test cases as you wish to make sure your design produces correct outputs for all cases. 3 Assignment Deliverables Your submission should be in a *.zip file and should be submitted to GradeScope. The ZIP file should include the following items: • Source Code: ALU module design and testbench. (ALU .v and ALU tb.v) • PDF Report: A report in the PDF format including the simulation results. Compress all files (*.v files + report) into one ZIP file named “lab2 UCInetID firstname lastname.zip” (note: UCInetID is your email user name and it is alphanumeric string), e.g., “lab2 sitaoh sitao huang.zip”, and upload this ZIP file to GradeScope before deadline. Note 1: Start working on the lab as early as possible. Note 2: Use the code skeletons given in the lab description. The module part of your code (module name, module declaration, port names, and port declaration) should not be changed. Note 3: It is fine to discuss the lab with other students, TAs, or AI, but make sure you understand all the details, and you should write your own code.
Assessment Description PART 1: ALGORITHMS In this individual work, you will implement sorting algorithms and then test their performance. This part of the assignment consists of not just coding, but also testing your code and providing evidence. Note that when your code is complete, you still have a reasonable amount of work to do -- so start early! Storing and Sorting Items Consider a manufacturing company, XYZ that runs 24 hours and 7 days operational. The company produces a very large number of items per week. In a week from Monday to Sunday, it produces 20, 300, 4000, 50000, 75000, 100000 and 500000 items, respectively. Each item has a random integer identifier. You are expected to create an Integer ArrayList and store the item IDs for each day of the week – so you will have 7 different ArrayList storing items accordingly. Now, you are required to randomly generate item IDs from 1000 to 600000 for each day as stated above. Now think about the logic of applying the Quicksort algorithm and first write its pseudocode. Once you’re done, convert your pseudocode into a Java code and run your code successfully. Efficiency Testing Once you have implemented your algorithm, you need to test it to see how long your sorting algorithm takes to run. You should test the speed of the algorithm on all three: random, sorted and reverse-sorted lists. You are expected to use System.currentTimeMillis() to estimate the execution time. Using currentTimeMillis only gives an accurate time estimate if the function takes a long time to run (at least a couple of seconds). Run your code a number of times and compute the average time, print the output screenshot and discuss in the report -- reflect how many iterations are sufficient to provide an accurate time of the algorithm. Developing a Better Sorting Algorithm Quicksort is faster when the number of items to be sorted in a list is large. But when lists are small enough, quicksort runs slower than some of the Θ(n2) algorithms. If you carefully notice, each time the quicksort method is recursively called, the sublist to be sorted could be either small or large. The time to sort one small sublist with a faster algorithm can be negligible. However, sorting such hundreds of small sublists can make a difference in the overall efficiency of the sort. Here, you will combine Quicksort with another sorting algorithm to create the fastest possible sorting algorithm. We call this “hybrid Quicksort”. You have several options -- · Use Quicksort until the sublist gets “small enough”, and then use selection sort to sort the small lists. · Use Quicksort until the sublist gets “small enough”, and then use insertion sort to sort the small lists. · Use Quicksort to "mostly" sort the list, i.e., use the Quicksort to sort any sublists larger than a cut-off size, and then stop. The list will now be mostly sorted, and you can use selection sort on the entire list to quickly complete the sorting. · Use Quicksort to "mostly" sort the list, i.e., use the Quicksort to sort any sublists larger than a cut-off size, and then stop. The list will now be mostly sorted, and you can use insertion sort on the entire list to quickly complete the sorting. · Use some other method of your own devising. What does “small enough” mean? You can try a percentage of the list (say, 5% or 10%), or an absolute number (8, 10, 15, 100 elements, etc.), or something else of your choice. What does “mostly” sort mean? A cut-off size of the items to be sorted in the list. You should test your choices to ensure that you have the most efficient algorithm possible. You should also be sure that your hybrid Quicksort has reasonable performance on all lists: sorted and inverse sorted lists as well as random lists. Try various methods for choosing the pivot element, to try to get the best possible behaviour. You need to complete the following tasks and submit them electronically: Q1-A. Source code for your hybrid sorting algorithm sorting all items in the ArrayLists for the week and performing efficiency testing for sorted and inverse sorted lists as well as random lists for each list size in these tests. [20 marks] Q1-B. Write a 1000-word (maximum) explanation of how you developed your hybrid sorting algorithm, what combinations of the algorithms/approaches you tried, what different parameters you chose, and how much of a difference these changes made to the efficiency of your algorithm, including the run time complexity. [30 marks] Create a single report (.doc or .pdf) file containing the following: (i) Screenshot of the final output for efficiency testing from Q1-A. Make sure your hybrid quicksort has reasonable performance on all lists, sorted and inverse sorted lists as well as random lists for each list size. (ii) Your explanation for Q1-B above. It is okay for you to discuss solutions to Part-1 with your classmates. However, no collaboration should ever involve looking at one of your classmate's source codes. It is usually fairly easy to determine that someone has copied a code, even when the individual copying the code has changed identifier names and comments. Assessment Criteria Credit will be awarded against the following criteria. PART 1: High Distinction (80%+) –[Q1-A] Fully working codes that demonstrate an excellent understanding of the assignment problem and scenarios using a relevant Java approach. Excellent formatting of input/output, catch exception handling, the application deals well with invalid user input and doesn’t crash for any data. Excellent and consistent code layout. Appropriate use of comments. [Q1-B] All required outputs. Clear, concise, reflective and appropriate write-up with all justified choices. Distinction (70-79%) –[Q1-A] Fully working codes that demonstrate a very good understanding of the assignment problem and scenarios using a relevant Java approach. Very good formatting of input/output, catch exception handling, the application deals well with invalid user input and doesn’t crash for any data. Very good and consistent code layout. Appropriate use of comments. [Q1-B] All required outputs. Clear and appropriate write-up with all justified choices. Merit (60-69%) – [Q1-A] All required functionalities of the codes are met (with no runtime error) demonstrating a good understanding of the assignment problem and scenarios using a relevant Java approach. Good formatting of input/output, catch exception handling, the application may have a few errors with invalid user input. Good and consistent code layout. Good use of comments. [Q1-B] Most of the required outputs are presented. Clear and suitable write-up with mostly justified choices. Pass (50-59%) –[Q1-A] Some required functionalities of the codes are met (with only minor errors) demonstrating some understanding of the assignment problem and scenarios using a relevant Java approach. Some formatting of input/output, catch exception handling, the application may have some errors with invalid user input. Some and partially consistent code layout. Some use of comments. [Q1-B] Only some required outputs. Some write-up with partially justified choices. Marginal Fail (40-49%) - [Q1-A] Faulty codes with wrong implementation (with major errors), partially demonstrating the understanding of the assignment problem and scenarios using a relevant Java approach. Bad formatting of input/output, catch exception handling, the application has major errors with invalid user input. Modest and inconsistent code layout. poor use of comments. [Q1-B] Only a few required outputs. Partially clear and rough write-up with poorly justified choices. Fail (0-39%) - [Q1-A] Faulty codes with incorrect implementation (code does not run), poorly demonstrating the understanding of the assignment problem and scenarios using a relevant Java approach. Poor formatting of input/output, catch exception handling, the application has major errors with invalid user input, and crashes with most data. Poor and inconsistent code layout. No use of comments. [Q1-B] No or only a few required outputs. Unclear and poor write-up with no justified choices.
CS 392 Spring 2025 Systems Programming Project Preliminary Concepts you need to understand for this assignment: r File I/O, both low- and high-level; r The steps of establishing socket connections; r Multiplexed I/O. Your task is to write a Trivia game application as shown in class. The server acts as the host who sends questions to the players, and the clients are the players. 1 Part 1: The Server (70 pts) 1.1 Task 1: Establish the Server with getopt (10 pts) We will start writing the server first, where the first step is to parse arguments from command line using getopt() . It is very similar to getopts utility we used in bash script. There are four possible flags, all of which are optional for the program: 1 Usage: ./server [-f question_file] [-i IP_address] [-p port_number] [-h] 2 3 -f question_file Default to "qshort.txt"; 4 -i IP_address Default to "127.0.0.1"; 5 -p port_number Default to 25555; 6 -h Display this help info . Above is also an example output of the help message. Note that ./server in the help message must not be hardcoded – it has to be replaced by the actual name of the server program. If an unknown flag is passed, please print the following message and exit with failure: 1 Error: Unknown option '-' received . where is replaced by the actual unknown flag. After parsing the arguments, you will follow the steps to create a server socket, bind it, and listen. Please limit the maximal number of connections to 2 or 3 when listening (for your own good s). If listen() succeeds, print the following message: 1 Welcome to 392 Trivia! 1.2 Task 2: Read the Question Database (10 pts) Once the server has been established, we can create our question database before the game starts. This is accomplished by reading a plain text file, which has the format as follows: 1 Which Game of Thrones character is known as the Young Wolf? 2 Robb_Stark Arya_Stark Sansa_Stark 3 Robb_Stark 4 5 What city hosted the 2000 Olympic Games? 6 Tokyo Beijing Sydney 7 Sydney For each question entry, the first line is the question itself, and the second line the three possible options, and the third line the answer. Between every two question entries there’s an empty line. Notice that if the answer has a space in it, there’s always an underscore, so a white space is always used to separate three options. We use the following structure to store each question entry: 1 struct Entry { 2 char prompt[1024]; 3 char options[3][50]; 4 int answer_idx; 5 }; where prompt is the question itself, options are the three options, and answer_idx is the index to the correct answer in options . The function that reads the question database is declared as follows: 1 int read_questions(struct Entry* arr, char* filename); where arr is an array of question entries and filename the path to the question database file. The function returns the actual number of question entries read from the file. You can assume there’s no more than 50 questions, so a hardcoded struct Entry array of 50 is acceptable. 1.3 Task 3: Accepting Players (20 pts) Now is the time to accept new players! When the maximal number of players have been reached, you should print the following message on screen: 1 Max connection reached! and close the new player’s file descriptor. If there’s still empty spot for players, print the following message on screen: 1 New connection detected! and send out the following message to the player: 1 Please type your name: After you receive the name sent by the player, you will print the following message on screen: 1 Hi ! where is replaced by the name sent from the player. You don’t need to check duplicates; it’s ok to assume each player will put in a different name. For each player, you will use the following structure to store their information: 1 struct Player { 2 int fd; 3 int score; 4 char name[128]; 5 }; where fd is the file descriptor assigned to this player when connected to the server, score the score of this player, and name the player’s name. Once the last player has typed their name and you received it in the server, you will print out the following message on screen: 1 The game starts now! If a player quits their program, print the following message on screen: 1 Lost connection! 1.4 Task 4: Start the Game! (30 pts) The game starts now! You will print one question and the three options to both the screen and each of the player’s terminal. On the screen, the question and the options are formatted as follows: 1 Question : 2 1: 3 2: 4 3: where starts from 1. On each player’s terminal, the question should be formatted as follows: 1 Question : 2 Press 1: 3 Press 2: 4 Press 3: Once a player pressed one of the numbers, we apply rewards or penalty to the player. The rule is, if a player answered the question right, they get one point; otherwise they get -1. Regardless of the option the player chose, you will display the correct answer on the screen, and also broadcast it to all the players. Then you can move on to the next question. When all the questions have been answered, display the winner with the following message on the screen: 1 Congrats, ! Then close all the connections, and exit the server program. 2 Part 2: The Client (30 pts) 2.1 Task 5: Parse Arguments and Connect to the Server (10 pts) The client (player) side is relatively easier. The first task is still to parse the flags, all of which are optional for the program: 1 Usage: ./client [-i IP_address] [-p port_number] [-h] 2 3 -i IP_address Default to "127.0.0.1"; 4 -p port_number Default to 25555; 5 -h Display this help info . Again, ./client in the help message must not be hardcoded – it has to be replaced by the actual name of the client program. If an unknown flag is passed, please print the following message and exit with failure: 1 Error: Unknown option '-' received . where is replaced by the actual unknown flag. After parsing the arguments, you will follow the steps to create a socket and connect it to the server. The function is declared as follows: 1 void parse_connect(int argc, char** argv, int* server_fd); 2.2 Task 6: Enter the Game (20 pts) Once connected to the server, the server will send out the message to let the player type their name (see Part 1, Task 3). The player types their name, and wait for the game to start. During the game, if another player answered the question first, the server will send out the correct answer to all the players, and start the next question. If the current player knows the answer, they should act fast and press 1, 2, or 3, before the correct answer shows up. After all questions have been asked, the server cuts the connection to all the players, and the player program can exit. Hint: the client side also needs to implement multiplexed I/O, because after the question is shown to the player, there are two possible ways to move on to the next question: either the current player presses 1, 2, or 3 to answer the question, or another player answers the question first and the server sends out the correct answer. Therefore, you need to monitor two file descriptors to see which one is ready first: stdin , or the server’s file descriptor. 3 Grading The project will be graded based on a total of 100 points. r Server: • Task 1 (10 pts): 10 test cases in total, 2 points each; • Task 2 (10 pts): 10 test cases in total, 3 points each; • Task 3 (20 pts): 10 test cases in total, 2 points each; • Task 4 (30 pts): 10 test cases in total, 3 points each; r Client: • Task 5 (10 pts): 10 test cases in total, 3 points each; • Task 6 (20 pts): 10 test cases in total, 3 points each. After accumulating points from the testing above, we will inspect your code and apply deductibles listed below. The lowest score is 0, so no negative scores. Note that all the deduction rules are also applied to the helper function you created and called in that task. r General (only deduct once, applicable to both the server and the client): • -100: the code does not compile through the Makefile, or executes with run-time error; • -100: the code is generated by AI, and/or through reverse engineering on the tester; • -30: memory leak through valgrind (only “definitely lost” category); • -10: no pledge and/or name in C file. Earlybird Extra Credit: 2% of extra credit will be given if the homework is finished two days before the deadline. For specific policy, see syllabus. Deliverable Submit the following files on Canvas. No need to zip. (1) Makefile ; (2) server.c ; (3) client.c .
BFF3121/BFB3121 Portfolio Investment Assignment Semester 1, 2025 Note: This document contains “Group Formation” and “Trading Instructions” only. The Main Assignment Tasks/Requirements will be Released by the end of week 7. Essential Trading and Portfolio Guidelines: Getting Ready for the Assignment 1. Students need to form. a group for their Assignment. Minimum 3 to maximum 4 students in each group. 2. To form a group, go to Assessments tab, click on portfolio assignment and join a group of your choice. You are free to form. a group across tutorials. You can leave a group and join another if you want before the cut-off date and if the members of the new group agree to take you onboard. The cut- off date for group change is 15 March 2025. After this date you cannot move groups. After the cut-off date, students will be filling up a Google form and Team Agreement Form (will be available from Week 7) with necessary information about the team and trading account details. You will need to create username and password following the guidelines supplied in Moodle. This information may be used by each group member to login and make trades with consents from other group members. 3. Trading starts from week 2 (Monday 10 March) until teaching week 8 (3rd May) including Mid semester break during Easter. 4. You must undertake a minimum of 4 successful (executed) trades per week. For example: if you place a “buy” order and your order becomes successful that would be counted as one trade. But let’s say you placed an order and that was not fulfilled, this is not going to be counted. Buying and selling are counted as two separate trades. There are no maximum numbers of trade per week. The best is to monitor the market and put reasonable price range for order execution. You can also buy/sell via “Deal” for immediately executing trades. Keep an eye for Moodle Announcement for additional/specific trading instructions time to time. 5. Each student opens an IG TRADING DEMO account and MUST familiarise themselves with the IG trading platform. and how to place orders etc. See Moodle for IG DEMO Account Opening Instructions. One student account per group can undertake the trade on behalf of the team using his/her account at IG platform. each week. While undertaking the trade, team members should liaison with each other before a trade decision has been made. Over the 8 weeks of trading each team member monitors the trade and must apply relevant trade mechanisms based on market movements and perform necessary trading. DO NOT UNDERTAKE ANY TRADING DURING WEEK 1. 6. Initially after registering for IG DEMO Account, you will be assigned $20,000 virtual (in week 1). Your Week 2’s trading starts with this $20,000.Because it’s a CFD account, you will be trading on margin. You need to wisely use the money to allocate your funds into to build your portfolio. For Margin requirements, we advise you to always keep 15%-20% of the available funds unused at any time. 7. At the beginning of Week 3, (17 March 2025), all groups need to add $180,000. How to add virtual funds are explained in the IG Opening up an account document. Allocation of funds: Students invest in Australian and US markets only. By the end of week 3, you must allocate your funds/resources into 8-10 industries from the following list. You MUST NOT ALLOATE more than 15% of your available funds into one particular sector. • Technology • Automobile • Agriculture • Building Products • Mining – Oil and Gas • Pharmacy and Drugs • Real Estate • Retail/Food • AI • Semi-Conductor • Steel • Internet/Telecom • Utility • Crypto • Financial/Banks/Investment Banks • Medical/Health • IT and Software • ETFs
Math 220 Midterm II (10 pts) 1 Let g : (0, ∞ ) → (0, ∞ ) be a function defined on the positive real numbers. Define h : (0, ∞ ) → (0, ∞ ) by h(x) = 1/g(x). (a) Prove that if g is surjective, then h is surjective. (b) Prove that if g is injective, then h is injective. (10 pts) 2 Let x be a real number in the interval [0) 1]. Prove that (1 - x)2006 ≥ 1 - 2006x. (Hint: use induction on n to prove the more general inequality where 2003 has been replaced by n.) (20 pts) 3 Prove that each of the following sets is countable. (You may use any result proved in class or on the homework; however, you must state clearly exactly what result you are using.) (a) The set S of real numbers x such that x2 is a natural number; that is S = {x ∈ R|x2 ∈ N}. (For example, √2 ∈ S and -3 ∈ S, but 2/1 S and π S.) (b) The set L of all non-vertical lines in R × R such that at least two integer points are on the line; that is L is the set of all lines {y = mx + b} which contain (p1, q1), (p2, q2) ∈ Z × Z with (p1, q1) ≠ (p2, q2). (For example, the line y = 3x — 5 is in L, since the points (0) —5) and (3) 4) are on it; the line y = πx is not in L, since if x is an integer other than 0, then y = πx is not an integer; the only integer point on this line is (0) 0).) (10 pts) 4 Find the supremum of the set S = {n/2n−1|n ∈ N} and prove that your answer is correct.
Databases Assignment 1 - Ocean Odyssey (OO) Assignment 1 Checklist Required Actions: ❏ Carefully checked the Marking Rubric in the assignment document so you are aware of the mark allocation ❏ Task 1: Conceptual Model ❏ Followed the unit conceptual model notation requirements as listed in your “Conceptual Modelling” Applied material ❏ All entities and relationships on page 2 of the brief are included, nothing extra added ❏ KEYs clearly indicated ❏ All relationships have minimum and maximum cardinality shown, are indicated as identifying or non-identifying and have appropriate labels ❏ Exported the PDF as an A4 single portrait page ❏ Task 2: Normalisation ❏ Normalised the Sample Cruise Itinerary Sheet from UNF to 3NF, showing all stages and dependencies at each step (i.e. partial dependencies in 1NF, transitive dependencies in 2NF, full dependencies in 3NF). included all candidate keys for each relation at 1NF ❏ Included all attributes shown on the form; no extra attributes added ❏ Did not add any surrogate keys in normalisation ❏ Indicated PK's using underline of the PK attributes ❏ Completed attribute synthesis, if required ❏ Checked naming consistency between Conceptual Model and Normalisation ❏ Task 3: Logical Model ❏ Followed the unit logical model notation/requirements: ❏ Used Crow’s foot/Information Engineering notation for the logical model ❏ Does not show data types and sizes ❏ Does show legend on the logical model ❏ Does show a label for each relationship ❏ Added common prefix for all attributes in each relation (e.g. emp_no, emp_name) ❏ Added comments for all attributes (used comments in RDBMS) ❏ Added at least one surrogate key to the logical model and added an explanation of why it was chosen to the assumptions document ❏ No relation with more than two attributes in the key remains (if more than two, a surrogate must be added) ❏ Included all required check clauses and lookup tables ❏ Integrated FULL normalisation results (final 3NF) into the logical model - all relations and attributes ❏ Checked naming consistency between Conceptual Model, Normalisation and Logical Model ❏ For each relation, all attributes are shown on the diagram (no downward pointing diamond displayed to show some attributes are hidden) ❏ Made sure there are no data anomalies in the final logical model (ie, all relations are in 3NF) ❏ Schema File ❏ Has extension .sql ❏ Included DROP table commands at the head of the schema file ❏ Has not been edited other than to add a header (student details) and SPOOL/ECHO commands ❏ Captured run of schema file via SPOOL/ECHO commands, and does not show any errors except for the drop table statements Required files have been pushed to the FIT GitLab server (at least three pushes of Conceptual Model, three pushes of Normalisation and six pushes of Logical Model): ❏ oo_conceptual.pdf ❏ oo_normalisation source file (source file in repo if MS Word/Pages) and final pdf on Git Lab ❏ oo_logical.pdf (check this is your final model and produced via File - Print Diagram - To PDF File from within Data Modeller, do not use screen capture) ❏ oo_model project folder, which includes: ❏ the oo_logical.dmd file, ❏ and the oo_logical folder You must push this project folder at least six times while you are drawing the model with the Oracle Data Modeler ❏ oo_schema.sql ❏ oo_schema_output.txt ❏ oo_assumptions source file (source file in repo if MS Word/Pages) and final pdf on Git Lab Finally, seven individual files have been submitted to Moodle: 1. oo_conceptual.pdf 2. oo_normalisation.pdf 3. oo_logical.pdf 4. oo_model.zip, which includes: ○ the .dmd file, ○ and the model folder. ○ You MUST ensure that the zip archive of the model is tested for completeness, i.e. includes both logical and relational models (unzipped and opened in a new location - see video: Preparing Files for Submission in Ed) 5. oo_schema.sql 6. oo_schema_output.txt 7. oo_assumptions.pdf
CS218, Spring 2025 Assignment #2 Due: 11:59pm, Friday 04/25, 2025 Deadline. The homework is due 11:59pm, Friday 04/25, 2025. You must submit your solutions (in pdf format generated by LaTeX) via GradeScope. The training programming assignment is due earlier, see more details below. Late Policy. You have up to four grace days (calendar day) for the entire quarter. You don’t lose any point by using grace days. If you decide to use grace days, please specify how many grace days you would like to use and the reason at the beginning of your submission. Collaboration Policy. You can discuss the homework solutions with your classmates. You can get help from the instructor, but only after you have thought about the problems on your own. It is OK to get inspiration (but not solutions) from books or online resources, again after you have carefully thought about the problems on your own. However, you cannot copy anything from other source. You cannot share your solution/code with anyone else. You cannot read other’s solution/code. If you use any reference or webpage, or discussed with anyone, you must cite it fully and completely (e.g., I used case 2 in the examples in the Wikipedia page https: // en. wikipedia. org/ wiki/Master_ theorem_ ( analysis_ of_ algorithms) about Master theorem for Problem 3, or I discussed problem 2 with Alice and Bob.). If you use ChatGPT or similar AI tools, you have to attach the full conversation to make it clear what help you obtained from them. Otherwise it will be considered cheating. We reserve the right to deduct points for using such material beyond reason. You must write up your solution independently, and type your answers word by word on your own: close the book/notes/online resources when you are writing your final answers. Write-up. Please use LaTeX to prepare your solutions. For all problems, please explain how you get the answer instead of directly giving the final answer, except for some special cases (will be specified in the problem). For all algorithm design problems, please describe using natural language. You could present pseudocode if you think that helps to illustrate your idea. Please do not only give some code without explanation. In grading, we will reward not only correctness but also clarity and simplicity. To avoid losing points for hard-to-understand solutions, you should make sure your solutions are either self-explanatory or contains good explanations. See some more details here https: //www.cs.ucr.edu/~ygu/teaching/218/S25//assignments/index.html Programming Problems. You will need to submit your code on CodeForces (a readme file about submitting code is available on the course webpage). You also need to submit a short report through GradeScope along with your solutions of the written assignments. In the report, you need to specify your submission id, describe the algorithm you designed, and show cost analysis if necessary. Note that your code will be automatically saved by CodeForces, so you do not need to submit the code again. For each problem, there will be 10-20 test cases. For the training programming problems, you need to finish before 11:59pm, Friday 04/18, 2025. With reasonable implementation, using C++ or Java is guaranteed to be able to pass all tests. You can use other languages, but it’s not guaranteed that the implementations can be within the time limit. Training and Challenge Problems (5 pts for training + bonus for challenge) Available on codeforces. 1 Deadlines, again! (3.2pts) In class, we tried to use different greedy strategies to deal with homework deadlines — we tried several of them, but none of them could always gave an optimal solution. Now, let’s consider a slightly simpler problem and try to find a good greedy strategy for that — assume for each of the assignment, you need exactly one day to work on that. In particular, now you have a set of n homework assignments. The i-th one is worth pi points, and is due on day di , where 1 ≤ di ≤ n. For each of them, you need exactly one day to work on them, and as long as you spend one day on assignment i, you can get all pi points of it. But if you do not finish an assignment before the deadline, you lose all pi points. Design a greedy strategy to find out which assignment you should work on for each day, such that you can earn the most number of points. For simplicity, assume all pi are distinct. Note: You can work on the problem on the due day (it’s due midnight of the day). Questions: 1. (0.2pts) There are several straightforward greedy strategies. First, consider you use “deadline first” strategy, where, from the first day, you start to work on the one with the earliest deadline (may need to break the tie based on some rules). Please show an counterexample with three assignments (i.e., n = 3) where this strategy does not give you the optimal solution. 2. (0.2pts) There is another simple idea: highest point first. From the first, day, you work on the assignments from the highest score to lowest. Please show an counterexample with three assignments (i.e., n = 3) where this strategy does not give you the optimal solution. 3. (0.5pts) Prove that, an optimal solution must contain the assignment with the highest number of points. 4. (0.5pts) Show a greedy algorithm to find out which assignment you should work on for each day, such that you can earn the most number of points. 5. (0.3pts) Simulate your algorithm on the following input instance: Assignment Points Deadline A 10 13 B 8 2 C 7 2 D 15 5 E 1 7 F 12 3 G 4 4 H 5 5 Show what solution your algorithm will get (which assignment you will work on for each day?), and the total number of points you can earn. 6. (0.9pt) What is the greedy choice in your algorithm? Prove that your greedy choice is always “good”/“safe” to be included in the optimal solution. 7. (0.6pt) What does “optimal substructure” mean? Prove that this problem exhibits “optimal substruc- ture”. Combining your proofs in the last two subquestions will prove that your algorithm will always give an optimal solution. (For “counterexample” it means to show: 1) an input instant, 2) the solution S obtained by the given algorithms, and 3) a better solution than S (probably an optimal one). This means that your algorithm does not always generate the best solution). 2 Don’t be late! (1.8pts) Before teaching CS 218 in Olmsted Hall, Yan walks from his office on the third floor in Winston Chung Hall to the classroom. He can either use the elevator or the stairs. Using elevator is faster, which takes E = 20 seconds. However, as you probably know, the elevator in Winston Chung Hall is old, so sometimes it just never comes. Yan doesn’t want to be late! Thus, he needs to consider using the stairs as a backup option, which he knows will take S = 60 seconds. He decided to use the following strategy: he will wait for at most W seconds, and if the elevator does not come, he will use the stairs. Please calculate the best W that gives Yan the best approximation (competitive ratio). Here, the ap- proximation (competitive ratio) is defined as the time Yan used divided by the time by using the optimal strategy, in the worst case. You can use 60 and 20 seconds when you are trying to figure out the solutions, but please use S and E to formally state your result for the following questions. Questions: 1. (0.7pts) For any given W ≥ 0, please state the time f(s) Yan needs to go to the first floor, where s is the time needed for the elevator to come. 2. (0.5pts) Now, compute the optimal time g(s) Yan needs to go to the first floor. Again, here s is the time needed for the elevator to come. 3. (0.6pts) Based on the result above, find the best W that gives the best competitive ratio. Please state Yan’s strategy and why the competitive ratio always hold.