ECON20032 MACROECONOMICS 4 Submission deadline: **/05/2025 14:00 Section A Questions (10 points each; total: 30 points) Answer succinctly (in no more than 120 words each) all of the following three questions. All answers must be written in complete sentences. Do a word count and indicate the number of words after each answer. Do not repeat the question before you answer. Question A1. As a share or GDP, private investment and private savings are, respectively, 10.4 and 8.3 percent in country A, and 12.7 and 11.5 percent in country B. Also as a share of GDP, public investment and public savings are, respectively, 3.4 and 3.8 percent in country A, and 2.7 and 1.5 percent in country B. What is the current account deficit of each country? Does either one exhibit evidence of twin deficits? Question A2. Describe the main features of the global foreign exchange market. Question A3. What are financial frictions and how do they affect the loan rate? Provide an example. Section B Problem (50 points) Answer all questions clearly and succinctly. Provide intermediate derivations where needed, but do not exceed 8 pages, graphs included, in your answers. Do not repeat the question before you answer. Consider a small open economy producing a single good, which is an imperfect substitute for a foreign good. There are four categories of agents: firms, households, commercial banks, and the central bank (CB). The world price of the foreign good is taken as exogenous and normalized to unity. The nominal exchange rate is fixed at E(-) . Output, Y, is produced by combining labour and capital: (1) Y = Nα(K0)β , where N is employment, K0 is the stock of capital at the beginning of the period, and 0
Molecular Formula Practice Example: If the empirical formula was Al2O3 and had a molar mass of 306 g, what would the molecular formula be? Step 1: The molar mass is always a multiple of the empirical molar mass (i.e., M.W. = n × E.F.W.) To determine n, divide the given molar mass by the empirical molar mass. The empirical molar mass is 2 × 27.0 g + 3 × 16.0 g = 102 g The molecular molar mass is 306 g. 306 ÷ 102 = 3. Step 2: Multiply all the subscripts in the empirical formula by the answer to the previous step. We multiply the subscripts in the empirical formula by 3 to get the molecular formula Aℓ6O9 Practice: 1. Determine the molecular formula of each compound from the empirical formula and the molar mass: a) E.F. = NaS2O3, molar mass = 270.4 g/mol b) E.F. = C3 H2Cl, molar mass = 147.0 g/mol c) E.F. = C2 HCl, molar mass = 181.4 g/mol d) E.F. = Na2SiO3, molar mass = 732.6 g/mol e) E.F. = NaPO3, molar mass = 305.9 g/mol f) E.F. = NO2, molar mass = 92.0 g/mol 2. What is the molecular formula of a compound whose molar mass is 60.0 g/mol and empirical formula is CH4 N? 3. What is the molecular formula of CH3O if its molar mass is 62 g/mol? 4. Find the molecular formula for a compound with an empirical formula of C2 H8 N and a molecular mass of 46 grams per mole. 5. 4.04 g of nitrogen combine with 11.46 g of oxygen to produce a compound. a) What is the empirical formula of this compound? b) The molar mass of the compound is 108.0g/mol. Find its molecular formula 6. The molar mass of a compound is 92 g. Analysis of the sample indicates that it contains 0.606 g N and 1.390 g O. Find the compound’s molecular formula. 7. Ethene, a gas used extensively in preparing plastics and other polymers, has a composition of 85.7% carbon and 14.3% hydrogen. Its molar mass is 28 g. Find the molecular formula for ethene.
COMP1002/8802 - Lab 9 Worksheet You must complete this worksheet during your lab/workshop and have your answers for the (marked) parts checked by your tutor before the end of the session. Marks are awarded out of two, where completing only some of the tasks will award partial marks. Part 1 - TensorFlow Playground The TensorFlow playground (https://playground.tensorflow.org/) is a website where you can experiment with how neural networks can be trained to model different data patterns. When you first load the website in your browser you should see something similar to the following: This website will allow you to try different neural network architectures, composed of several artificial neurons separated into layers, on a variety of datasets. Each neuron outputs either 0 or 1, based on the combined (weighted) sum of its inputs. For this worksheet, we are going to be looking at the problem of Classification. This means that we have a collection of training data that is labelled into categories, in this case the dots in our data are labelled as either blue or orange. By looking at how the features of each dot (in this case it’s x and y coordinates) correspond with its colour, our neural network will attempt to predict the colour of any new dots we provide it with. This is the same general idea as when we used the features of passengers on the titanic to determine whether they died or survived, except this time we are using a dots position to try and predict its colour. Part 2 - Neurons Let’s start by looking at a very simple problem with a single neuron. Select the Gaussian (bottom left) dataset on the left-hand side of the website and reduce our neural network to a single hidden layer with a single neuron. Also select the “Discretize output” checkbox in the bottom right corner. Click the Play () button in the top left corner to begin training our neural network. After a short time, our neural network will converge on a model that accurately separates the orange and blue dots. Any dot that falls into the orange or blue areas of the output will be classified accordingly. Hovering our mouse cursor over the lines in our network reveals their weights, and hovering over the small dot in the bottom left of our neuron reveals its bias. In this example case (your results may differ) we can see that the corresponding weights & bias for our neuron are: As our network is just a single neuron, we can easily verify our neural network’s output for several example inputs (if neuron fires then our prediction is blue, otherwise orange). - Input: x = 4, y = 5 output = (0.77 x 4) + (0.75 x 5) > 0.039 BLUE - Input: x = -2, y = -1 neuron = (0.77 x -2) + (0.75 x -1) > 0.039 ORANGE - Input = x = 4, y = -4 neuron = (0.77 x 4) + (0.75 x -4) > 0.039 BLUE (but close to boundary) Try running the same neural network on some of the other datasets. You should see that our single neuron network is not able to accurately classify all the dots. This is because a single neuron with just the x and y coordinates as input is only able to produce a linear line of separation. To accurately classify more complex patterns, we will also need to add additional neurons to our neural network. Part 3 - Additional Neurons (marked) While a single neuron is not enough to accurately classify the Circle and Exclusive or datasets (top two datasets) if we add additional neurons then we will obtain a better result. Keeping just a single hidden layer, try adding additional neurons to our network and see if this improves our trained model’s accuracy. Like the final output, a picture is provided for each neuron representing its own predicted output for an input dot. While none of these neurons are individually able to predict more complex patterns on their own, they can be combined within a full neural network to produce a complete classification model. - Question: How many neurons in a single layer are needed to accurately classify (test loss < 0.03) each of the following datasets: o Circle (top left) o Exclusive or (top right) o Gaussian (bottom left) Part 4 - Neuron Layers (marked) We have now successfully created neural network models that can classify dots in the first three datasets (Circle, Exclusive or, and Gaussian) using just a single layer of neurons. However, the fourth spiral dataset requires more neuron layers to achieve an accurate result. Neurons within more complex neural networks are typically grouped into layers, where the outputs from every neuron on the previous layer is passed as input to the neurons in the next layer. Experiment with adding additional layers of neurons to our network and see if you can train a network to accurately classify the spiral dataset. - Question: How many neurons in total (across multiple layers) are needed to accurately classify (test loss < 0.03) each of the following datasets: o Spiral (bottom right) Part 5 -Network Training (marked) Neural networks are trained using a process called backpropagation. While we aren’t going to be covering the mathematics of how this process works, the general idea is that the edge weights and neuron biases within our network are repeatedly updated to better fit our training data. Each time we update our neural network values this is called an “epoch” and the amount by which we change our network values is based on the “learning rate”. Having a higher learning rate means that we might find a reasonably accurate solution in fewer epochs, but also means that our network changes may be too large to find an optimal solution. A high learning rate could also lead to an unstable network that overfits to the latest training example Finding the right learning rate for your network is a difficult balancing act. Create a neural network with a single hidden layer containing 4 neurons. Using the default learning rate of 0.03, see how many epochs it takes for the model to find an accurate solution for the circle dataset. You can press the step button next to the play button to advance a single epoch. Reset the network and repeat this process several times to get a range of results. - Question: Experiment with the following learning rates and comment on how long it takes for the model to converge on an accurate solution (test loss < 0.03): o 0.003 o 0.03 o 0.3 o 3 - Is there a difference in the shape of the output pattern for each of these learning rates? Part 6 - Feature Engineering (marked) As well as the x & y coordinates of the dot, we can also apply feature engineering to introduce augmented/modified versions of these features into our set of inputs. This can help to improve the performance (accuracy and training time) of our neural network. TensorFlow Playground provides the following augmented features: - X12 The x coordinate squared. - X22 The y coordinate squared. - X1X2 The x coordinate multiplied by the y coordinate. - Sin(X1) The Sine function of the x coordinate. - Sin(X2) The Sine function of the y coordinate. Return your learning rate to 0.03, and experiment with adding or removing different input features and see how this affects your network for different datasets. - Question: Using these augmented features, how many neurons in a single layer are needed to accurately classify (test loss < 0.03) each of the following datasets: o Circle (top left) o Exclusive or (top right) o Spiral (bottom right) - Try removing some of the augmented input features to see which ones are most beneficial for accurately classifying each dataset. Bonus 1 - Additional Neural Network Options The bonus tasks for this worksheet will focus on experimenting with other neural network options provided by the TensorFlow Playground. A brief description of each option is given below, but you should take some time to experiment with these yourself. Activation: The activation function determines what value a neuron fires when it’s threshold (bias) is surpassed. In the lecture slides we said that a neuron outputs 1 when it fires or 0 when it doesn’t. This is called a binary step function, but this is often too simple to model complex patterns. TensorFlow Playground instead provides several different activation functions, including ReLU, Tanh, Sigmoid and Linear. The following website provides an overview of these different activation functions: https://www.v7labs.com/blog/neural-networks-activation-functions Noise: By default, no noise is added to our training data. This makes our pattern boundaries very clear but is also not representative of many real-world datasets. Adding noise to our dataset will add some more variance to our data points, blurring the pattern boundaries. Ratio of training to test data: By default, the ratio of training data (that is used to train the neural network) to test data (that is used to evaluate the neural network’s accuracy) is 50/50. It is important that we keep some of our available data separate for testing the network, otherwise we will be unable to tell if our model is overfitting. You should see that if our ratio decreases to 10%, our test loss will be significantly higher. This indicates that the model is overfitting to our limited training data and performing poorly on the test data. This effect is especially obvious for the circle dataset, where our model will often not form the ideal circular pattern. Regularization: The purpose of regularization is to reduce overfitting and help generalise the model. Overfitting is when a model works well for the data that it was trained on but performs poorly on test data it hasn’t seen before. - L1 regularization (aka. Lasso) tries to keep the majority of the edge weights close to 0. - L2 regularization (aka. Ridge) tries to reduce the combined edge weights of the network. A higher regularization rate will also make the regularization effect stronger. Batch size: The batch size indicates how many dots are considered when updating the network values each epoch. A batch size of 1 will only consider a single dot, while a batch size of 10 will consider 10 dots. A larger batch size leads to a faster solution but may get stuck in a local (non-optimal) minimum. A smaller batch size adds more randomness to the training process and leads to a low convergence speed.
Stoichiometry Practice 2 Note: To receive credit, all work must be shown in this format. Submissions without work will not earn any points. 1) Using the following equation: 2 NaOH + H2SO4 → 2 H2O + Na2SO4 How many grams of sodium sulfate will be formed if you start with 200. grams of sodium hydroxide? 2) Using the following equation: Pb(SO4)2 + 4 LiNO3 → Pb(NO3)4 + 2 Li2SO4 How many grams of lithium nitrate will be needed to make 250. grams of lithium sulfate? 3) How many grams of HCl would be required to react completely with 5.00 grams of Ca(OH)2? Ca(OH)2(s) + 2 HCl(aq) → CaCl2(aq) + 2 H2O(l) 4) If I used 35 g of calcium hydroxide, how many grams of calcium chloride would be formed? Ca(OH)2(s) + 2 HCl(aq) → CaCl2(aq) + 2 H2O(l) 5) Calcium carbonate decomposes at high temperatures to form. carbon dioxide and calcium oxide: CaCO3(s) → CO2(g) + CaO(s) How many grams of calcium carbonate will I need to form. 3.45 g of carbon dioxide? 6) Ethylene burns in oxygen to form. carbon dioxide and water vapor: C2H4(g)+ 3O2(g) → 2CO2(g) + 2H2O(g) How many grams of water can be formed if 1.25 grams of ethylene (C2H4) are consumed in this reaction? 7) Using the following equation: 2Cl2(g)+C2H2(g) → C2H2Cl4(l) How many grams of chlorine will be needed to make 75.0 grams of C2H2Cl4?
INFOSYS 306 Digital Business and Innovation Tutorial 2 Objectives This tutorial aims to ● deepen your understanding of the concept of digital platforms and its ability to engage different groups of participants ● allow you to apply the platform. thinking to explore business opportunities ● reinforce your understanding of network effects Tasks 1. Google Nest is a smart home solution and can serve as a platform. Please brainstorm what producers Nest can bring on board and describe the values the producers can deliver to Nest users. 2. Study Adidas, platform https://www.runtastic.com/ and Nike run club https://www.nike.com/nz/nrc-app. ● Identify the participants the platforms engage from different sides ● Describe the values exchanged on the platforms 3. The COVID tracing app can be seen as a platform. Please describe the network effect taking place on it. Is it a within-group or cross-group effect? Can people who do not use the platform benefit from the increased number of users of the tracing app?
Economics School of Social Sciences 2024-2025 ECON20032 Macroeconomics 4 Semester 2 School of Social Sciences Economics Undergraduate Level 2 Lecture Time and Room: Wednesday 11am-1pm, Chemistry G.51 Examination Period: 12th May 2025 – 8th June 2025 Re-sit Period: 18th August 2025 – 31st August 2025 Aims This one-semester course in international macroeconomics aims to provide students with the theoretical tools and empirical facts needed for understanding and thinking critically about macroeconomics, and macroeconomic policy, in an international context. At the end of the term students will have a better appreciation of some key international policy issues, including the fight against high inflation, often presented in policy-oriented publications and the popular press. This will be facilitated by the use of a new core theoretical framework, in which banks play a prominent role. Students should also be able to better understand how national policy challenges intersect with international economic issues – including financial integration and the global consequences of the COVID-19 pandemic. Intended learning outcomes Knowledge and Understanding: At the end of this course students should be able to understand: 1. Key concepts of national accounts in an open economy. 2. The functioning of the foreign exchange market and the role of interest parity conditions in determining fluctuations in national currencies. 3. How fiscal and monetary policies, and external shocks, affect macroeconomic aggregates – including output, prices, the current account, and the exchange rate – in an open economy where banks play a critical role in the financial system. Also, how policymakers should combine monetary and fiscal policies to bring inflation down. 4. How the globalisation of banking affects the international transmission of financial shocks and the benefits of financial integration. 5. The benefits of international coordination of macroeconomic policies in response to a negative global shock (such as COVID-19) in a simple two- country model of the world economy. Intellectual skills: (i) problem-solving skills; (ii) skills of analysis, and the use of analytical models; (iii) the evaluation and critical analysis of arguments, theories and policies; (iv) understand and evaluate policy-oriented publications on international macroeconomic issues. Practical skills: independently locate and assess relevant literature, and to draw on these to develop understanding and to construct arguments. Transferable skills and personal qualities: (i) select and deploy relevant information; (ii) communicate ideas and arguments in writing; (iii) apply skills of analysis and interpretation; (iv) manage time and work to deadlines. Syllabus (9 sessions) The course will focus on the following topics: Topic 1. National Accounts and the Balance of Payments. [1 session, SEM2W01] Topic 2. Exchange Rates and the Foreign Exchange Market. [1 session, SEM2W02] Topic 3. Macroeconomic Policies in an Open Economy: The FF-GG-XX model. [5 sessions, SEM2W03, SEM2W04, SEM2W06, SEM2W07, SEM2W08] Topic 4. COVID-19 and the International Coordination of Macroeconomic Policies. [1 session, SEM2W9] Topic 5. Financial Globalisation: Global Banking, Capital Flows, and Macro- Financial Stability. [1 session, SEM2W10] Tutorials (5 sessions) Tutorial 1. Fixed Exchange Rates: Summary Equations and Solution. [SEM2W06] Tutorial 2. Fixed Exchange Rates: Policy and Exogenous Shocks. [SEM2W07] Tutorial 3. Flexible Exchange Rates: Summary Equations and Solution. [SE2MW08] Tutorial 4. Flexible Exchange Rates: Policy and Exogenous Shocks. [SEM2W09] Tutorial 5. Policy Combinations to Fight High Inflation. [SEM2W10] General References Robert C. Feenstra, and Alan M. Taylor, International Macroeconomics, 5th ed., Macmillan, 2021. Hereafter FT. Pr. P.-R. Agénor, “The FF-GG-XX Model for Macroeconomic Policy Analysis in an Open Economy,” Technical Manual, University of Manchester. General References, by Topic Topic 1: FT Chapter 5. Topic 2: FT Chapters 2 and 4. Topic 3: TM (mandatory reading, except for Appendix). Topic 4: FT Chapter 6. Topic 5: Technical Note.
Advanced Programming – Sample Exam Questions Q. You are designing a graphical user interface (GUI) for a music player application. The player allows users to visualize album cover, song information, sound waves, and to control playback (play, pause, next, volume, etc.). Consider each visualization and control element (sound wave, song info, play/pause button, volume slider) as a separate Java class. Which design pattern would be most suitable to structure these elements and allow them to be dynamically added/removed from the main player window? a. Composite b. Observer c. Decorator Q. You have been asked to develop a text editor application in Java. The editor provides basic functionalities like editing text, but users can install plugins to extend its capabilities (e.g., spell checking, syntax highlighting, code formatting). Which of the following design patterns would be most suitable to allow users to extend the editor's functionality with plugins without modifying the core editor code? a. Composite b. Observer c. Decorator Q. Consider an ArrayList named cities that contains the following elements: [Belfast, Cardiff, Dublin, Edinburgh] What will be the contents of the colours list after the following code is executed? cities.remove(1); a. [Belfast, Cardiff, Dublin, Edinburgh] b. [Belfast, Cardiff, Edinburgh] c. [Belfast, Dublin, Edinburgh] d. [Cardiff, Dublin, Edinburgh] e. An error will occur (out of bounds exception) Q. Consider a HashMap of type where the following products are added in the order specified: products.put("Shirt", 30); products.put("Hat", 15); products.put("Shirt", 45); products.put("Socks", 8); products.put("Socks", 15); Which of the following statements would be true after all entries are added? Select all that apply. a. The map will contain 5 entries. b. The map will contain 4 entries. c. The map will only contain the objects with unique keys. d. The map will only contain the objects with unique values. e. The map will throw an error about comparing non-numerical objects. f. Java will crash due to duplicate entries. Q. Suppose class Sheep extends class Animal. Each of these classes declares two public instance fields (so Sheep has four publicly accessible fields in total). What are the lengths of Sheep.class.getFields() and Sheep.class.getDeclaredFields()? a. 2 and 2 b. 2 and 4 c. 4 and 2 d. 4 and 4 Q. What is the purpose of the following method? Explain in 30 words or fewer. private static Long doSomething(final String string) { var X = Arrays.stream(string.split("\.")); return X.map( Z -> Arrays.stream(Z.split(" ")) .map(String::length).max(Comparator.naturalOrder()).get() ).filter(L -> L > 10).count(); } (Free text answer)
INFOSYS 306 Digital Business and Innovation Tutorial 1 Overview 1. Introduction Generally, tutorials are designed to fulfil the following objectives: a. Review/reinforce the content covered in the lectures and/or introduce the content to be covered in the following lectures. b. The review and preparation are given as tasks to be completed in groups. By doing so, we aim to foster a team-based learning process and cultivate critical thinking and independent problem-solving skills, in addition to deepening your understanding of the domain knowledge. c. Provide opportunities for the group to discuss and prepare for the group assignment. 2. Group formation a. Members should now have a group to work with. b. The formed group will be for TBL tasks and group assignments. 3. Participation a. Participate as a group. b. Each group (as a whole) must have presented their ideas/answers to discussion questions or raised thoughtful follow-up questions, which both added value to the progression of the class discussion, to receive one mark for the group. That is, there must be at least one member who has spoken up on behalf of their groups during one TBL session. Then, each member (who has contributed) will receive one mark. c. We encourage everyone to have a chance to speak their ideas in class. However, group members can participate/contribute in different ways. For example, members can initiate/share ideas between teams, speak/present ideas to the class, follow up/comment on others’ conversations during discussions, or make other forms of contributions. d. Everyone should record their contributions for each tutorial using the provided form. The form. will be collected after each tutorial. Task Many companies have adopted a product-as-a-service business model. Instead of selling products, they take care of customers’ entire product experience, usage process, and outcomes. For example, Michelin's has introduced a “pay-per-mile” program for the use of its tires. Rolls-Royce, the manufacturer of jet engines, charges its customers for engine repair and service only by those hours the engine is in use. Discuss the following questions (1) What digital technologies have made the product-as-a-service business model possible? (2) How does the product-as-service business model benefit the focal company such as Michelin’s? (3) How does the product-as-service business model benefit the focal company’s customers? (4) Share with the class some other products that adopt/can adopt this product-as-a-service business model.
MTH 223: Mathematical Risk Theory Tutorial 5 Part I 1. Given Λ = λ, N has a Poisson distribution with mean λ . The mixing random variable Λ has a uniform distribution on the interval (0, 5). Determine the unconditional probability that N ≥ 2. 2. Let N be the number of claims in an insurance portfolio. Assume that the conditional distribution of N , given Θ = θ, is a negative binomial NB(θ, 5). Θ has a uniform distribution U(0, 8). (a) Calculate the expectation of the number of claims in the portfolio. (b) Calculate the variance of the number of claims in the portfolio. (c) Calculate the probability that there are at least two claims in the portfolio. 3. Assume that the conditional distribution of X , given Θ = θ, is a Bernoulli distribution with mean θ . The distribution of Θ is a beta distribution BET(1, 3). (a) Show that X has a Bernoulli distribution and identify the param- eter for the Bernoulli distribution. (b) Show that the conditional distribution of Θ, given X = 0, is a beta distribution and identify the parameters for the beta distribution. 4. Given Θ = θ , N has a Poisson distribution with mean θ . The random variable Θ has a p.d.f. (a) Determine the p.m.f. of the mixed distribution. (b) Show that the mixed distribution is also a compound distribution. Identify the primary and secondary distributions. Hint: In this part, the logarithmic distribution with parameter β, which has a p.m.f. may be involved. The logarithmic distribution has a p.g.f. as follows
Economics School of Social Sciences ECON20032 Macroeconomics 4 Multiple Choice Questions: Topic 1 Question 1 In an open economy, absorption can be defined as A) The sum of consumption (private and public) and investment (private and public). B) The difference between production and exports of goods and services. C) The difference between private spending and the trade balance. D) The sum of consumption (private and public) and exports of goods and services. E) The sum of investment (private and public) and imports of goods and services. Question 2 The conventional measure of the current account is A) The difference between exports of goods and services and imports of goods and services. B) The difference between a) exports of goods and services plus net factor income from abroad, net unilateral transfers from abroad, and b) imports of goods and services plus interest payments to the rest ofthe world. C) The difference between a) exports of goods and services minus net factor income from abroad, and b) imports of goods and services minus interest payments to the rest ofthe world. D) The difference between a) exports of goods and services plus net unilateral transfers from abroad, and b) imports of goods and services minus interest payments to the rest ofthe world. E) The difference between a) exports of goods and services minus net unilateral transfers from abroad, and b) imports of goods and services minus interest payments to the rest ofthe world. Multiple Choice Questions: Topic 2 Question 1 When the home country’s exchange rate depreciates, A) Home exports become more expensive as imports to foreigners. B) Foreign exports become more expensive as imports to home residents. C) Foreign exports become less expensive as imports to home residents. D) A) and B). E) A) and C). Question 2 A forward contract between 2 parties in the forward exchange market involves A) The signing of a contract today, and an immediate exchange of one currency for another. B) The signing of a contract today, with a settlement date for the delivery of the currency set for in the future. C) The signing of a contract at a preset date in the future, with a settlement date for the delivery of the currency set also for the future. D) The signing of a contract at a preset date in the future, with an open settlement date for the delivery of the currency. E) A) and C).
Hitchcock Analysis Project Create a presentation about the Hitchcock films we watched this school year (Vertigo, Psycho, Rear Window). In this presentation, you must discuss the following: An analysis of two scenes from different Hitchcock films, including: Identity/Visual Literacy & Film Culture Cinematography (Shot analysis) Mise-en-scene Editing Sound Narrative Your analysis should be in complete sentences, it should utilize vocabulary from this school year. Each topic we have studied this year must have its own slide and should present an in-depth analysis demonstrating understanding of the terminology from the school year. Think of this as an essay without actually being an essay. Take it seriously. Prepare for your presentation. Ensure your presentation is not just text on a white background. An in depth analysis includes the following: Topic sentence, lead in, exposition, analysis, transition/concluding statement. This is about 5-7 sentences. Please note that Hitchock films are widely discussed on the internet. Al is never permitted for this assignment, and students not demonstrating work in Google Docs and/or demonstrating use of and copying of Al-generated content or non-cited content will be given a zero without exception. Note that this is a test/assessment grade and that you will not be presented with another way to make up this assignment. This assignment will be sent through turnitin.com
DEGREES of MSc Information Technology, MSc in Software Development and MSc IT Cyber Security Advanced Programming (IT) Monday 29 April 2019 1. (a) All Java objects have a method called hashCode that allows them to be hashed. Briefly describe what hashing is and how it is used in a data structure such as a HashSet. [4 marks] (b) Explain why the length of the String would likely be a poor hash function for hashing Strings containing words in the English language. [2 marks] (c) Within the context of hashing, what is a collision? [2 marks] (d) Consider the following class: public class Meal { private final String mainCourse; private final String dessert; public Meal(String mainCourse, String dessert) { this.mainCourse = mainCourse; this.dessert = dessert } public String getMain() { return mainCourse; } public boolean equals(Object o) { String therMain = ((Meal)o).getMain(); if(mainCourse.equals(otherMain)) { return true; }else { return false; } } public String toString() { return mainCourse + " and " + dessert; } } With reference to objects in general, explain why String.equals() is used in the equals method as opposed to ==. [4 marks] (e) A programmer decides to override hashCode in this class, using the method below. Explain why this hashCode necessitates a change elsewhere in the class and rewrite the relevant part of the original. public int hashCode() { return mainCourse.hashCode() + dessert.hashCode(); } [5 marks] (f) Consider the following code that makes use of this object: String mainDish = "Fish"; String dessert = "Tiramisu"; Meal m = new Meal(mainDish,dessert); mainDish = " and chips"; System.out.println(m); Explain, with reference to the particular properties of Strings, why the output is "Fish and Tiramisu" and not "Fish and chips and Tiramisu" despite the object being referred to by the mainDish reference having changed. [3 marks] 2. (a) Briefly explain the purpose of the decorator design pattern. [3 marks] (b) What is the advantage of a decorator over sub-classing? [2 marks] (c) Consider the following two classes: public abstract class AbstractOffice { public void openDoor() { System.out.println("The door has been opened"); } } public class ConcreteOffice extends AbstractOffice { private String address; public ConcreteOffice(String address) { this.address = address; } } You are tasked with using the decorator pattern to add a burglar alarm to an office. Firstly, create an abstract decorator class for AbstractOffice. [5 marks] (d) Now create a concrete burglar alarm decorator. Think about any new methods and attributes that you need. [5 marks] (e) Write a main method that creates an office decorated with your decorator. [3 marks] (f) State another design pattern that can be used to add functionality to classes without inheritance or large-scale modifications. [2 marks] 3. (a) The wait and notify methods provided with all Java Objects allow Threads to be placed in a waiting state until notified by another Thread. With reference to the Thread states runnable, blocked, waiting, describe the process by which a Thread acquires an object’s monitor (via e.g. entering a synchronized block), waits and is awaken via notification by another Thread. [5 marks] (b) The following three classes define a system including an Object (SendReceive) that permits the Sender object to send messages (in the form of a String) to the Receiver object. The Sender should be able to send a message only when there isn’t one waiting to be received. If there is one waiting, it should wait until it has gone. The receiver should wait until a message appears to be received. The SendReceive object is missing the implementation of the send and receive methods. public class Sender extends Thread { private SendReceive sr; public Sender(SendReceive sr) { this.sr = sr; } public void run() { String[] messages = {"Hi","How’re you?","Bye!"}; for(String message: messages) { sr.send(message); } } public static void main(String[] args) { SendReceive sr = new SendReceive(); new Sender(sr).start(); new Receiver(sr).start(); } } public class Receiver extends Thread { private SendReceive sr; public Receiver(SendReceive sr) { this.sr = sr; } public void run() { while(true) { System.out.println(sr.receive()); } } } public class SendReceive { /* hasMessage should be set to true when there is a message waiting to be received, false otherwise */ private boolean hasMessage = false; private String message; public void send(String message) { // YOUR CODE HERE } public String receive() { // YOUR CODE HERE } } Using wait and notify, write code for the send and receive methods. You may change the method decorators if you wish. [10 marks] (c) Using an example, describe what is meant by the term Race condition. For your example, describe how it could be avoided. [5 marks] 4. Please write the answers to the following 10 multiple-choice questions clearly in your answer booklet. There is only one correct answer in each case. Each correct answer is worth 2 marks. Incorrect answers will result in a penalty of two thirds ofa mark to discourage guessing. (a) Which of the following statements about inheritance is true: A. A class can extend many classes and implement many interfaces. B. Private attributes are directly accessible by subclasses. C. A final class cannot be subclasses. D. A class can implement only one interface. [2 marks] (b) Which of the following statements is false: A. An object referred to by a final reference cannot be modified. B. A final primitive cannot be modified. C. A final method cannot be overridden. D. A final object reference cannot be reassigned to a different object. [2 marks] (c) Which of the following correctly describes the output of this code snippet: public static void main(String[] args) { Double a = 6.5; Double b = a; b *= 2; System.out.println("a: " + a + ", b: " + b); } A. a: 13.0, b: 13.0 B. a: 13.0, b: 6.5 C. a: 6.5, b: 6.5 D. a: 6.5, b: 13.0 [2 marks] (d) Which of the following correctly describes the output of this snippet: public class ExamQ { public static int aValue = 0; public ExamQ() { aValue++; } public static void main(String[] args) { ExamQ a = new ExamQ(); ExamQ b = new ExamQ(); System.out.println(""+ a.aValue + " " + b.aValue); } } A. 2 2 B. 0 0 C. 1 2 D. 1 1 [2 marks] (e) Which of the following statements is false: A. The unknown order of operation of Threads makes it hard to predict when deadlocks might occur. B. A deadlock describes a situation when two Threads are waiting for one another. C. Deadlocks can always be avoided through the use of synchronized blocks. D. Conditions can be used to remove deadlocks. [2 marks] (f) An object is garbage collected in Java when: A. The method in which it was created ends. B. When main has finished. C. When there exists no references to it. D. When it is unreachable from main. [2 marks] (g) Which of the following statements about synchronized and locks is true: A. Synchronized cannot span multiple methods whereas locks can be locked in one method and unlocked in another. B. Locks are always preferable to synchronized blocks. C. Synchronized can only be used to synchronize the class it is being used within. D. Synchronized blocks are powerful because they allow us to use conditions. [2 marks] (h) Which of the following is false: A. Thread.join() is a blocking method. B. InterruptedException must be caught when using blocking methods. C. Thread.sleep() cannot be used in main. D. Calling interrupt() on a Thread that is sleeping causes an Exception. [2 marks] (i) Consider an Abstract class A that is subclassed by B. Which of the following is true: A. It is not possible to subclass an abstract class. B. B b = new B(); A a = b; is permissible C. A a = new B(); B b = a; is permissible D. It is essential to use Abstract classes in Java programming. [2 marks] (j) Using the classes A and B from the previous question. A has a single method getName(). B overrides the method and also introduces a method getAge(). Which of the following is false: A. B b = new B(); b.getAge(); will compile and run fine. B. A a = new B(); a.getName(); will use the version of the getName() method defined in class A. C. A a = new A(); a.getAge(); will fail to compile. D. A[] a = new A[2]; a[0] = new A(); a[1] = new B(); will compile and run fine. [2 marks]
Student Exploration: Chemical Equations Vocabulary: Avogadro’s number, chemical equation, chemical formula, chemical reaction, coefficient, combination, combustion, conservation of matter, decomposition, double replacement, molar mass, mole, molecular mass, molecule, product, reactant, single replacement, subscript. Prior Knowledge Questions (Do these BEFORE using the Gizmo.) 1. A candle is placed on one pan of a balance, and an equal weight is placed on the other pan. What would happen if you lit up the candle and waited for a while? ____________________ _________________________________________________________________________ 2. Suppose the candle was placed in a large, sealed jar that allowed it to burn for several minutes before running out of oxygen. The candle and jar are balanced by an equal weight. In this situation, what would happen if you lit up the candle and waited? ________________ _________________________________________________________________________ Gizmo Warm-up Burning is an example of a chemical reaction. The law of conservation of matter states that no atoms are created or destroyed in a chemical reaction. Therefore, a balanced chemical equation will show the same number of each type of atom on each side of the equation. To set up an equation in the Chemical Equations Gizmo, type the chemical formulas into the text boxes of the Gizmo. First, type in “H2+O2” in the Reactants box and “H2O” in the Products box. This represents the reaction of hydrogen and oxygen gas to form. water. 1. Check that the Visual display is chosen on each side of the Gizmo, and count the atoms. A. How many hydrogen atoms are on the Reactants side? ____ Products side? ____ B. How many oxygen atoms are on the Reactants side? ____ Products side? ____ 2. Based on what you see, is this equation currently balanced? _________________________ Introduction: To balance a chemical equation, you first need to be able to count how many atoms of each element are on each side of the equation. In this activity, you will practice counting the atoms that are represented in chemical formulas. Question: How do we read chemical formulas? 1. Observe: Type “H2” into the Reactants box and hit Enter on your keyboard. Note that the formula is shown as H2 below. The small “2” in H2 is a subscript. A. What does the “2” in H2 represent? _______________________________________ B. In general, what do you think a subscript. in a chemical formula tells you? _________ ___________________________________________________________________ C. Try typing in other subscripts next to the H, such as 3, 4, and 5. Is your answer to question B still true? Explain. ____________________________________________ 2. Count: Clear the Reactants box, and type in a more complex chemical formula: “Ca(OH)2.” Look at the number of atoms shown. A. How many of each type of atom do you see? Ca: _____ O: _____ H: _____ B. In general, what happens when a subscript. is found outside of parentheses? ___________________________________________________________________ C. Try typing in other subscripts next to the (OH), such as 3, 4, and 5. Is your answer to question B still true? Explain. ____________________________________________ 3. Practice: For each of the real chemical formulas below, calculate how many of each element there are. Check your answers for the first three formulas using the Gizmo. AgCl3Cu2 Ag: _____ Cl: _____ Cu: _____ Ba(AsO4)2 Ba: _____ As: _____ O: _____ (NH4)3PO4 N: _____ H: _____ P: _____ O: _____ MnPb8(Si2O7)3 Mn: _____ Pb: _____ Si: _____ O: _____ Introduction: In a chemical reaction, the reactants are the substances that enter into the reaction, and the products are the substances that are made in the reaction. A chemical reaction is balanced if the numbers of reactant atoms match the numbers of product atoms. Goal: Learn to balance any chemical equation. 1. Observe: To model how hydrogen and oxygen react to make water, type “H2+O2” into the Reactants box and “H2O” into the Products box. As the equation is written, which element is not in balance? ________________________ Explain: _________________________________________________________________ 2. Balance: To balance a chemical equation, you are not allowed to change the chemical formulas of the substances involved in the reaction. You are allowed to change the number of molecules of each substance by adding coefficients in front of the formulas. A. To balance the oxygen atoms, add a “2” in front of the “H2O” in the Products box. How many oxygen atoms are found on each side of the equation now? _________ B. To balance the hydrogen atoms, add a “2” in front of the “H2” in the Reactants box. How many hydrogen atoms are found on each side of the equation now? _________ C. Is this equation currently balanced? _________ Click Show if balanced to check. 3. Apply: Now enter a more complex chemical reaction: Ca(OH)2 + HBr → CaBr2 + H2O. List the numbers of each element in the tables below: A. Which elements are out of balance? ______________________________________ B. Add coefficients to balance first the bromine (Br) and then the hydrogen (H) atoms. When the equation is balanced, write the complete formula below: ___________________________________________________________________ 4. Practice: Chemical reactions are generally classified into five groups, defined below. Balance each equation, using the Gizmo for help. Combination (or synthesis) – two or more elements combine to form. a compound. · Na + O2 → Na2O _________________________________________ · La2O3 + H2O → La(OH)3 _________________________________________ · N2O5 + H2O → HNO3 _________________________________________ Decomposition – a compound breaks down into elements and/or simpler compounds. · KNO3 → KNO2 + O2 _________________________________________ · NaN3 → Na + N2 _________________________________________ · NH4NO3 → N2O + H2O _________________________________________ Combustion – a fuel reacts with oxygen to release carbon dioxide, water, and heat. · CH4 + O2 → CO2 + H2O _________________________________________ · C3H8 + O2 → CO2 + H2O _________________________________________ · C6H12O6 + O2 → CO2 + H2O _________________________________________ Single replacement – an element replaces another element in a compound. · KCl + F2 → KF + Cl2 _________________________________________ · Mg + HCl → MgCl2 + H2 _________________________________________ · Cu + AgNO3 → Cu(NO3)2 + Ag _________________________________________ Double replacement – two compounds switch parts with one another. · AgNO3 + K2SO4 → Ag2SO4 + KNO3 ___________________________________ · Mg(OH)2 + HCl → MgCl2 + H2O ___________________________________ · Al(OH)3 + H2SO4 → Al2(SO4)3 + H2O ___________________________________ Introduction: Chemists are often interested in obtaining a certain mass of product from a chemical reaction without wasting any reactants. But how is this done? To calculate the masses of reactants needed for a desired mass of product, it is necessary to understand a unit of quantity called the mole. Question: How do chemists know how much of each substance to mix? 1. Observe: The mass of a molecule of a substance is its molecular mass (M). Molecular mass is measured in universal mass units (u). One universal mass unit (1 u) is approximately the mass of a proton. Hydrogen gas has a molecular mass of 2.0158 u. A. Type the formula “H2” into the Reactants box. What is the molar mass of hydrogen gas, H2? ________________________ B. What is the relationship between the molecular mass and the molar mass of a substance? _________________________________________________________ A mole is defined as 6.0221415 × 1023 molecules (or atoms) of a substance. This value, called Avogadro’s number, is special because a mole of a substance has a mass in grams that is equal to the molecular mass of the substance. Moles are handy because a mole of one substance contains the same number of particles as a mole of another substance. 2. Gather data: The balanced equation to synthesize water is: 2H2 + O2 à 2H2O. Use the Gizmo to find the molar masses of each substance in this equation: 2H2 __________ O2 __________ 2H2O __________ 3. Analyze: Based on the molar masses, how can you tell that an equation is balanced? _________________________________________________________________________ _________________________________________________________________________ 4. Apply: Suppose you had one mole of oxygen (O2). How many moles of hydrogen (H2) would react completely with the oxygen, and how many moles of H2O would be produced? _________________________________________________________________________ _________________________________________________________________________ 5. Calculate: Suppose you had 2.0158 grams of hydrogen (H2). A. How many moles of hydrogen do you have? ____________________ B. How many moles of oxygen would react with this much hydrogen? ______________ C. What mass of oxygen would you need for this reaction? _____________________ D. How many grams of water would you produce? _____________________ 6. Challenge yourself: Suppose you wanted to make 100 grams of water. A. What is the molar mass of water (H2O)? _____________________ B. How many moles of water are in 100 grams? _____________________ C. How many moles of hydrogen will you need? _____________________ D. How many moles of oxygen will you need? _____________________ E. How many grams of hydrogen and oxygen will you need? Hydrogen: _____________________ Oxygen: _____________________ F. Is your answer reasonable? Why or why not? _______________________________ ___________________________________________________________________ ___________________________________________________________________ 7. Summarize: Why is it useful to use moles to measure chemical quantities? _____________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________
MTH 223: Mathematical Risk Theory Tutorial 5 Part II 5. It has been determined from the past studies that the number of work-ers’ compensation claims for a group of 300 employees in a certain occupation class has the negative binomial distribution with β = 0.3 and r = 10. Determine the frequency distribution for a group of 500 such individuals. 6. Let Λ ∼ GAM(r, β), and suppose that, given Λ = λ, N ∼ POI(λ + µ) where µ > 0 is a constant. (a) Show that N has p.g.f. (b) Find p0. (c) Show that and hence (d) Use part (c) to show that and (e) Assume that µ = 0.5, r = 3, and β = 2 for this part only, use parts (b) and (d) to calculate p0, p1, p2, p3 and p4. 7. Suppose that N has the following mixed Poisson distribution with pmf where the mixing random variable Θ has p.d.f. (a) Prove that (b) Find the m.g.f. of Θ. (c) Use the double expectation formula and your result in part (b) to show that the p.g.f. of N is given by Explain in words what type of distribution this p.g.f. corresponds to. (d) Determine E(N) and Var(N). (e) Consider a ground up loss random variable X which has a lognor-mal distribution with parameters µ = 3.3 and σ = 2.5. Suppose a franchise deductible of 200 is imposed. If the number of losses has the p.g.f. in part (c), identify the distribution of the number of payments.
Macroeconomics 137 Problem set 4 Please turn in answers by scanning them on canvas. Compile the into a single pdf before uploading them please. Question 1 Download the data for Consumption, Investment, GDP, from following sources for the period 1951-01-01 to 2020-01-01. Monthly consumption expenditure: https://fred.stlouisfed.org/series/PCEPI Quarterly investment expenditure: https://fred.stlouisfed.org/series/GPDIC1 Quarterly GDP: https://fred.stlouisfed.org/series/GDPC1 Quarterly Govt Expenditure: https://fred.stlouisfed.org/series/GCEC1 Using the EDIT GRAPH option in the FRED database, extract the quarterly series for Consumption. Store all the series in one excel spreadsheet. Make sure that you are copying them for same time period. a. Compute 8 quarter moving average for each of the data series. Plot the actual series and the con- structed moving average series. b. Subtract the actual series from the moving average trend-line constructed in the previous part. Lets call this cycle for each of the series. Plot the cycle series for each data component listed above. c. Calculate standard deviation of the cycle series constructed in part b. How volatile are investment, consumption, and govt spending relative to GDP. d. Re-calculate the standard deviation by splitting the sample into pre 1984, and 1984—2008 sample. What do you observe? Question 2 Solve Problem 13.4 in Kurlat textbook. Question 3: from end of Chapter 8, Eggertsson Consider this model ˆ(ı)t =ˆ(r)t + Et πt+1 ˆ(m)t = ηy Y(ˆ)t - ηi ˆ(ı)t ˆ(m)t = ˆ(m)t- 1 + ˆ(µ)t - πt ˆ(µ)t = γˆ(µ)t- 1 + ϵt ˆ(r)t = ρˆ(r)t- 1 + υt where ϵt and υt are iid with zero mean and 0
Module Title: Data Structures and Algorithms Module Code: COS5021-B Module Credit: 20 Level: L5 Academic Year: 2024/25 Date due: Check on the Canvas. Length limit: There is no limit whereas each question should be explained for each steps performed. Learning Outcomes: This assessment will evaluate follow learning outcomes of the module: LO1: Recognise common data structures and fundamental algorithms and be familiar with the associated terminology. LO2: Define Abstract Data Types in terms of their data structures. Assessment Methods: Resit- Coursework - This consists of six (06) questions including their sub-parts. You need to answer all the questions according to the question asked. Note: Understanding the questions is part of the assessment and no AI tools would be used for this assessment. Please take note of the following regulations/advice where appropriate: • Check the assignment marking criteria when doing your assessment. • Go through your lecture/lab materials on the canvas for more understanding. Guidelines: Each student is given a (different) list of numbers to be used, in sequence, as keys for entries into a heap, into a hash table and into an AVL tree. Your assignment is to show the trace of the operations of insertion, re-structuring, etc. involved for your list of keys when they are entered into a heap, a hash table and an AVL tree. Form. of Submission Your submission should be. in a plain text file uploaded in Canvas module assessment section. The content of your submitted file should be as follows. 1. Have your UoB in the first line, e.g. DSA Coursework 16012345 2. The word 'data' and your assigned list of keys, e.g. keys 25, 10, 15, ... Find your keys against your name and UB number in Data file. I recommend that you copy and paste the whole line on to your submission document. When you paste the line, it will be quite noticeable if it shows someone else's UB number. You can then safely delete your UB number from the copy, knowing you have the right data. 1. Binary Heap The task here is to show a trace of the operations needed to insert objects with your (list of) keys, one by one, into an initially empty miniHeap with restoration of heap order (if necessary) with each insertion. Your submission should have the section heading 'Heap trace' followed by the coded trace of operations: Hx to create a hole at location x in the heap; X to move the hole up the heap by swapping the hole with its parent; Ixx to insert key xx into the hole; with the coded operations in sequence on successive lines, e.g. Heap trace H1 I25 H2 X I10 H3 I15 ... 2. Heap Build For this part, your keys are loaded into the heap without application of heap order. Show a trace of the operations in the heapBuild process, to apply heap order to the (loaded) heap. Your submission should have the section heading 'Heap Build trace' followed by the coded trace of operations: Xxx to swap the object having key xx with its parent; with the coded operations in sequence on successive lines, e.g. Heap Build trace X15 ... 3. Heap Sort This part is for heap maintenance during the output phase of heap sort, i.e. you begin with the heap resulting from the previous section (2. Heap Build). Show a trace of the operations to output each object (from the root) and then to restore heap order after each output. Your submission should have the section heading 'Heap Sort trace' followed by the coded trace of operations: Mxx to remove the object with key xx from the root (and so create a hole at the root); L to move the hole down the heap by swapping the hole with its left child; R to move the hole down the heap by swapping the hole with its right child; Xxx to move object having key xx into the hole (and delete the node that previously contained key xx); with the coded operations in sequence on successive lines, e.g. Heap trace M10 L L X57 M12 R X39 M15 L L X84 ... 4. AVL Tree The task here is to show a trace of the operations needed to insert objects with your (list of) keys, one by one, into an initially empty AVL tree with restoration of AVL balance (if necessary) after each insertion. Your submission should have the section heading 'AVL trace' followed by the coded trace of operations: Ixx to insert key xx at the root of the previously empty AVL tree; IxxLyy to insert key xx as the left child of the node containing key yy; IxxRyy to insert key xx as the right child of the node containing key yy; Rxx to rotate the node containing key xx with that of its parent (in order to restore AVL balance); with the coded operations in sequence on successive lines, e.g. AVL trace I25 I10L25 I15R10 R15 R15 ... 5. Hash Table (1) The task here is to show a trace of the operations needed to insert objects with your (list of) keys, one by one, into an initially empty 11-bucket hash table with 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1 2 3 1 2 3 1 2 3 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 (primary) hash function h1(x) = x mod 11 (see table at the end of this page) and using linear probing for collision resolution. Your submission should have the section heading 'Hash Table trace 1' followed by the coded trace of operations: Pn to probe bucket n (to see if it already contains an entry); Ixx@n to insert key xx into bucket n; with the coded operations in sequence on successive lines, e.g. Hash Table trace P3 I25@3 P10 I10@10 P3 P4 I14@4 ... 6. Hash Table (2) The task here is the same as for the previous section (5. Hash Table (1)) except that collision resolution is to use the secondary hash function h2(x) = (x mod 3) + 1 (see table at the end of this page). Your submission should have the section heading 'Hash Table trace 2' followed by the coded trace of operations (same coding as for previous section). Hash Functions The body of each table contains key values. The value of the hash function for a key is shown (in bold) at the head of the column in which the key appears. primary hash function secondary hash function Coursework Marking Criteria Since every student gets a different data set, it is not possible to give a sample solution to the coursework. There is a single marking criterion: correctness of the solution. However partial credit will be awarded to solutions based on what mistakes are made. It is very important that for each step of the questions in the entire coursework should be backup with its explanation. For instance, if you insert/delete a key in the tree, you should clearly explain why you have inserted/deleted the key in the respected location. May be due to a current key is less than or greater than the previous key etc. Keep in your mind a mistake at the early stage could end with wrong tree or answers and you will be deducted the marks. Double-check your current step while proceeding with the further steps. The components of the coursework are weighted as follows: Binary Heap: 20% Heap Build: 15% Heap Sort: 15% AVL Tree: 20% Hash Table (1): 15% Hash Table (2): 15%
Syllabus MSIN0041 – Marketing Science 2024–2025 Introduction Marketing professionals have long used data to guide their marketing decisions and measure the effectiveness of marketing campaigns. Advancements in technology have brought forth an unparalleled amount of data. Marketers need a more systematic way of analysing data, unearthing insights, and using those insights to help with business strategies. Marketing science (also known as quantitative marketing) revolves around under- standing complex marketing dynamics to predict business outcomes and recommend strate- gic actions using quantitative research methods, often from economics and statistics. Some major objectives of this module include the provisions of the following learning objectives: • A high-level understanding of the fundamental concepts in marketing • An exposure to the marketing problems leading companies seek to address with scientific methods, as well as the results of such efforts • A (controlled) practical experience with data and methods in marketing science • An intuitive understanding of methods in marketing science. Logistics Lectures are held on Tuesdays 2–5pm in Room 508 of Roberts Building. You are advised to check the UCL Timetable regularly for breaks and any unexpected changed to the schedule. Lecture attendance is an essential part of your learning experience and required by the Programme. If you cannot attend a lecture, please inform the Programme Administrator in advance. Lecture recordings are available through Lecturecast. Watching the recordings is optional, and lectures are prepared and delivered with the assumption of in-person attendance only. Consequently, the quality of the recordings is not guaranteed, and recordings are not a sub- stitute for lecture attendance. If you have questions about the lecture content, drop by the regular office hours or reach out to the Module Leader for help. Office Hours The module leader’s office hours are held in person on Tuesdays from 1.45pm to 2.45pm in Roberts Building. You are welcome to email the module leader to make an appointment if you cannot attend the in-person office horus. Emails Your module leader and teaching assistants may receive a large number of emails during the teaching term. To ensure that your email is read and replied in a timely manner, please include MSIN0041 in the subject line of your email. Unless the matter is urgent, please be patient for a response. Administrative matters such as technical issues with Moodle and extension requests should be direct to the Programme Administrator. Sending the module leader or teaching as- sistants such emails will likely result in a delay to the resolution of your issue as the only thing they can do is to forward your email. For academic questions, emails are only good for brief and simple questions. More complex questions should be addressed in office hours instead. Reading and Software This module has no required textbook, but there will be some individual readings and case studies assigned. You are expected to contribute to the in-class discussions about these read- ings and case studies. If you care for additional reading, here are two recommendations by Dr Miao Wei, who has been teaching the well-regarded Marketing Analytics (MSIN0094) module for students in MSc Business Analytics. Both books are either free or available through the UCL Library Services: • Handbook of Marketing Analytics: This book provides a good survey of analytical methods used in quantitative marketing and their high-impact real-life applications. • Introduction for Econometrics with R: The authors intend this book to provide an interac- tive environment for the learning of econometrics with empirical applications. While the authors have modestly stated otherwise, the book is a good introduction/refresher to both econometrics and R. Lecture slides will be uploaded to Moodle in two formats: HTML and PDF. The HTML format is recommended for viewing on a digital screen such as a tablet, whereas the PDF format is suitable for printing. Some topics will have supplementary materials notes, which will be uploaded alongside the slides and examinable. R will be used for computations. You are required to (learn to) use it for your individual coursework. If you have not worked with R on a desktop before, Dr Miao has kindly prepared a step-by-step guide for you to get started with R. AI Policy This module allows the assistive use ofAI tools such as ChatGPT, Claude, and Gemini. You are strongly encouraged to assist your learning with these AI tools. They are extremely helpful in efficiently obtaining high-level understanding of many fundamental concepts in marketing and programming. This module assumes that you are comfortable with R thanks to the Data Analytics module series, but in case you are not, these AI tools should be very helpful in getting you up to speed with the level of command needed for this module. A typical use of AI is to ask it to explain the codes in the lecture to you, or to ask it to help debug your codes. However, do be aware that AI tools are not a substitute for the learning of the fundamentals, and they are sometimes prone to hallucinate and provide false information. It is strictly pro- hibited to ask AI to (e.g., codes) write your coursework for you. Assessment Term Name Weight 25%1Group Coursework30%3Module Exam60%
125.250, Assessment #2 Risk and Return Project Due: May 30 (Friday) 5 pm, New Zealand Time Background The project counts for 20% of your final grade (20 marks in total). It is not something that you can do in the last week before it is due, so I suggest that you start working on it well before the due date. Requirements You are an analyst working for a major stock broking firm. Your boss has asked you to prepare excel spreadsheets to analyse the risk and return characteristics of two S&P/NZX 50 Gross Index (^NZ50) companies. The S&P/NZX 50 Gross Index is designed to measure the performance of the 50 largest, eligible stocks listed on the Main Board (NZSX) of the NZX by float‐adjusted market capitalization. The index is widely considered as New Zealand's preeminent benchmark index. The index is covering approximately 90% of New Zealand equity market capitalization (https://www.nzx.com/markets/nzsx/indices/NZ50). The components for the NXZ50 index are shown in the Appendix of the document. You can select two NZ50 companies that you want to evaluate for any reasons. You can download the historical trading data of the two companies at https://nz.finance.yahoo.com/ (as shown in the figure below) or follow the steps in Appendix 2. 1) Type in the symbol of the selected company at the “Search” box to access the data of the selected company (for example, “ATM.NZ” forA2 Milk Company). 2) Click on “Historical Data”. 3) Set the “Time period” and “Frequency” of “Historical prices” and click “Apply”. 4) Click “Download” to download the historical prices ofthe selected company. “Historical prices” to download: Daily data for the period from 2019 to 2024” is required to perform the calculations. This is a compulsory requirement of this assignment. Your manager points out that although the past is not always a good predictor of the future, the clients want to know the information on the historical return and risk characteristics of the selected NZX50 stocks. Please perform. the following estimations. 1. Weekly returns, using “Adj Close” prices to calculate the returns (3 marks) 1) Calculate the arithmetic daily returns ofthe two companies (1 mark) 2) Calculate the continuously compounded daily returns ofthe two companies (1 mark) 3) Create scatter plots using compounded daily returns ofthe two companies, and briefly discuss the results (1 marks) 2. Descriptive statistics (2 marks) 1) Obtain the descriptive statistics of the daily returns ofthe two companies. (1 mark) 2) Briefly discuss the results (return and risk). Which stock is a better choice based on the mean-variance criteria? (1 mark) 3. Histogram (3 marks) 1) Create the Histogram using compounded daily returns for the two companies. (2 marks) 2) Briefly discuss the results (skewness, kurtosis, normal distribution) (1 mark) 4. t‐test (4 marks) 1) Perform. “t-test: Paired Two Sample for Means” to examine whether the mean difference of the two companies’ compounded daily returns is statistically significant (2 marks) 2) Briefly discuss the results (2 marks) 5. Estimating Beta (4 marks) 1) Estimating Beta (measurement of systematic risk) of the two companies, based on the data from 2019 to 2024. The data of NZX50 index prices (to proxy the market return) is provided in the Excel temperate (2 mark) 2) Briefly discuss the results (which one is riskier based on systematic risk) (2 marks) 6. Portfolio Investment (4 marks) Your company considers investing $100,000 in a portfolio that consists of two stocks that you analysed in the previous sections. Which proportion of each stock in the portfolio that you recommend your manager to invest? Justify your choice. What needs to be handed? Please submit the electronic copy of your Excel workbook via the “125250 project submission drop-box”. • Please use separate workbooks to perform the calculations and name each workbook properly (the template is available on Stream). • Please briefly discuss the results in the relevant excel spreadsheet if it is required. There is no need to submit a separate Word document to discuss the results.