Paper Assignment Econ 2560, Fall 2024 Over the course of the semester, you will conduct independent statistical analysis on a topic of your choosing, which will culminate in a write-up to be handed in on the last day of class, 4/16. The objective of this project is for you to see how the concepts discussed in lecture can be applied to a real dataset of interest to you. This analysis must be novel and cannot borrow any work you have done for another class or project. Think of the end product as being the type of long-form. analysis that could be posted as an article on a quantitative blog. It will involve rigorous econometrics and thoughtful analysis, but it is less substantial than an academic paper. Schedule: This project will be developed over the course of the semester according to the schedule below. I will give you some feedback as the schedule unfolds, but please reach out to me if you would like to discuss what you are doing in more depth. This is especially true in the last couple weeks of the semester, when you will be pulling the paper together. 1. 10/4 (as part of Problem Set 2): Propose 3 datasets that you think might be interesting to study. A long list of publicly available datasets are available at the end of this document; this can be a very helpful place to look. 2. 10/18 (as part of Problem Set 3): Choose a dataset and propose a research question that the variables in the dataset could help you to answer. 3. 11/5 (as part of Problem Set 4): Provide summary statistics (number of observations, mean, variance, median, minimum, maximum) of at least 3 variables in the dataset. 4. 11/19 (as part of Problem Set 5): Show results from at least 2 regressions in your dataset, including both coefficients and standard errors. 5. 12/3: Final write-up due. Final Write-up: (Steps 1-4 above will be discussed in greater detail in their corresponding Problem Sets.) The final write-up (step #5 due on 12/3) should be roughly 1,500-2,000 words, excluding tables and figures. It should include the following components: 1. A discussion of a research question or hypothesis. For instance, “Do the returns to education (in terms of salary) differ for people with different IQs?” You should discuss why this issue is interesting and/or important, and how knowing the answer could guide how individuals, organizations, or policymakers might make decisions. (~250 words) 2. A description of the dataset. This should include the time period covered, the number of observations,the variables included, how the data was collected, and anything else noteworthy about the dataset. (~125 words) 3. Summary statistics describing all variables to be used in the analysis. These should be “publication quality” tables showing (at least) number of observations, mean, variance, median, minimum, and maximum. If there are two variables of primary interest, it may be helpful to show a scatterplot. (~125 words) 4. An explanation of the empirical methodology. What will be the lefthand side variable in your regressions, and what will be the key righthand side variable(s)? Do you have to do any data transformations (e.g. take logs of variables)? Why do the regressions you propose help to answer the research question you proposed above? How will you interpret the coefficients that Stata spits out? What key hypothesis test(s) will you conduct? (~250-500 words) 5. Discussion of results from at least three regressions. (~500 words) a. A “baseline” regression ofy on x1 (and potentially other regressors x2, etc.) b. A “flexible” regression that allows x1 to enter non-linearly (e.g. quadratic, non-parametric) c. A version that adds an additional regressor to the baseline (you can also add it to the flexible version ifyou think it makes sense) You should discuss how the implications ofyour regression results for your hypothesis, including sign (positive, negative), magnitude, and statistical significance. If you feel you got a clear answer to your question, what was it? If the answer is still unclear, why is that? Be sure to discuss how adding the regressor (in regression c) affected the coefficient and the standard error on your main x1. Also discuss whether you think the baseline or the flexible version is more useful. This is the main section of the report, and it will be different for each person; the questions above are not an exhaustive list. Think hard about what your results say (and don’t say) and discuss that here. 6. Literature review; described further below. (~250-500 words) 7. Conclusion. What was your empirical analysis able to teach you? What are its shortcomings? What are some new questions it brings up? Ifyou had more time and/or better data, how would you try to improve the analysis? (~250-500 words) Evaluation: Your paper will be evaluated along the following dimensions: ● Did you employ the tools from the course in a proper and sensible way? Concretely, do the regressions that you ran on your dataset constitute a reasonable approach to answering your research question? ● Did you interpret the results of your regression analysis in a reasonable way? ● Did you explain the results in a clear, transparent way? I will not explicitly grade you on the quality ofyour English prose, but papers will receive higher grades if they are able to explain the ideas in a way that is easy for a reader to follow. The writing should be formal (e.g. avoid contractions like “won’t”) and should include economic/econometric terms whenever relevant. ○ Note: Think of the “target audience” as your Econ 2560 classmates. You do not need to try to explain your ideas in a way that the “(wo)man on the street” could understand – you can assume an understanding of econometrics from your readers. However, you should write as an independent project that is separate from the components you handed in during the semester. Literature Review: You must provide a literature review of prior work relevant to your research question. This literature review will help you conceptualize and operationalize your research question. This literature review must be comprised of at least three sources. For most projects, these citations should come from academic journals. However, if your project is about a topic that is not closely studied by academics (e.g. some sports topics), then we can discuss suitable alternatives. These three (or more) sources can be searched via academic journals’ electronic portals such as, for example, “JStor” (http://www.jstor.org/), “EconLit” (http://www.aeaweb.org/econlit/), as well as other electronic resources accessible via the NU Libraries (http://library.northeastern.edu/find). Other useful academic sources are, among others, the “Journal of Economic Perspectives” (http://www.aeaweb.org/jep/), the “Journal of Economic Literature” (http://www.aeaweb.org/jel/index.php), the “Handbook of Economics” series (http://www.elsevier.com/books/book-series/handbooks-in-economics), and the “New Palgrave Dictionary of Economics” (http://www.dictionaryofeconomics.com/dictionary). Each of these resources is available to you, free of charge, via the Northeastern library website (http://library.northeastern.edu/find). If you are in doubt on how to use any of these resources to locate academic articles relevant to your research topic, I highly recommend you consult a librarian at the Northeastern library. For each of the formal sources you select for your literature review, you should provide a brief and to-the-point summary of the article. Then, you must discuss how your findings relate to the literature you are citing to. Do your findings contradict anything the other papers found? If so, why might this be (e.g. different setting? different econometric approach)? Do your findings extend the conclusions of the prior literature (e.g. “the prior literature finds a positive effect of education on earnings, but I find this is mostly driven by men”)? Exactly what this section should contain is case-specific, but the above questions are good starting points for how you should think about what to include. Note that you must then cite this article in your bibliography (at a separate page in the end of your paper): Ehrlich, Isaac. 1996. “Crime, Punishment, and the Market for Offenses.” Journal of Economic Perspectives. 10(1). Pp. 43-67. List of selected surveys conducted by U.S. government agencies ● Academic Libraries Survey ● Advance Monthly Retail Sales Survey ● Airline Origin and Destination Survey ● American Community Survey ● American Housing Survey ● American Time Use Survey ● American Travel Survey ● Annual Capital Expenditures Survey ● Annual Parole Survey ● Annual Parole Survey & Annual Probation Survey ● Annual Public Employment Survey ● Annual Retail Trade Survey ● Annual Survey of Government Finances ● Annual Survey of Jails ● Annual Survey of Manufactures ● Annual Survey of State and Local Government Finances ● Annual Wholesale Trade Survey ● Baccalaureate and Beyond Survey ● Beach Sanitary Survey ● Beginning Postsecondary Students Longitudinal Study Survey ● Beginning Teacher Longitudinal Study Survey ● Building Permits Survey ● Business and Professional Classification Survey ● Business R&D and Innovation Survey ● Business Research and Development and Innovation Survey ● City-Level Survey of Crime Victimization and Citizen Attitudes ● Civil Justice Survey of State Courts ● Clean Watershed Needs Survey ● Commodity Flow Survey ● Community Water System Survey ● Consumer Expenditure Survey ● Coral Condition Survey ● Criminal Justice Expenditure and Employment Survey ● Current Population Survey ● Customer Service and Satisfaction Survey (by U.S. HUD) ● Early Childhood Longitudinal Study Survey ● Health and Diet Survey (FDA) ● High School and Beyond Survey ● Housing Vacancy Survey ● Information and Communication Technology Survey ● Justice Assistance Data Survey ● Local Government School System Finance Survey ● Mammography Facility Survey ● Manufacturers' Shipments, Inventories, and Orders Survey ● Manufacturing Energy Consumption Survey ● Manufacturing Technology Surveys ● Medical Expenditure Panel Survey ● Medical Expenditure Survey ● Monthly Retail Trade Survey ● Multi-Agency Radiation Survey ● National Aquatic Resource Survey ● National Assessment of Education Progress Survey ● National Assessments of Adult Literacy Survey ● National Asthma Survey ● National Beneficiary Survey ● National Cancer Patient Experience Survey ● National Compensation Survey ● National Computer Security Survey ● National Crime Victimization Survey ● National Employer Survey ● National Family of Family Growth ● National Former Prisoner Survey ● National Health and Nutrition Examination Survey ● National Home and Hospice Care Survey ● National Home Health Aide Survey ● National Hospital Discharge Survey ● National Household Education Survey ● National Household Travel Survey ● National Immunization Survey ● National Inmate Survey ● National Longitudinal Survey ofYoung Men and Older Men ● National Longitudinal Survey ofYoung Women and Mature Women ● National Longitudinal Survey of Youth ● National Maternal and Infant Health Survey ● National Mortality Followback Survey ● National Nursing Home Survey ● National Postsecondary Student Aid Study Survey ● National Public Education Financial Survey ● National Rivers and Streams Assessment Survey ● National Study of Postsecondary Faculty Survey ● National Survey of Ambulatory Surgery Survey ● National Survey of Children with Special Health Care Needs ● National Survey of Children's Health ● National Survey of DNA Crime Laboratories ● National Survey of Fishing, Hunting, and Wildlife-Associated Recreation ● National Survey of Indigent Defense Systems ● National Survey of Recent College Graduates ● National Survey of Residential Care Facilities ● National Survey ofYouth in Custody ● National Survey on Drug Use and Health ● National Wetland Condition Assessment Survey ● Nationwide Personal Transportation Survey ● New York City Housing and Vacancy Survey ● Occupational Employment Statistics Survey ● Origin and Destination Survey ● Police-Public Contact Survey ● Property Owners and Managers Survey ● Public Libraries Survey ● Quarterly Public Employee-Retirement Systems Survey ● Quarterly Survey ofPlant Capacity Utilization ● Quarterly Tax Survey ● Recidivism Survey of Felons on Probation ● Report of Organization Survey ● Residential Finance Survey ● Service Annual Survey ● State and Local Government Public-Employee Retirement System Survey ● State Government Tax Collections Survey ● State Library Agencies Survey ● Survey of Adults on Probation ● Survey of Business Owners ● Survey of Campus Law Enforcement Agencies ● Survey of Construction ● Survey of Doctorate Recipients ● Survey of Income and Program Participation ● Survey of Industrial Research and Development ● Survey of Inmates in Federal Correctional Facilities ● Survey of Inmates in Local Jails ● Survey ofLaw Enforcement Gang Units ● Survey of Market Absorption ● Survey ofNew Manufactured (Mobile) Homes ● Survey of Pollution Abatement Costs and Expenditures ● Survey of Program Dynamics ● Survey of Research and Development Expenditures at Universities and Colleges ● Survey of Science and Engineering Research Facilities ● Survey of Sexual Violence ● Survey of State Procedures Related to Firearm Sales ● Survey of State Research and Development Expenditures ● Survey on Sexual Violence ● Teacher Compensation Survey ● University Transportation Survey ● Vehicle Inventory and Use Survey ● Women- and Minority-Owned Business Survey
CEG 8019: Individual Report You will be assigned one of the scenarios listed below. Your task is to develop a simulation model (simulation period = 1 hour) that accurately reflects the given scenario. In your report, describe the model development process in detail, including the setup, parameters used, and any assumptions made. Additionally, include screenshots of key steps and present the simulation results. Scenario 1: Urban Intersection with Fixed-time Traffic Signal Control. • Intersection with 4 approaches, each with 2 lanes (one for straight/left turns, one for right turns). • Traffic volumes: 800 vehicles per hour (vph) per approach. • Implement fixed-time signal control • Outputs: vehicle delays, queue lengths at each approach. Scenario 2: Two-Lane Roundabout with Heavy Truck Traffic • Roundabout with four entry points. • Traffic volumes: 400 vph with 25% heavy trucks per approach. • Outputs: vehicle delays, queue lengths. Scenario 3: Motorway On-Ramp with Metering Control • On-ramp with one lane merging into a 3-lane motorway. • Traffic volumes: 1,500 vphon the motorway, 500 vphon the ramp. • Ramp metering allows one vehicle per green signal. • Highway speed limit: 70 mph; ramp speed limit: 50 mph. • Outputs: motorway flow, ramp queues. Scenario 4: Multi-Lane Arterial with Lane Closure for Construction • 3-lane arterial road with one lane closed for construction. • Traffic volumes: 2,000 vphon the arterial road. • Traffic management includes temporary signals and reduced speed limits (down to 30 mph from 50 mph). • Outputs: travel times, queue lengths. Scenario 5: On-Street Parking and Mixed Traffic • A two-lane road accommodating both cars and bicycles with on-street parking on one side. • Traffic volumes: 400 vph with 100 bicycles per hour. • Include parked vehicles and their effects on lane usage and traffic flow. • Outputs: delays of different traveller types. Submission Requirements: Submit your assignment as a single document. Ensure the report is well-organized and professionally written. Submission deadline: 22nd November, 2024 (2pm) Assessment Criteria: Your assignment will be assessed based on the following criteria: The overall quality of the report, including clarity and presentation. Quality of the simulation model as well as the description of the model development process and presentation of simulation outputs. Scenario Allocation: Student Number Scenario 240649252 1 230514388 2 240636148 4 240040046 4 150445799 2 200937531 2 240252395 5 240166553 2 240610492 2 230711666 1 240677417 4 240130211 4 230155893 5 230639131 1 230530126 2 240360483 4 240439893 3 240020440 3 230724437 2 240717609 3 210099467 3 240562869 2 240589578 1 240293550 4 240163703 1 240163312 3 240201223 5 240049463 3 240605306 2 240735603 5 240068936 1 240005724 5 240218128 5 240057217 4
SCWK90055 The Legal and Ethical Contexts of Practice Assignment 2- The Legal Context of Social Work Practice (1,500 words- 30% of overall mark for the subject) Essay topic: Identify an area of practice in which you are interested and in which social workers operate within a significant legal context. (For example: child protection, mental health, disability, elder abuse, refugees and asylum seekers, criminal justice system, family violence). Your paper should examine the legal context of practice in your chosen area, including relevant legislation, and how the legal context shapes and influences social work practice. Your essay needs to demonstrate: ● Knowledge of the specific legal context and legislation relevant to the area of social work practice. ● Identification of key drivers of change in the relevant legal context/legislation and likely future reforms. ● Capacity to identify and understand the impact of the legal context/legislation on the area of social work practice (ie. The impact on social workers and the people they work with). When choosing your area of practice and the legal context, this must relate to the current legal context including current legislation in operation, although in the section of your paper referring to change and law reform. you may of course refer to previous legislation. General ● All assignments should be submitted electronically through CANVAS by 11.59 pm on the due date. If you have problems uploading the assignment please let the subject coordinator and/or your tutor know as well as emailing them your assignment (by the due time). Please ensure you keep a record of submission. ● The number of words for this assignment is 1,500 words. While there is a 10% leeway assignments substantially over the required word count may be penalised (eg. assignments with over 1650 words may be penalised). The word count includes all quotes and in text citations and references to literature and legislation (but excludes the bibliography/reference list at the end of your paper). Choosing an area of practice This assignment requires you to choose an area of social work practice that operates within a significant legal context. This is likely to be social work practice in areas such as child and family welfare, mental health, disability, elder abuse, family violence, asylum seekers and refugees or the criminal justice area. However, there are other areas of social work practice that would be suitable for the assignment- please discuss with your tutor to make sure it is a suitable area for the assignment. You can choose to focus on a broad area of practice (eg. mental health) or, given the word limits, it is recommended that you choose a more specific area (eg. CTOs within the mental health system). The main issue to consider in choosing how you will focus your assignment is that there is some connection to social work practice (ie. Social workers need to work within the legal context of the area you are examining and/or typical clients/service users of social workers/human services are impacted by the legal context). Basic structure for the assignment ● Introduction- in which you should clearly indicate the practice area you will be examining and any particular focus you will be making within that area. ● The main areas you should aim to cover in the body of the paper include (in no particular order): o Key principles, elements & content of the legislation in the area you are examining (note: you do not need to reproduce large slabs of the legislation although small quotes if they demonstrate a point are permissible- ie. You should be summarising and demonstrating your knowledge and understanding of the legislation/area of law you are examining- not just what is contained in an Act.) o An analysis of current issues concerning the legislation/area of law. eg. Are there calls for reforms of the law? In what areas? Who is calling for the changes? What are the broader community views? o An analysis of the impact of the legislation/ area of law on social work practice and/or users of social work/ human services. (This will usually be a separate section but may be incorporated throughout your paper). ● Conclusion. Note: You do not need to limit your paper to the above areas and may include other content. The number of words you write for each section will depend on the legislation or area of law you are examining. An example – If my assignment is focussing on the area of guardianship the areas I might focus on in my assignment include: ● The key principles and mechanisms in the Guardianship and Administration Act 2019 as well as connections to other relevant legislation eg. Power of Attorney Act. ● What reforms led to the current legislation (eg. CRPD required much greater focus on supported decision making) and what calls are there for future reform) ● What this means for social workers working in areas where Guardianship is important and/or their clients/consumers. Critical Reflection Your paper should demonstrate critical reflection on the issues surrounding the legislation and/or broader legal context of the area you have examined, and not be just a description of the legislation or area of law. References Your assignment should include references to the legislation you are examining and to other relevant readings, resources, materials. The number of references you need to include will depend very much on what particular area and aspect of the law/ legislation you are examining so we are not prescribing a certain number of references. However, as this assignment is asking you to look in some detail at a particular piece of legislation or area of law it is likely that you will need to include considerably more than one or two references if you are to dowell in the assignment! Given the word count for the paper, in relation to legislation please don’t directly quote large sections of legislation- rather refer to the relevant section and summarise in your own words (unless of course there is a particularly relevant section to quote directly). You should reference using the APA style. If you are unsure there is a guide to referencing styles you can access through the library website. When referring to specific sections of legislation it is permissible to refer to the Act and the particular section in the text of your assignment (eg. Section 10 of the Family Law Act 1975 (Cth) refers to…..). With references to legislation please note whether it is Commonwealth legislation or name the state (eg. (Vic) after a reference to Victorian legislation). Marking criteria The assignment is worth 30 marks and 30% or your final mark for Legal and Ethical Contexts of Practice- see further information in the rubric on CANVAS. The criteria on which the assignments will be graded are: Excellent Good- Very Good Satisfactory Poor Demonstrates knowledge of a specific area of law or legislation relevant to social work practice. (9 marks) 7.5-9 6-7 4.5-5.5 0-4 Identifies key drivers of change in the area of law/ legislation and likely future reforms. (9 marks) 7.5-9 6-7 4.5-5.5 0-4 Demonstrates capacity to identify and understand the impact of the area of law/ legislation on social work practice. (9 marks) 7.5-9 6-7 4.5-5.5 0-4 Overall presentation, structure, clarity, referencing , etc. (3 marks) 2.5-3 2 1.5 0-1
BIOS5001 / PUBH6001 Introduction to Biostatistics 2024 – 2025 (Term 1) Assignment 3 1. (viral.sav) The SPSS dataset viral.sav contains 6 variables measured on 24 HIV positive subjects: Age = age of patient in years Risk = 1 if patients risk factor was MSM or 2 if risk factor was heterosexual Days = days from symptom onset until blood sample was taken CD4 = CD4 cell count in 106 per liter Viral = Blood viral load Lgviral = Log10(viral load) Your goal is to find the best linear regression model for predicting blood viral load (outcome variable), in terms of either Viral or Lgviral , using the other 4 variables as potential predictors. (a) From the six scatterplots of the two potential outcome variables vs. the three quantitative predictor variables, decide which of the outcome variables (Viral or Lgviral) would be more appropriate for linear regression analysis (6 marks). Based on what characteristic of the scatterplots did you make the choice (10 marks)? (b) Use backward elimination to determine a model for predicting the blood viral load of a future patient and show the “Coefficients” table in the SPSS/PSPP output (10 marks). Write down the equation of your final model (8 marks). (c) From your final model in (b), what would be the fitted value (8 marks) and residual (8 marks) for the first subject in the data set who was 28 years old, had a CD4 count of 361, had 24 days between onset of symptoms and sampling and had the “MSM” risk factor, given the observed blood viral load is 186208.71, or equivalently log10 of observed blood viral load is 5.27? (Please write down the calculation steps.) 2. (disease.sav) The SPSS dataset disease.sav contains 3 variables and 200 cases suffering from Disease A. status = 1 meaning the patient died and = 0 survived agemid = midpoint of the age group to which the patient belonged gender = 0 for females and 1 for males (a) Please conduct a simple (univariate) logistic regression, with status as the outcome variable and gender as the predictor variable (female as reference level) and show the “Variables in the Equation” table in the SPSS/PSPP output (10 marks). What is the odds ratio (males:females) for mortality (4 marks)? Is there a statistically significant difference in mortality between males and females (please explain using the p-value from your output) (6 marks)? (b) Please conduct a multiple logistic regression with status as the outcome variable and both gender (female as reference level) and agemid as predictors and show the “Variables in the Equation” table in the SPSS/PSPP output (10 marks). What is the adjusted odds ratio (males:females) for mortality (4 marks)? Is the difference in mortality between males and females statistically significant adjusted for other variables in the model (please explain using the p-value from your output) (6 marks)? How would you explain the change in the coefficient of gender between the two models (10 marks)?
Programming Assignment - Extra Credit CS211: Fall 2024 Programs must run on iLab machines, and your code must strictly follow input-output guidelines in each section. Please see the CS department’s academic integrity policy at: http://nbacademicintegrity. rutgers.edu Circuit Description One of the inputs to your program will be a circuit description file that will describe a circuit using various directives. We will now describe the various directives. The input variables used in the circuit are provided using the INPUTVAR directive. The INPUTVAR directive is followed by the number of input variables and the names of the input variables. All the input variables will be named with capitalized identifiers. An identifier consists of at least one character (A-Z) followed by a series of zero or many characters (A-Z) or digits (0-9). For example, some identifiers are IN1 and IN2. An example specification of the inputs for a circuit with two input variables: IN1, IN2 is as follows: INPUTVAR 2 IN1 IN2 The outputs produced by the circuit is specified using the OUTPUTVAR directive. The OUTPUTVAR directive is followed by the number of outputs and the names of the outputs. An example specification of the circuit with two outputs OUT1 and OUT2 is as follows: OUTPUTVAR 2 OUT1 OUT2 The output values produced by the circuit is specified using the OUTPUTVAL directive. The OUTPUTVAL directive describes the output values of the circuit each on its own subsequent line. Each line begins with the name of the OUTPUTVAR followed by the values {0, 1} of the variable for each permutation of the input. OUTPUTVAL will be followed by the same number of lines as their are variables as described in OUTPUTVAR and they will be described in the same order. An example specification for the OUTPUTVAL directive with the OUTPUTVAR described above is as follows: OUTPUTVAL OUT1 0 0 0 1 OUT2 1 0 1 0 In this example, we can deduce that there are 2 inputs. As the input is binary, there are 4 permutations of these inputs {0, 0}, {0, 1}, {1, 0}, and {1, 1}. For these permutations, OUT1 has the values 0, 0, 0, 1 and OUT2 has the values 1, 0, 1, 0, respectively. The order of these permutations will be detailed later. Logic gates are the basic building blocks of digital systems and circuits. A circuit is one or more logic gates creating a logical relationship between the input and output. The circuits used in this assignment will be using the following building blocks: OR, AND, XOR, NOT, DECODER, and MULTIPLEXER. The specifications of each building block is as follows: • OR: This directive represents the or gate in logic design. The directive is followed by the names of the two inputs and the name of the output. An example circuit for an OR gate (OUT1 = IN1 + IN2) is as follows: OR IN1 IN2 OUT1 • AND: This directive represents the and gate in logic design. The directive is followed by the names of the two inputs and the name of the output. An example circuit for an AND gate (OUT1 = IN1.IN2) is as follows: AND IN1 IN2 OUT1 • XOR: This directive represents the xor gate in logic design. The directive is followed by the names of the two inputs and the name of the output. An example circuit for an XOR gate (OUT1 = IN1 ⊕IN2 ) is as follows: XOR IN1 IN2 OUT1 • NOT: This directive represents the not gate in logic design. The directive is followed by the name of the input and the name of the output. An example circuit for a NOT gate (OUT1 = TN1) is as follows: NOT IN1 OUT1 • DECODER: This directive represents the decoder in logic design. The directive is followed by the number of inputs, names of the inputs, and the names of the outputs. An example decoder with two inputs IN1 and IN2 is specified as follows: DECODER 2 IN1 IN2 OUT1 DUT2 OUT3 OUT4 Here, OUT1 represents the IN1 · IN2 output of the decoder, OUT2 represents the TN1.IN2 output of the decoder, OUT3 represents the IN1.IN2 output of the decoder, OUI4 represents the IN1. IN2 output of the decoder. Note that the outputs of the decoder (i.e., OUT1, OUT2, OUT3, and OUT4) are based on unsigned binary value. They will be in gray code sequence beginning in the second part of this assignment. • Multiplexer: This directive represents the multiplexer in logic design. The directive is followed by the number of inputs, names of the inputs, names of the selectors, and the name of the output. An example of a 4 : 1 multiplexer is specified as follows: MULTIPLEXER 40010 IN1 IN2 OUT1 The above description states that there are 4 inputs to the multiplexer. The four inputs to the multiplexer are 0010 respectively. The two selector input signals are IN1 and IN2. The name of the output is DUT1. Describing Circuits Using These Directives Describing Circuits Using These Directives It is possible to describe any combinational circuit using the above set of directives. For example, the circuit OUT1 = IN1.IN2 + IN1. IN3 can be described as follows: INPUTVAR 3 IN1 TN2 IN3 OUTPUTVAR 1 OUT1 OUTPUTVAL OUT1 0 0 0 0 0 0 1 1 1 1 AND IN1 IN2 teap1 AND IN1 IN3 temp2 OR temp1 temp2 OUT1 Note that OUT1 is the output variable. IN1, IN2, and IN3 are input variables. Here, teap 1 and temp2 are temporary variables. In the assignment, some gates will be described as unknown or variable gates. They will always be named in the format Gnmx1 , x2 , . . . xm where n and m are both integers, n will always be the number of the variable gate in which it appears in the input i.e. starting at 1 and incrementing by 1 per variable gate. Here, m will be the number of variables, including inputs and outputs, for the gate. Lastly 1 , 2 , . . . m will be the name of the variables of the gate. Here is an example of this: INPUTVAR 2 IN1 TH2 OUTPUTVAR 1 OUTI OUTPUTVAL . OUT1 0 0 1 1 G1 2 IN1 temp1 AND IN1 IN2 temp2 MULTIPLEXER 4 1 1 1 0 0 temp2 temp1 OUT1 As seen above, a circuit description is a sequence of directives. G1 is an unknown gate which seemingly takes one input IN1 and output temp1. If every temporary variable occurs as an output variable in the sequence before occurring as an input variable, we say that the circuit description is sorted. You can assume that the circuit description files will all be sorted. Note: A temporary variable can occur as an output variable in at most one directive. Part I: Circuit Completer You will have to write a program that will complete a circuit by choosing the gates that fill the circuit and fulfill the constraints. In this section, input permutations and the ordering for decoders and multiplexers will be in standard binary order. In this section, we will choose gates based on a DFS strategy where each gate will be temporarily designated as a logic gate, chosen in the order of the gates (OR, AND, XOR, NOT, DECODER, MULTIPLEXER). Using this strategy, circuits with multiple solutions should still return one solution with the gates chosen in the DFS fashion. For example, say that the circuit description file contains the following: INPUTVAR 3 IN1 IN2 IN3 OUTPUTVAR 1 Out1 OUTPUTVAL Out1 0 1 1 1 0 1 0 0 AND IN1 IN2 temp1 G1 3 IN3 IN2 temp2 G2 2 temp1 temp3 OR temp2 IN2 temp4 AND temp3 temp4 Out1 The circuit described by these directives is shown visually in Figure 1. G1 will first be designated as an OR gate then G2 will be designated as an OR gate. If the output of the circuit matches OUTPUTVAL then the output will be two OR gates. If they do not match, then G2 will be sequentially designated as the other gates until a match is found. If no match is found then G1 will be designated as an AND gate. G2 will be reset to an OR gate and the algorithm will repeat. Input format: Your program will take the file name as input. The file will contain the description of a circuit using the directives described above. Output format: Your output will be the name of the variable gate followed by its assigned type, listed one per line, that complete the circuit. The gates must be in the same order as they were given. If no permutations of logic gates can fulfill the circuit then the program must print: INVALID. For the example in Figure 1, the output would be; G1 OR G2 NOT Part II: Circuit Completer for Gray Code Inputs For this section, you will have to write a program that will complete a circuit by choosing the gates that fill the circuit and fulfill the constraints as in the first part. However, in this section input permutations and the ordering of multiplexer and decoders will be in Gray Code. We will use Reflective Gray Code to create the permutations. You must still use the DFS methodology for choosing gates as in the first part. An example of a multiplexer utilizing grey code ordering is visualized in Figure 2. Input format: Your program will take the file name as input. The file will contain the description of a circuit using the directives described above. Output format: Your output will be the name of the variable gate followed by its assigned type, listed one per line, that complete the circuit. The gates must be in the same order as they were given. If no permutations of logic gates can fulfill the circuit then the program must print: INVALID. Part III - Circuit Reducer In this part, you have to determine whether a circuit can be reduced to fewer logic gates. For example, for the solution in Figure 1, G1 is an OR gate. This implies that part of the circuit is: IN2 OR (IN2 OR IN3) This can be simplified to simply IN2 OR IN3. This is an example of the Associative Law and a basic rule of Boolean Algebra where anything ORed with itself is equal to itself. We will simplify circuits based on 2 combinations of boolean algebra laws and basic rules of boolean algebra. They are listed below. • Associative law and OR rule: The Associativity rule states that when ORing more than two variables, the result is the same regardless of the grouping of the variables. Again, a basic rule of Boolean Algebra is that anything ORed with itself is equal to itself. Thus, a sequence of two OR gates with the same variable in both can be reduced to just one OR gate. An example of this is that the directives: OR IN1 IN2 temp1 OR IN1 temp1 temp2 can be reduced to OR IN1 IN2 temp2 For simplicity, we will only include cases such as this example where the pair of gates to be reduced will have the output of gate as the input to the other. • Distributivity rule: The distributivity rule is the factoring law. This states that a common variable can be factored from an expression just as in ordinary algebra. Thus, a sequence of two AND gates with the same variable in both followed by an OR gate can be reduced to just one AND and one OR gate. An example of this is that the directives: AND IN1 IN2 temp1 AND IN1 IN3 temp2 OR temp1 teap2 temp3 can be reduced to OR IN2 IN3 temp2 AND IN1 temp2 temp3 Another example of this is that the directives: OR IN1 IN2 temp1 OR IN1 IN3 temp2 AND temp1 teap2 temp3 can be reduced to AND IN2 IN3 temp2 OR IN1 teap2 temp3 As seen in the previous examples, when reducing gates, the resulting gates should output the variables used by the last-most gates, i.e. when reducing 2 gates that output temp1 and temp2 respectively, the output of the single reduced gate should be temp2. The input variables of the gates that resulted from a reduction should be sorted in lexicographical order. An example of these properties is given under the Output format section. In this section we will continue to use gray code ordering so your implementation for third should be used. Input format: Your program will take the file name as input. The file will contain the description of a circuit using the directives described above. The directives may still contain the variables gates as in first and second. Output format: Your output will be the list of reduced directives that represent the solved original circuit described in the imput. If no permutations of logic gates can fulfill the circuit then the program must print; INVALID. The reduced gates should take the place of the last-most gates that they replaced in the sequence. Namely, if two gates replaced three gates, the first new gate should take the place of the second original gate and the second new gate should take the place of the third original gate in the output sequence. For example, for the example in Figure 1 the reduced output would be INPUTVAR 3 IN1 IN2 IN3 OUTPUTVAR 1 Out1 OUTPUTVAL Out 1 0 1 1 1 1 1 0 1 0 0 AND IN1 IN2 temp1 NOT temp1 temp3 OR IN2 IN3 temp4 AND temp3 temp4 Out1 Rest of the programs are about data representations in C. Part IV: Conversion to Unsigned Binary Representation In this part, your task is to write a C program that prints the unsigned binary representation of a number with a specific number of bits. The argument to the program is an input file, whose format is described in the input format. If a given number is representable with a given number of bits (w), then you should print the binary representation of the number. Otherwise, you print the binary representation of the remainder when divided by 2w . Input-Output format: Your program will take one file name as its command-line input. Each line in the input file will have two positive integers separated by a space: an integer that you want to represent in binary and the number of bits to use for the representation. For each line in the input, you should print out the binary representation of the number followed by a newline character. Example Execution: Let’s assume we have the following input file: input .txt 42 12 27 3 Then the result will be: $ ./first input .txt 000000101010 011 We will not give you improperly formatted files. You can assume all your input files will be in proper format, as stated above. Conversion to Two’s Complement Binary In this part, your task is to write a C program that prints the two’s complement binary representation of a number with a specific number of bits. The argument to the program is an input file, whose format is described in the input format. If a given number is not representable with a given number of bits because the number is greater than the largest positive value possible with the given number of bits, then you should print the representation for the largest positive value with the given number of bits in the two’s complement representation. If a given number is not representable with a given number of bits because it is smaller than the smallest negative value with the given number of bits, then you should print the representation for the smallest negative value with the given number of bits in the two’s complement representation. Input-Output format: Your program will take one file name as its command-line input. Each line in the input file will have two integers separated by a space: an integer that you want to represent in binary and the number of bits to use for the representation. For each line in the input, you should print out the binary representation of the number followed by a newline character. Example Execution: Let’s assume we have the following input file: input .txt 427 7 164 5 -94 8 Then the result will be: $ ./first input .txt 0101010 0111 1000 We will not give you improperly formatted files. You can assume all your input files will be in proper format, as stated above. Part V: Effect of Signed/Unsigned Casts In this part, your task is to write a C program that prints the value of the number when it is cast from an unsigned number to a signed number and vice-versa. The argument to the program is an input file, whose format is described in the input format. Input-Output format: Your program will take one file name as its command-line input. Each line in the input file will have two integers and two characters separated by a space: an integer that is being represented, the number of bits to use for the representation, the source representation, and the destination representation. Here, u represents unsigned representation and s represents signed representation. For each line in the input, you should print out the value of the number (in decimal) in the destination representation followed by a newline character. You can assume that the unsigned value of the number is representable with the given number of bits. Example Execution: Let’s assume we have the following input file: input .txt 7 3 u s -2 4 s u Then the result will be: $ ./first input .txt -1 14 We will not give you improperly formatted files. You can assume all your input files will be in proper format, as stated above. Part VI: Decimal Fraction to Canonical Binary Fraction You will write a program to convert a decimal fraction to a binary fraction in the canonical representation (i.e. (−1)* × M × 2E ). For this program, M lies between [1, 2). You do not have to perform. any rounding for this part. You are required to print as many digits after the decimal point as specified by the input. Input-Output format: Your program will take one file name as its command-line input. Each line in the input file will have a decimal fraction (use a double type to read it) and the number of bits to show in the canonical binary representation separated by a space. For each line in the input, you should print the M value and E value in the canonical representation separated by space. Add a newline character after printing the output for each input. Example Execution: Let’s assume we have the following input file: input .txt 6.25 3 12.53 4 Then the result will be: $ ./first input .txt 1.1001002 1.1003 We will not give you improperly formatted files. You can assume all your input files will be in proper format, as stated above. Further, we will provide only positive fractions for this part of the assignment (i.e., no negative numbers). Part VII: Decimal to IEEE-FP with Rounding Your task is to write a program to convert a decimal fraction to IEEE-754 FP representation in a given configuration with rounding to the nearest with ties-to-even rounding mode. Input-Output format: Your program will take one file name as its command-line input. Each line in the input file will have a decimal fraction (use a double type to read it), the number of bits (n) in the IEEE-754 FP representation, the number of bits for the exponent, and the number of fraction bits. These numbers on a given line are separated by a space. For each line in the input, you should print the IEEE-754 representation with n-bits followed by a newline character. Example Execution: Let’s assume we have the following input file: input .txt 6.5843 8 4 4 0.0546875 8 3 3 Then the result will be: $ ./first input .txt 01001101 00010110 We will not give you improperly formatted files. You can assume all your input files will be in proper format, as stated above. You can assume that input will not have NaNs and any value will not round up or down to infinities. Part VIII: Hexadecimal Bit-pattern in the IEEE-FP Format to Decimal Fraction Your task is to write a program that takes a hexadecimal bit-pattern and prints the decimal fractional value of the number. Input-Output format: Your program will take one file name as its command-line input. Each line in the input file will have the total number of bits, the number of bits for the exponent, the number of bits for the fraction, the hexadecimal bit-pattern, and the number of precision bits after the decimal point in the decimal fraction. These numbers on a given line are separated by a space. For each line in the input, you should print out the decimal fraction value with the specified number of precision bits followed by a new line. Example Execution: Let’s assume we have the following input file: input .txt 8 4 3 0x4d 2 8 4 3 0x16 7 Then the result will be: $ ./first input .txt 6.50 0.0546875 We will not give you improperly formatted files. You can assume all your input files will be in proper format, as stated above.
CEG8419: Individual Report (2) This is the brief for the 2nd piece of individual coursework for CEG8419. This assessment focus on the use and application of GIS within the context of transport. This assessment is worth 40% of the final module mark. Part 1: Output from the Network Analysis GIS practical (30%) Include a suitable map of an analysis output from the Network Analysis practical (full instructions in practical handout). Think about the how you can best present the output (map of travel time from Newcastle Airport), in terms of the use of colour and making sure the map is easy to understand. You should consider the use of symbology, scale, and an appropriate legend in your map. Part 2: An essay on how GIS can be used in transport modelling (70%) GIS is a powerful tool with many options for analysis for transport applications, alongside capabilities for visualising data that can help with transport planning and policy. Undertake some research to explore the role and application of GIS in transport planning processes, either in the UK or elsewhere in the world. You should consider the kind of applications within transport, the datasets that can assist with transport analysis in GIS, and the types of analysis undertaken in the examples you find. Write a short essay, max 1,500 words, which explores your findings and discusses the role GIS tools can play in the transport sector. Submission Details: Submit your assignment as a single A4 PDF document Ensure the essay is well-organised and professionally written with appropriate referencing, formatting, and figures. Submission deadline: 22nd November, 2024 Expected return of individual feedback (via CANVAS) and marks by 20th December Assessment Criteria: Your assignment will be assessed based on the following criteria: Part 1 Analysis results in the map are understandable and clear Good use of colour and appropriate symbology Appropriate metadata is included on the map for a reader (e.g. data sources and copyright). Part 2 Good evidence of research being undertaken into different uses of GIS (e.g. a range of difference sources/references) A range of examples of how GIS has been used in the transport context are given and are clear and easy to follow. A clear understanding of GIS and underlying data is shown throughout. It’s well written, easy to follow and well-structured with a good use of English throughout
Assignment 1 EMATM0061: Statistical Computing and Empirical Methods, Data Science MSc Teaching Block 1, 2024 Before starting the assignment it is recommended that you first watch video lectures 2 and 3. You don’t need to hand in this assignment. 1 Create a data frame First open RStudio. Step 1. Within RStudio, find the Console window. In the Console, write a command to create a vector called animals which contains the names of a few animals. What type of vector is this? Your vector might look something like this: ## [1] "Snake" "Ostrich" "Cat" "Spider" Step 2. Create a vector of the same length called num legs which gives the number of legs of the different animals. Your second vector will look something like this: ## [1] 0 2 4 8 Step 3. Now combine these two vectors in a data frame. called animals df which has two columns - one with the names of animals, and another with their respective numbers of legs. The result should look something like this: ## animals num_legs ## 1 Snake 0 ## 2 Ostrich 2 ## 3 Cat 4 ## 4 Spider 8 Step 4. Check the Environment window and find out what objects (variables) are available. You should be able to find objects called animals, num legs, and animals df. Can you find the data type of these objects there? The functions required by the tasks above can be found in the example below. city_name Save and giving the file a name of your choice eg. “myFirstRScript” . Step 2. Now you can start writing codes in the script. Create a data frame. animals df, using the same code you did in Question 1 Step 3. You can run all the code within your script. by clicking on the “Source” button on the top right (alternative click Code -> Source). Step 4. Get a list of objects in the working environment. Is the list the same as what you got in Question 2 Step 1? 4 Create a data frame in R Markdown Let’s create an R markdown with html output as follows: File -> New File -> R Markdown . . . You can then choose: • A title for your document; • An author name (for example your name); • An output format. Let’s choose HTML. Then click “OK” to create an R markdown. This will create a template project. Explore the project and note its key features: 1. There is a block of YAML header at the start of the document which gives key information eg. title and output format. 2. You can create headings of sections with “#” . Similarly, headings of subsections can be created with “##” and so on. 3. You can embed blocks of R code by using ``` {r} before the R code and ``` afterwards. 4. By default both the code and its output are displayed. If you only want to include the output but not the code itself include the option echo = FALSE in the code prefix. If you don’t want to include either then include the option include = FALSE. 5. You can include hyperlinks by writing . Save your R markdown file as “MyFirstRMarkdown” . Remove everything in your R mark- down except for the YAML section at the top with the title, author, date, and output. Then do the following steps. Step 1. Insert a block of R code. In this block of code, create a data frame. animals df, using the same code you did in Question 1. In R Markdown, a block of code starts with ``` {r} and ends with ``` Step 2. Insert another block of code to print animals df. Step 3. You can then generate an HTML file with the “Knit” button just above your scripting window. Check what you have in the HTML file. 5 Matrix operations Use the seq() function to generate a sequence of numbers starting at 12 and decreasing to 2 in steps of -2. Call this vector x vect. You may want to run ?seq or help(seq) to help you do this. The vector x vect should look like this: ## [1] 12 10 8 6 4 2 Now convert the vector x vect into a matrix (with 2 rows and 3 coloumns) called X, using the matrix() function. The result should look like this: ## [,1] [,2] [,3] ## [1,] 12 8 4 ## [2,] 10 6 2 Next create a 2 by 2 matrix called Y consisting of a sequence of four numbers from 1-4. The matrix Y should look like this: ## [,1] [,2] ## [1,] 1 3 ## [2,] 2 4 In addition, create another 2 by 2 matrix called Z which looks as follows: ## [,1] [,2] ## [1,] 4 8 ## [2,] 6 10 Recall that for 2 by 2 matrices A, the transpose AT is given by Use the t() function to compute YT and ZT . Matrix sums. Now compute the matrix sums Y + Z and Y + Z. The result in both cases should be the same. We call such operations commutative. This means that reversing the order does not change the result. Matrix multiplication. Use R to compute the matrix products YZ and ZY. Are the results the same in both cases? Is matrix multiplication commutative? Recall that the matrix multiplication between two 2 by 2 matrices A and B, is defined as In addition, use R to compute the matrix product YX . You should get something like this: ## [,1] [,2] [,3] ## [1,] 42 26 10 ## [2,] 64 40 16 What happens if you attempt to compute the matrix product XY? Explain the error message you get. Matrix element-wise multiplication. Use R to compute the element-wise matrix products Y Θ Z and Y Θ Z. Are the results the same in both cases? Is element-wise multiplication commutative? Recall that the element-wise matrix multiplication between A and B is defined as Matrix inverse. Compute the matrix inverse Y −1 via the solve() function: solve(Y) You should get something like this ## [,1] [,2] ## [1,] -2 1.5 ## [2,] 1 -0.5 Next, check what you get from computing Y −1Y in R. Now compute Y −1X . Your result should look like this: ## [,1] [,2] [,3] ## [1,] -9 -7 -5 ## [2,] 7 5 3 Can you do this (obtain the results of Y−1X) without first computing Y −1? Try running the help command on the solve() function by typing ?solve into the R console to find out how to do this. 6 Writing a function within R First, create an R script. (see also Question 3), and saving it using the name mySecondRScript. To do the following steps, it is good to know how a function is defined in R as well as basic control flow statements in R (e.g., if . . .else . . ., and for). You may want to first look at the sample function called is prime (provided at the end of this question) for function definition and control flow statements, before you continue. Step 1. Within your script. create a short function called myFirstRFunc which takes in a single numerical argument n and outputs the sum of all those numbers strictly below n which are divisible by either 2 or 7 or both. For example, if n = 14 then it should be the sum of 2, 4, 6, 7, 8, 10, 12, so myFirstRFunc applied to 14 gives the answer 2 + 4 + 6 + 7 + 8 + 10 + 12 = 49. Make sure your function includes useful comments. You may want to include a check so that your function produces an error if it is given an argument which isn’t a non-negative integer. Step 2. Run the script. by clicking on the “Source” button on the top right. Then check what you get if you apply the function to 1000, i.e., myFirstRFunc(1000) If you have been successful your function should produce the following output. ## [1] 284787 How to write a function in R? An example. is_prime =0) # Stop if the input is not a non-negative integer t_val Git – Below “Repository URL:” Paste the repository url which you copied from your git repo. (if you have chosen your project to be private, you may be asked to input your account details. Follow the instructions to gain access). – Below “Project directory name:” Choose a directory name. – Below “Create project as a subdirectory of:” Choose where to store your project on your local machine. – Check the box marked “Open in new session” . – Click create project. You have now created an R project with version control! 8.3 Committing and pushing Within your new project click File -> New File -> R Script. Type some R code in your new R script. e.g. a Save before giving a name. commit. Next go to the git tab at the top right of your screen. Then click the “commit” button. On the left you will see a collection of check boxes. Here you can choose which files you want to add to your git repo. I suggest for now you check all of the files. Write a commit message in the “Commit message” box eg. “This is my first commit” . It’s good practice to always include a commit message. Click the commit button. You should see a message which describes your changes. Commits act as a “snapshot” which records the current state of your repository. push. You have now taken a local “snapshot” of your repository by performing a “commit” . Next you want to record this snapshot on the central repository. This is done by performing a “Push” . All you have to do is press the green “Push” button within the git panel in RStudio. You may be asked to enter your password or personal access tokens (you can create your token if needed https://github.com/settings/tokens). You typically only have to do this once. Now check that your push has been successful. Go back to https://github.com/ and log into your account if you are not already logged in. Go to the repositories section and click on the name of the repository you created in the previous stage of this assignment. You should see a record of your most recent commit. Additionally, you may want to move your previous R script. entitled “myFirstRScript” (from Question 3) into this project. You can then “commit” and “push” to upload your script. to your git account.
ECE 2560 Intro to Microcontroller-Based Systems Autumn 2024 Midterm #2 Due: Wednesday, November 20 – by 4:10 PM (Before Class) Submission: Media Recording and File Uploads to Carmen This assignment is individual work. You are not allowed to copy the work of others including AI. Part 1: Coding task You will write a program with interrupts that implements a simpler version of the Simon game – with only two colors, only one light at a time, and no sound. The game: One of the LEDs turns on and the player must press the push button adjacent to the LED (i.e., S1 for red, S2 for green). If the player presses the correct button, the game continues, another LED turns on etc. etc. If the player presses the incorrect button, the game is over as indicated by three blinks of the red LED. Afterwards, the green LED blinks the score of the game. If the player got zero correct, there is no green blink. If the player got one correct, there is one green blink; two correct, two green blinks etc. The game resets thereafter and starts over. (The player can play as long as they continue to press the correct button. The score will overflow and roll back to zero at 65535.) Please watch the short video posted to Carmen to see how the game works. The coding: Start by downloading the file midterm_2.asm from Carmen. It has the play sequence, constant definitions, and some helper subroutines. The play_sqn array is a byte array with 32 entries where a 0 indicates GREEN and a 1 indicates RED. You will use following symbolic constant definitions when checking for the values 0 and 1 Each game starts at the beginning of the play_sqnc array (i.e., the first element with index 0) and continuously loops through the array, i.e., after the last element is played, it goes back to the first element. Define a global variable in RAM to keep track of the current state of the game. You can call this variable state or index. Each game starts with state=0. The game flow depends on the value of the elements in play_sqnc. If the current element is RED the red LED is turned on, if it is GREEN the green LED. The player is expected to press the button that is adjacent to the powered LED, i.e., S1 if the red LED is on, S2 if it is the green LED. If the player presses the correct button, the player scores a point and the game continues. Define another global variable in RAM to keep track of the score. You can call this variable score. Each game starts with score=0. You will write following parts of code. My recommendation would be to write the modules in the given order. Test each module, make sure it works correctly before moving on to the next one. • The main loop configures input and output and starts the game by calling the subroutine reset_game. This part is very straightforward. Check the solution to Quiz 7 if you need help with configuring the LEDs and pushbuttons. • A subroutine called reset_game that resets the state and score, and starts the game, i.e., turns on the LEDs based on the first entry in the play_sqnc. Both the logic and coding for this subroutine are straightforward (~12 lines of instructions). • A subroutine called game_over that makes the red LED blink three times. Both coding and logic are straightforward. For example: turn all LEDs off. Call delay. Toggle red LED. Call delay. Repeat 6 times. The subroutine delay is given in the asm file. (My code is ~10 lines of instructions.) • A subroutine called blink_score that makes the green LED blink the score. You can start with the previous subroutine (game_over), change the LED (green instead of red) and add logic to make the number of blinks variable (instead of always three). There should be no blinks if the score is zero. This subroutine is not difficult, make sure to start with the correct logic and implement it in a tangle-free way. (My code is ~10 lines of instructions.) • An interrupt service routine called the game_master. Every time the player presses one of the buttons, the game_master will run and manage the game. It will check whether the correct button was pressed. If the correct button is pressed it will prepare the next LED. If the incorrect button is pressed it will end the game and reset. This is the juiciest module. My code is ~32 lines of instructions. It is not difficult, but you need to have a good understanding of the game and a good plan. And some time. • Finally, expand the IVT so that the game_master will run every time S1 or S2 is pressed by the player. Keep in mind that ISRs and any subroutines called from an ISR are not allowed to modify any core registers. The game_master and the subroutines are allowed to modify the global variables you have created in RAM. Be mindful of how your program uses resources; minimize RAM usage (you do not need more than two 16-bit variables) and code size (no spaghetti please). Add good comments that describe the way the code works. Once you have written and tested your program, you are ready for submission. Part 2: Submission – Media Recording, PDF and text files uploaded to Carmen Media Recording: Take a short video of yourself and your program in action. Demonstrate a play with zero score, followed by plays of two different scores. Keep the video short. Carmen will do the recording, do not forget to press the submit button! PDF File: Screenshot of your code Take a screenshot of your main program (including variable definitions), your ISR, your subroutines, and your interrupt vectors and submit these screenshots in a PDF file. Text File: Your source code Save the final version of your source code as txt file so it can be read in Carmen, and make sure that both files reflect your name, e.g., firstname_lastname.txt or name_number.txt. Make sure to submit the correct source code in the correct format – no word or PDF files for source codes. I will randomly select and run source code files throughout the semester. If your source code file is missing, does not compile, or does not produce the results you demonstrate in your video you will receive zero points for the assignments – end of story.
FV3001 Assignment Brief (2024 - 2025) The workshall be typed or word-processed in your own words. The deadline for submission is 11:59 p.m. (HKT) on 2nd December 2024. Learning Outcomes This piece of assessment will test student’s ability to meet learning outcomes as described hereunder: - 1. Apply the relevant principles and techniques of chemistry, physics, maths to the study of enclosure fire dynamics; (Learning Outcome 1) 2. Critically review and quantify the impact of fire on people / the human body; (Learning Outcome 2) and 3. Critically review the principles of modelling. (Learning Outcome 3) Assignment Details Students are required to answer all questions. The assignment will carry 40% weighting of the total mark for this module. Question 1 to Question 5 is designed by Ir Dr William Yan. Question 6 to Question 9 is designed by Mr Evan Wong. Submission Details (1) The deadline for submission is 11:59 p.m. (HKT) on 2nd December 2024. Late submission will be dealt with strictly in accordance with UCLan Regulations. (2) No hard copy is required to be submitted to the SCOPE counter. This assignment should be submitted through Turnitin to CityU SCOPE CANVAS assignment submission folder. (3) In-text citations and referenced publications shall be added to the answer to each question. (4) Using AI-generated text to complete your assignment is prohibited. Citation of Harvard style. shall be used for all quoted references. UCLan regards any use of unfair means in an attempt to enhance performance or to influence the standard of award obtained as a serious academic and/or disciplinary offence. (5) Submission of written assignment shall be type-written in .pdf or .docx format. The file name of your submission shall follow the format as the example below: FV3001_CHAN Tai Man_G12345678 (6) Students should do whatever means to make sure the files are duly submitted via the CANVAS system and check whether the work is successfully uploaded (by downloading the file from CANVAS again). All claims on technical problem without strong evidence for unsuccessful uploading shall not be accepted. (7) It should be the students’ responsibility to double-check the readability (pdf or docx format) of the submitted files. (8) Administration team will not remove or replace student’s submitted assignment in CANVAS or help students to upload the soft copy of his/her assignments to CANVAS. Marking Criteria The Assignment will be marked according to the marking criteria as appended below. • Question number and page number are provided • Answers are clear, logical, structural and coherent • Analysis is step-by-step justified • Correct equations (if any) are used • Abbreviations (if any) are elaborated • Calculations (if any) are accurate Assessment Criteria Weight (%) Calculation 40% Knowledge 20% Analysis 20% Structure 20% FV3001 Fire Dynamics – Assignment (Q1) Please explain how the Hong Kong FS Code (Code of Practice for Fire Safety in Building 2011) considers the tenability for the occupants suffering fire in the computational fluid dynamic (CFD) models when fire engineering design approach is adopted. Please also explain how these tenability criteria impact on the human body. (Q2) A compartment with the following data is subjected to a fire. The compartment located in remote area is designed as office usage. The following information is given: • Automatic smoke alarm is provided; • No independent water supplies are provided; • No firefighting devices are provided; • The office is made of concrete, ρ=2500kg/m3 ; cp=980J/kgK; k=1.5W/mK; • There are two ventilation openings on the walls. The dimensions (breadth x height) are 3.6mx 1.5mfor Opening 1 and 7.2mx 1.5m for Opening 2; • The breadth x length x height of the compartment is 7m x 14m x3m; • Use Annex E of the Eurocode 1(Part 1-2) to determine the fire load density (MJ/m2) incorporating appropriate factor of safety. Plot the temperature-time curve of the compartment fire for this office. (Q3) Discuss and compare the ‘standard temperature-time curve (ISO834)’ and the ‘parametric temperature-time curve (based on EN 1991-1-2)’ . Assume that you are a fire engineer for a design task of structural fire resistant design in a commercial building with several compartments. You are required to consider several fire scenarios in different fire compartments. How do you plan to incorporate both aforementioned fire curves in your work? (Q4) Assume that you are appointed as a fire engineer to adopt fire engineering design on a museum. There is a glorious exhibition hall with 42m inheight. This exhibition hall is specially designed with complicated configuration and irregular shape. The roof of the exhibition hall consists of steel trusses. They are considered to remove fire protection for the purpose of easy maintenance. Which kinds of numerical models may assist you in your design? Please briefly explain the reasons. (Hints: Smoke spread, occupant evacuation and structural fire resistance are recommended to consider.) (Q5) (a) Calculate the heat of combustion (kJ/mol) of methane (CH4) in gaseous state for complete combustion at 298K based on the given data on heat of formation in the following table. (b) Write down the chemical reaction for incomplete combustion of methane with CO and water as the only products and hence estimate related heat released per mole of ethane (gaseous state) consumed at 298K. (c) Discuss the errors for estimating possible heat released in real fire cases based on the results calculated in part (a) and (b). Source: Table 1.1 Glassman, I. and Yetter, R. A., 2008, Figure 4.3, Combustion 4th Edition, Chapter 4, Section B, Page 6, Academic Press (Q6) Analyse the effect of the heat transfer coefficient of wall and ceiling materials for compartment fire development based on sketches of Semenov Diagram. Hence, on basis of the Semenov Diagram, discuss the corresponding differences on the heat loss to external environment for same compartment size with same building materials: i) a standalone concrete office and ii) an office unit located at the interior of an air conditioned skyscraper. (Q7) (a) Find F1-2 for the configuration of two offset perpendicular squares of area A, as shown in the following diagram. (b) Consider two rectangular surface perpendicular to each other with a common edge that is 1.6m long. The horizontal surface is 0.8m wide and the vertical surface is 1.2m high. The horizontal surface has an emissivity of 0.75 and is maintained at 400K. The vertical surface is black and is maintained at 550K. The back sides of the surfaces are insulated. The surrounding surfaces are at 290K and can be considered to have an emissivity of 0.85. Determine the rate of radiation heat transfer between the horizontal surface and the surroundings. (Tips: the area projections that complete the surface area A3 of the enclosure) (Q8) Based on the equation used to calculate upper layer temperature as shown in the following: where ΔTg is the upper gas temperature rise above ambient, K; Q is the heat release rate of fire, kW g is the gravitational acceleration, 9.81 m/s2 cp is the specific heat capacity of air, 1 kJ/(kg K) ρ∞ is the density of air, 1.18 kg/m3 T∞ is the ambient air temperature, 310 K Ao is the opening area, m2 Ho is the opening height, m AT is the totalarea of compartment enclosing surface, m2 hk is the heat transfer coefficient, 0.03 kW/m2K Calculate the upper-layer temperature of a room 3m x 3m in floor area and 2.4m high with a door opening 2m high and 2m wide. The fire source is a steady 800kW fire. Hence by the above equation, or otherwise, discuss the effect on fire engineering analysis if the ambient temperature is various in different seasons for identical room geometry and fire source. (Q9) Calculate the minimum fire size at floor level capable of activating fixed temperature heat detectors (rated at 70°C) in a large exhibition hall having the room height of 10 m high. Assume that the ceiling is flat and that the detectors are spaced at 5m centre to centre. Ambient temperature, T∞ = 20°C and g = 9.81 m/s2. Calculate fire sizes, Q, for each of the following locations:- (a) the fire is directly above the detector; (b) at the center of the enclosure; (c) close to one wall; (d) in a corner
Assignment 2 • Please accumulate your Excel sheets in one Excel file and submit it. Do not submit multiple Excel files or zipped version of them. 1. A company can produce four kinds of drugs, A,B and C. The following table shows the required labors and drugs to make each kind of drugs. The company has the total of 10,000 hours of monthly labor. Make an Excel file that can find the optimal production plan that maximizes the monthly revenue. (15 points) A B C A B C Labor (hour) 1 2 2 1 1 3 Price ($) 30 150 300 2. Use the network structure and unit cost information given in ‘2024-1 Final 3’ problem. Change the problem into ‘navigation’ problem and assume that you are going from Node 1 to Node 8. (a) Find the route that incurs the minimum cost. (10 points) (b) (Continued from (a)) Assume that at least one of Node 2 and 4 should be visited before you arrive at Node 8. Find the route that incurs the minimum cost. (5 points) (c) (Continued from (a)) Assume that at most one of Node 3 and 5 can be visited before you arrive at Node 8. Find the route that incurs the minimum cost. (5 points) 3. A company produces products at three plants. These products can be shipped directly to the company’s two markets or it can first be shipped to the company’s two warehouses and then to the markets. Nodes 1, 2 and 3 represent the plants, nodes 4, 5 and 6 represent the warehouses, and nodes 7 and 8 represent the markets. The production capacity of each plant is 300 (Node 1), 250 (Node 2) and 350 (Node 3). The demand of each market is 400 (Node 7) and 420 (Node 8). The table shows the shipping cost per unit for each arc. Origin Destination Cost 1 1 1 2 2 3 3 3 4 4 5 5 5 6 6 7 7 8 8 8 2 3 4 1 6 1 6 7 3 7 2 6 8 3 8 3 8 5 6 7 2 7 10 3 6 5 5 1 6 8 5 9 10 9 3 7 2 7 6 8 We also assume that at most 300 units of the product can be shipped between any two nodes. This is the common arc capacity. Assume that the demand in market 7 and 8 should be satisfied from the supply from plant 1, 2 and 3. Also assume all the production cost and the market prices across regions are the same and the company only needs to concern the shipping cost. (a) Determine a logistics plan to minimize the total shipping cost. (10 points) (b) (Continued from (a)) Assume that shrinkage occurs at Node 4. The shrinkage rate is 95%. Determine a logistics plan to minimize the total shipping cost. (5 points) (c) (Continued from (a)) Assume that shrinkage occurs on all the routes. The shrinkage rate is 98%. Hence, for example, if 100 units are shipped through 1 → 4 → 7 → 8, the units arrived at Node 8 will be 100 × (0.99)3 . Assume that the shipping cost is applied to average units before the shrinkage. For example, if 100 units are shipped from 1 to 2, the shipping cost of 100 × 2, not 100 × 2 × 0.99 will be occurred. Determine a logistics plan to minimize the total shipping cost. (5 points) 4. An airline company is planning to run several daily commuter flights to and from Chicago, Dallas and Atlanta. Each potential flight has an estimated (Revenue - Variable cost) as in the Table below. The company owns three airplanes. There is afixed cost of $5,000 per plane per day that flies any flights. However, a plane that is not used does not incur this fixed cost. Any plane that arrives in a city after its last flight of the day has two options. It can sit overnight in that city, or, at a cost of $3,000, it can be flown empty to another city overnight. The company’s objective is to maximize its profit per day. Develop a network model for scheduling the airline’s flights, given its available aircraft, to maximize net profit from the flights. (20 points) Origin Destination Depart Arrive Revenue - variable cost Chicago Chicago Chicago Chicago Dallas Dallas Dallas Dallas Atlanta Atlanta Atlanta Atlanta Dallas Dallas Atlanta Atlanta Chicago Chicago Atlanta Atlanta Chicago Chicago Dallas Dallas 6 12 9 15 9 18 9 15 9 6 12 15 9 15 12 18 12 21 12 18 12 9 15 18 16 13 25 12 8 15 20 21 19 21 21 10
Due Wednesday by 5pm Submitting a text entry box or a file upload Available after Nov 13 at 12am LW6108E International Finance: Law and Regulation A/Y 2024-25, Semester A City University of Hong KongSchool of Law Writing Assignment Question You are attached to the legal department of an Asian investment bank in Hong Kong. They are interested in the recent appeal decision of The Law Debenture Trust Corporation plc v Ukraine [2023] UKSC 11, on how the Supreme Court dealt with the appeal on the issues of (a) lack of capacity (b) authority (c) economic duress. Specifically, analyse critically for your colleagues whether English common law remains a suitable choice of law in light of the need of stability and certainty to ensure liquidity of the international financial markets. Instructions This writing assignment counts for 20% of the final grade. Submission is by CANVAS. Deadline is 5 pm on Wednesday, 20 November 2024. Use this naming convention: TA?_StudentID.docx. Hence if your student ID is 54321111 and you are in tutorial group TA3, name your document TA3_ 54321111.docx. Unless there are valid extenuating circumstances under the Academic Regulations, late submission of paper attracts the following penalty: deduction of 5 marks for every single day (including public holidays) of delay up to maximum 7 days. Papers received later than 7 days of the submission deadline will not be marked. The essay (including footnotes) must not exceed 2,000 words. The parts of the essay in excess of the word limit will not be read. Use the essay template available for download from CANVAS (See Files | Assignment (folder)). Your essay should adopt the following format: Font type and size: Times New Roman/Calibri/Cambria, font size 12 for main text, and font size 10 for footnotes; Line spacing: Double spacing for main text, and single spacing for footnotes; Use footnotes and not endnotes. References are important – for they indicate the source of the authority/proposition. If you are using a commentator’s views you must provide due acknowledgement. While citing authorities in footnotes, you must follow the Oxford Standard for Citation of Legal Authorities (2012)Links to an external site.. (Copy available in Assignment folder) A very stern view is taken of plagiarism. You are referred to the Rules of Academic Honesty and have been duly warned of the severe consequences that attend plagiarism. (Copy available in Assignment_Matters folder)
MU1112 Creative Composition Techniques ASSIGNMENT PACK (Term 1) Aims This course will: • introduce you to some of the fundamental techniques of contemporary classical music composition. Learning outcomes By the end of this course, you should be able to: • use and manipulate compositional techniques in your own creative work; • demonstrate the development of a coherent harmonic language and a critical attitude to rhythmic construction; • discuss and present ideas about some of the concepts and methodologies used in contemporary composition. Course content The course will cover some of the following topics: • Soundworlds and scale formations • The vertical dimension: chords and simultaneities • The horizontal dimension: melody and voice leading • Developments in rhythm • Developments in harmonic vocabulary and tonalities • Form. and material in contemporary composition • Acoustic timbre and texture The precise topics taught may change each year depending on the research interests of the staff responsible for teaching the course. Teaching & learning methods The course will be taught in fortnightly sessions during the autumn and spring terms totalling a maximum of 20 hours alongside some 130 hours of private study, resulting in the notional total of 150 hours of study for the course. The fortnightly sessions will divide into three areas: • Lectures, in which representative works will be used to explore compositional techniques and as potential models for your own creative ideas. Lectures will draw on a wide variety of mostly, but not exclusively, contemporary art music to illustrate the techniques being explored. • Small group tutorials, in which individual coursework will be discussed, to give in-depth help, advice and feedback. • Practical sessions drawing on instrumentalists and singers from the class (term 1), and a professional ensemble (term 2) Assessment overview Formative Assessment & Feedback Formative feedback will be given during small group tutorial sessions in which each piece of work to be submitted will be discussed with a course tutor. Workshops will include group discussions and question- and-answer sessions. Summative feedback will be given in the form. of a written comment and/or annotations on returned coursework. A weekly office hour is available for individual consultation with course tutors. Summative Assessment Exam: n/a Coursework: • Portfolio of composition technique exercises 1 (50%) • A composition for small chamber ensemble (50%) Assignment deadlines Submission details can be found on the Department of Music General Information Moodle page. Please note, these may not have been finalised at the start of term. You will be kept informed about how to submit your work. • Portfolio of composition technique exercises No. 1 (50%) To be submitted by 12.00pm on Wednesday, 4 December 2024 • A composition for small chamber ensemble (50%) To be submitted by 12.00pm on Thursday, 8 May 2025 You should upload ONE .PDF COPY of a completed portfolio to the Assignment page on Moodle containing the following assignments: 1. Cover Sheet 2. Portfolio of composition technique exercises (summative) 3. Appendix (optional; including sketches, workings out, etc.) MU1112 | Portfolio of compositional techniques No. 1 EXERCISE 1 Scale formations Complete these exercises using pencil and manuscript. paper rather than notation software. 1. Construct a scale of your own invention using only two or three different intervals: 2. Transpose the scale to create a new version by beginning on the second degree of your original scale: 3. Compose a short melody of 4-6 bars for the instrument assigned within your creative partnership, using your invented scale and its transposition: PLEASE NOTE: If this is a melody or line for a harmony instrument (e.g. piano, harp, guitar, etc.), this maybe the upper part such as the right-hand of the pianist. EXERCISE 2 The horizontal dimension Complete these exercises using pencil and manuscript. paper rather than notation software. Developing a cell To begin this part of the exercise … • Compose a three-note cell that has been inspired by your invented scale from Exercise 1: • Now create an inversion of this cell: • And now a mirror inversion (also known as a retrograde): • Finally, create a retrograde inversion: Next step … Using your original cell, the inversion, the retrograde and the retrograde inversion compose a second melody for the instrument assigned within your creative partnership. Make transpositions of the cells to create interest. This second melody should contrast your melody from exercise 1. Give your melody a clear shape and try to create contrast and interest. Don’t forget to use performance directions in your piece including tempo, dynamics, and articulation. EXERCISE 3 Developments in rhythm Complete these exercises using pencil and manuscript. paper rather than notation software. 1. Constructing rhythms using simple number patterns • Find or create a simple number pattern with around eight or nine numbers. • Using either a semiquaver or a quaver as the basic pulse, transform. the pattern into rhythmic durations. Don’t use time signatures or barlines at this stage: • Next, make a retrograde version of the rhythm: • Combine the original rhythm with the retrograde, one on top of the other, to make a two-part rhythmic passage: • Finally, choose a time signature for the two-part passage and write it out using barlines and the correct metric beaming: 2. Augmentation and diminution • Augment your original rhythm by extending all durations by the same proportion (a half or a third, for example), use a time signature and barlines: • Diminish the rhythm by decreasing all durations by the same proportion, use a time signature and barlines: EXERCISE 4 Chords and simultaneities Complete these exercises using either pencil and manuscript. paper or notation software. 1. Compose a harmonic piano accompaniment for the melody and countermelody you composed for the instrument assigned within your creative partnership, in exercises 1 and 2. Your countermelody may act as a response (or ‘answer’) to your initial melody, or you may wish to rewrite and combine them. You can create your own chords using your invented scale and its transposition: PLEASE NOTE: If this is an accompaniment for a harmony instrument (e.g. piano, harp, guitar, etc.), this maybe the lower part such as the left-hand of the pianist. And finally … 2. Using the exercises completed throughout exercises 1-4, finalise a short work of between 20-30 bars for the instrument assigned within your creative partnership. You should aim to include at least 2-3 of the exercises. Give your melody a clear shape and try to create contrast and interest. Don’t forget to use performance directions in your piece including tempo, dynamics, and articulation.
Assessments Handbook MGRC20007 Machine Learning for data-driven decision making 2024-25 – UG Unit Assessment Breakdown This unit uses two modes of assessment, explained in detail below: Mode % of unit mark Brief Description Length Group Assessment 30% 1,500-word report where students work in groups to solve a business problem using machine learning. They conduct initial data analysis, develop a preliminary model, and create a comprehensive group report. 1,500 words Individual Assessment 70% 2,000-word report that builds on the group preliminary work. Each student selects a specific aspect of the project to explore in more depth. This could involve refining the model, addressing limitations, or applying additional analytical techniques to improve the results. 2,000 words Assessment 1 – Group Project Link to Unit Learning Outcomes This assessment evaluates the following unit intended learning outcomes (ILO): • ILO1: Demonstrate an understanding of how decisions are made in organisations, how sustainable development influences business decision- making, and how business analytics can support decision-making. • ILO4: Work effectively in a team to develop data-driven recommendations with the potential for a positive impact in practice. Overview In the Group Assignment, students are divided into teams to tackle a data analytics project aimed at predicting customer churn for a bank. This assignment evaluates specific learning outcomes (ILO 1 and ILO 5) by focusing on how teams apply machine learning techniques to solve a real-world business problem and effectively communicate their findings. Each team member contributes to the collaborative process, from data exploration to model development, ensuring a comprehensive understanding of the project and its implications. Collaboratively, they conceptualise and implement the project, applying data mining techniques effectively. The deliverables for this assignment include: • Report (1,500 words): Each team crafts a report similar to a management consultancy document. It outlines the project strategy, encountered challenges, team reflections, and the outcomes achieved. Submission The group report will be submitted on Turnitin, and further details will be provided closer to the time. The due date for the group report and presentation will be 31st October 2024 13:00 GMT. Assessment Weight 30% of the total unit mark Assessment 2 – Individual Coursework Link to Unit Learning Outcomes This assessment covers the following unit learning objectives: • ILO2: Use mathematical tools to formulate decision-making problems, develop solutions, and provide recommendations based on analytics. • ILO3: Design and develop suitable predictive analytics solutions to business decision-making problems within the limits of time and resources available. • ILO4: Implement and evaluate a variety of predictive models and improve on their design to meet business needs and requirements. Assessment Instructions The purpose of this assessment is to assess your ability to independently apply and extend the machine learning concepts covered in this unit, specifically addressing ILOs 1 and 5. You are required to submit a 2,000-word report that builds on the group project by refining and enhancing the customer churn prediction model developed in the group work. Your report should demonstrate a deep understanding of the techniques used to improve the model, discuss the ethical considerations involved, and analyse how the refined model can be strategically applied within a real-world banking context. This assignment challenges you to critically evaluate the model effectiveness/accuracy, address potential biases, and propose actionable business insights based on your findings. We encourage the integration of theoretical knowledge with practical application, reflecting real-world business analytics challenges in an individual context. Assessment Weight 70% of the total unit mark Important information about the report The report should be 2,000 words (+/- 10%) in length. Please keep in mind the following points: • This is not an essay assignment. You should not describe or analyse theory and models in isolation. You will be assessed primarily on how you apply the concepts and models from this unit to a real analytics problem, evaluate its effectiveness, identify and recommend improvements that could be made. • However, you should include academic references where relevant e.g., the source of models used in your report, supporting data. Please note that you cannot cite the lecture slides! Any quotations from such sources should be properly referenced including page numbers using Harvard referencing style, with full details included in the references section. • It is recommended that your work should have between 10 to 20 references. Please use Harvard referencing throughout. • Throughout the report, you will need to focus on both the presentation and clarity of any models, diagrams and tables, as well as the quality of your analysis. Consider how to best present your work to make it look as professional as possible e.g., using a contents page. • Tables and Figures must be labelled with a caption, “Figure 1: Diagram of … .” etc. with the text referring to the Figure, or table, as Figure 1, etc. • Reading beyond the course materials is vital. • The use of graphs and diagrams to illustrate your analysis is strongly encouraged. • You are reminded that this assignment is about Business Analytics, not data science nor statistics. The mathematical justification and specific number of analyses you applied is not as important as your ability to conduct a clear analysis of the business implications of those data analytics technique. Report Structure Please note that the structure below is the recommended format for the assessment. Recommended Report Structure for the Individual Role-based Assignment 1. Title Page • Title of the report • Student ID (not your name) • Course title • Date of submission • Word count 2. Executive summary • A brief summary of the report purpose, key findings, and conclusions. 3. Introduction • Overview of the group project and the machine learning model developed. Which model did your group use and why? • Objectives of the report. • Brief introduction to the importance of customer churn prediction in the banking sector. Use references to support your arguments. 4. Model improvement • Detailed description of the enhancements made to the original model (e.g., hyperparameter tuning, feature engineering, cross-validation). • Justification for the chosen methods and techniques. • Discussion of the impact of these improvements on model performance, including any new metrics or validation results. 5. Ethical considerations • Analysis of potential biases in the model (e.g., gender, age, geography) and their implications. • Discussion on the ethical use of predictive models in banking, particularly in customer retention. • Proposed strategies to mitigate identified biases and ensure ethical application of the model. 6. Strategic application • Application of the refined model to a specific business scenario within the bank (e.g., targeting high-risk customers for retention or SMEs). • Analysis of how the model predictions can inform. strategic decisions. • Discussion of the potential business impact of these decisions, supported by data from the model. 7. Critical reflection • Personal reflection on the learning process and the challenges faced during the project. • Evaluation of the strengths and weaknesses of the model and the overall approach. • Suggestions for further improvements or alternative approaches. 8. Conclusion • Summary of key findings and insights from the report. • Reiteration of the importance of model refinement, ethical considerations, and strategic application in business analytics. 9. References 10.Appendices (if applicable) • Additional data, charts, Python scripts, or other material referenced in the report but not included in the main body. You should also make sure that you are fully aware of the School's policy on plagiarism. You should be aware that you cannot later claim that you did not know the rules and regulations. Copying material from similar essays that can be found on essay websites is not acceptable and can lead to disciplinary action. See https://www.bristol.ac.uk/students/support/academic-advice/academic- integrity/plagiarism/ for full information. Various websites claim that they help students by showing them what is expected on a typical assignment such as in Business Analytics. These tacitly encourage plagiarism and copying, which does not demonstrate true understanding. It is more important to develop your own voice and your own abilities in writing and research, and to show that you can see how operations function in any real-world setting. All assignments are scanned via plagiarism detection software At the University of Bristol, while recognising the potential of AI technologies in enhancing learning, the emphasis is on ethical usage and academic integrity. Students are expected to use AI tools, like ChatGPT, responsibly, adhering to the university's guidelines that discourage dependency on such technologies for completing academic tasks. For detailed information on the correct use of AI in your studies, including the university's policies and recommendations, please refer to the Using AI at University guideprovided by the Study Skills team. Submission Each student must submit their completed portfolio assignment electronically via Canvas. Assessment due date is 28th November 2024 at 13:00 (UK time).
Individual Project The points for this section are distributed as follows: 10 points for the presentation and 10 points for the final report. This project will follow the style. of a three-minute thesis competition. The top 5 presenters and the top 5 reports will each receive a bonus of 1 point. We will focus on the catalog.csv data, which can be accessed on Canvas. Variable Name Description ID ID number, it has 6~9 digits. AGE Age,the range is from 18 to 75. INCOME Annual income,e.g., 63 means 63,000 one year SEX M: male; F: female MARRIED 0: not married; 1: married FICO FICO score, the credit score developed by Fair Isaac Corporation. OWNHOME Number of the owned home Target: develop a model to predict FICO scores Requirements: • You may fit any model for this prediction task. • All analyses should be conducted using SAS EM. • Model comparison is necessary to select the best model. Presentation Guideline (3 minutes): • Introduction: introduce the data and main purpose for this analysis. • Preparation: explore the data and make them ready for the model fitting. • Model: fit the model and explain your model. • Assessment: evaluate the performance of the selected mode. • Recording: make a recording video for your presentation and submit it through canvas. Due to time constraints, you should focus more on the sections you want to emphasize while providing a general overview of the other parts. The professor and TA will evaluate your presentation. Recordings of the top 5 presenters will be shown as examples in class. Final Report Guideline (5 pages): • Tables and graphs are not included in the page limit. • All sections are same in the presentation guideline. In the report, you should give more details for your analysis. The professor and TA will evaluate your report. The top 5 reports will be shown as examples in class.
Assignment 2 EMATM0061: Statistical Computing and Empirical Methods, TB1, 2024 Introduction Create an R Markdown for assignment First, it is recommended that you create a single R Markdown document to include your solutions, with headings created by heading codes such as “## 1.1 (Q1)”, “## 3 (Q1)”, etc. It is a good practice to use R Markdown to organise your code and results. You can start with the template called Assignment02_TEMPLATE.Rmd which can be downloaded via Blackboard. In Section 1, you will need to use R programming to complete the tasks. In section 2 and 3, it is not required to write R code. You can optionally hand in this assignment by 13:00 Tuesday 1 October. This will help us understand your work but will not count towards your final grade. If you want to hand in the assignment, please submit a PDF file containing your answers (click on the “Assignment 02” under the assignment tab at Blackboards to upload the file). There is no requirement on how the PDF file is generated. One example is to choose the output of R-markdown as PDF (which may require LaTex to be installed in your computer). Another example is to choose a html output at R-markdown and convert the html file into a PDF file. If you have multiple PDF files, please combine them into a single PDF file before the submission. Load packages Then we need to load two packages, namely Stat2Data and tidyverse, before answering the questions. If they haven’t been installed in your computer, please use install.packages() to install them first. 1. Load the tidyverse package: library(tidyverse) 2. Load the Stat2Data package and then the dataset Hawks: library(Stat2Data) data("Hawks") 1. Data Wrangling This part is mainly about data wrangling. Basic concepts of data wrangling can be found in lecture 4. 1.1 Select and filter (Q1). Use acombination of the select() and filter() functions to generate a data frame. called “hSF” which is a sub-table of the original Hawks data frame, such that 1. Your data frame. should include the columns: a) “Wing” b) “Weight” c) “Tail” 2. Your data frame. should contain a row for every hawk such that: a) They belong to the species of Red-Tailed hawks b) They have weight at least 1kg. 3. Use the pipe operator “%>%” to simplify your code. The data frame. should look like this: ## Wing Weight Tail ## 1 412 1090 230 ## 2 412 1210 210 ## 3 405 1120 238 ## 4 393 1010 222 ## 5 371 1010 217 (Q2) How many variables does the data frame. hSF have? What would you say to communicate this information to a Machine Learning practitioner? How many examples does the data frame. hSF have? How many observations? How many cases? 1.2 The arrange function (Q1) Use the arrange() function to sort the hSF data frame. created in the previous section so that the rows appear in order of increasing wingspan. Then use the head command to printout the top five rows of your sorted data frame. Your results should look something like this: ## Wing Weight Tail ## 1 37.2 1180 210 ## 2 111.0 1340 226 ## 3 199.0 1290 222 ## 4 241.0 1320 235 ## 5 262.0 1020 200 1.3 Join and rename functions The species of Hawks within the data frame. “Hawks” have been indicated via a two- letter code (e.g., RT, CH, SS). The correspondence between these codes and the full names is given by the following data frame. ## species_code species_name_full ## 1 CH Cooper's ## 2 RT Red-tailed ## 3 SS Sharp-shinned (Q1). Use data.frame() to create a data frame. that is called hawkSpeciesNameCodes and is the same as the above data frame. (i.e., containing the correspondence between codes and the full species names). (Q2). Use a combination of the functions left_join(), therename() and the select() functions to create a new data frame. called “hawksFullName” which is the same as the “Hawks” data frame. except that the Species column contains the full names rather than the two-letter codes. (Q3). Use acombination of the head() and select() functions to printout the top seven rows of the columns “Species”, “Wing” and “Weight” of the data frame. called “hawksFullName”. Do this without modifying the data frame. you just created. Your result should something like this: ## Species Wing Weight ## 1 Red-tailed 385 920 ## 2 Red-tailed 376 930 ## 3 Red-tailed 381 990 ## 4 Cooper's 265 470 ## 5 Sharp-shinned 205 170 ## 6 Red-tailed 412 1090 ## 7 Red-tailed 370 960 Does it matter what type of join function you use here? In what situations would it make a difference? 1.4 The mutate function Suppose that the fictitious “Healthy Hawks Society” has proposed a new measure called the “bird BMI” which attempts to measure the mass of a hawk standardized by their wingspan. The “bird BMI” is equal to the weight of the hawk (in grams) divided by their wingspan (in millimeters) squared. That is, Bird-BMI : = 1000 × Weight/Wing-pan2 . (Q1). Use the mutate(), select() and arrange() functions to create a new data frame. called “hawksWithBMI” which has the same number of rows as the original Hawks data frame. but only two columns - one with their Species and one with their “bird BMI”. Also, arrange the rows in descending order of “bird BMI”. The top 8 rows of your data frame. should look something like this: ## Species bird_BMI ## 1 RT 852.69973 ## 2 RT 108.75741 ## 3 RT 32.57493 ## 4 RT 22.72688 ## 5 CH 22.40818 ## 6 RT 19.54932 ## 7 CH 15.21998 ## 8 RT 14.85927 1.5 Summarize and group-by functions Using the data frame. “hawksFullName”, from Section 1.3 above, to do the following tasks: (Q1). In combination with the summarize() and the group_by functions, create a summary table, broken down by Hawk species, which contains the following summary quantities: 1. The number of rows (num_rows); 2. The average wingspan in centimeters (mn_wing); 3. The median wingspan in centimeters (nd_wing); 4. The trimmed average wingspan in centimeters with trim=0.1, i.e., the mean of the numbers after the 10% largest and the 10% smallest values being removed (t_mn_wing); 5. The biggest ratio between wingspan and tail length (b_wt_ratio). Hint: type?summarize to see a list of useful functions (mean, sum, etc) that can be used to compute the summary quantities. Your final result should look something like this: ## # A tibble: 3 × 6 ## Species num_rows mn_wing md_wing t_mn_wing b_wt_ratio ## ## 1 Cooper's 70 244. 240 243. 1.67 ## 2 Red-tailed 577 383. 384 385. 3.16 ## 3 Sharp-shinned 261 185. 191 184. 1.67 (Q2). Next create a summary table of the following form. Your summary table will show the number of missing values, broken down by species, for the columns Wing, Weight, Culmen, Hallux, Tail, StandardTail, Tarsus, and Crop. You can complete this task by combining the select(), group_by(), summarize(), across(), everything(), sum() and is.na() functions. You should end with a summary table of the following form.: ## # A tibble: 3 × 9 ## Species Wing Weight Culmen Hallux Tail StandardTail Tarsus Crop ## ## 1 Cooper's 1 0 0 0 0 19 62 21 ## 2 Red-tailed 0 5 4 3 0 250 538 254 ## 3 Sharp-shinned 0 5 3 3 0 68 233 68 2. Random experiments, events and sample spaces, and the set theory In this exercise, we will learn about random experiments, events and sample spaces and set theory that were introduced in Lecture 5. In this section, you are not required to compute your results using R codes. If you want to write math formulas in R-markdown, the document called “Assignment_R MarkdownMathformulasandSymbolsExamples.rmd” (available under the “resource list” tab at Blackboard course webpage) provides a list of examples for your reference. 2.1 Random experiments, events and sample spaces (Q1) Firstly, write down the definition of a random experiment, event and sample space. This question aims to help you recall the basic concepts before completing the subsequent tasks. (Q2) Consider a random experiment of rolling a dice twice. Give an example of what is an event in this random experiment. Also, can you write down the sample space as a set? What is the total number of different events in this experiment? Is the empty set considered as an event? 2.2 Set theory Remember that a set is just a collection of objects. All that matters for the identity of a set is the objects it contains. In particular, the elements within the set are unordered, so for example the set {1, 2, 3} is exactly the same as the set {3, 2, 1}. In addition, since sets are just collections of objects, each object can only be either included or excluded and multiplicities do not change the nature of the set. In particular, the set {1, 2, 2, 2, 3, 3} is exactly the same as the set A = {1, 2, 3}. In general there is no concept of “position” within a set, unlike a vector or matrix. (Q1) Set operations: Let the sets A, B, C be defined by A := {1, 2, 3}, B := {2, 4, 6}, C := {4, 5, 6}. 1. What are the unions A ∪ B and A ∪ C? 2. What are the intersections A ∩ B and A ∩ C? 3. What are the complements A ∖ B and A ∖ C? 4. AreA and B disjoint? AreA and C disjoint? 5. Are B and A ∖ B disjoint? 6. Write down an arbitrary partition of {1,2,3,4,5,6} consisting of two sets. Also, write down another partition of {1,2,3,4,5,6} consisting of three sets. (Q2) Complements, subsets and De Morgan’s laws Let Ω be a sample space. Recall that for an event A ⊆ Ω the complement Ac : = Ω ∖ A : = {w ∈ Ω:w ∉ A}. Take a pair of events A ⊆ Ω and B ⊆ Ω . 1. Can you give an expression for (Ac )c without using the notion of a complement? 2. What is Ωc? 3. (Subsets) Show that if A ⊆ B, then Bc ⊆ Ac. 4. (De Morgan’s laws) Show that (A ∩ B)c = Ac ∪ Bc. Let’s suppose we have a sequence of events A1, A2, ⋯ , Ak ⊆ Ω . Can you write out an expression for (∩k(k)= 1 Ak )c? 5. (De Morgan’s laws) Show that (A ∪ B)c = Ac ∩ Bc. 6. Let’s suppose we have a sequence of events A1, A2, ⋯ , Ak ⊆ Ω . Can you write out an expression for (∪k(k)= 1 Ak )c? (Q3) Cardinality and the set of all subsets: Suppose that Ω = {w1, w2, ⋯ , wk } contains K elements for some natural number K. Here Ω has cardinality K. Let E be aset of all subsets of Ω, i.e., E : = {A|A ⊂ Ω}. Note that here E is a set. Give a formula for the cardinality of E in terms of K. (Q4) Disjointness and partitions. Suppose we have a sample space Ω, and events A1, A2, A3, A4 are subsets of Ω . 1. Can you think of a set which is disjoint from every other set? That is, find a set A ⊆ Ω such that A ∩ B = ∅ for all B ⊆ Ω . 2. Define events S1 : = A1, S2 = A2 ∖ A1, S3 = A3 ∖ (A1 ∪ A2), S4 = A4 ∖ (A1 ∪ A2 ∪ A3). Show that S1, S2, S3, S4 form. a partition of A1 ∪ A2 ∪ A3 ∪ A4 . (Q5) Indicator function. Suppose we have a sample space Ω, and the event A is a subset of Ω. Let 1A be the indicator function of A. 1. Write down the indicator function 1Acof Ac (use 1A in your formula). 2. Can you find a set B whose indicator function is 1Ac + 1A? 3. Recall that 1A∩B = 1A ⋅ 1B and 1A∪B = max(1A, 1B ) = 1A + 1B − 1A ⋅ 1B for any A ⊆ Ω and B ⊆ Ω . Combining this with the conclusion from Question (Q5) 1, use indicator functions to prove (A ∩ B)c = Ac ∪ Bc (De Morgan’s laws). (Q6) Uncountable infinities (this is an optional extra). This is a challenging optional extra. You may want to return to this question once you have completed all other questions. Show that the set of numbers Ω : = [0, 1] is uncountably infinite. 3. Probability theory In this section we consider some of the concepts introduced in Lecture 6. Recall that we have introduced the three key rules of probability. Given a sample space Ω along with a well-behaved collection of events ℰ, a probability ℙ is a function which assigns a number ℙ(A) to each event A ∈ ℰ, and satisfies rules 1, 2, and 3: : ℙ(A) ≥ 0 for any event A ∈ ℰ : ℙ(Ω) = 1 for sample space Ω : For pairwise disjoint events A1, A2, ⋯ in ℰ, we have 3.1 Rules of probability (Q1) Construct a probability function based on the Rules of probability Consider a sample space Ω = {a, b, c} and a set of events ℰ = {A ⊆ Ω} (i.e., ℰ consists of all subsets of Ω). Based on the rules of probability, find a probability function ℙ: ℰ → [0, 1] that satisfies ℙ({a, b}) = 0.6 and ℙ({b, c}) = 0.5. In your example, you need to define a function called ℙ . The function maps each event in ℰ to a number. Make sure that your function ℙ satisfies the three rules, but you don’t need to write down the proof (that it satisfies the three rules). (Q2) Verify that the following probability space satisfies the rules of probability. Consider a setting in which the sample space Ω = {0, 1}, and ℰ = {A ⊆ Ω} = {∅, {0}, {1}, {0, 1}}. For a fixed q ∈ [0, 1], define a function ℙ: ℰ → [0, 1] by ℙ(∅) = 0, ℙ({0}) = 1 − q, ℙ({1}) = q, ℙ({0, 1}) = 1. Show that the probability space (Ω, ℰ, ℙ) satisfies the three rules of probability. 3.2 Deriving new properties from the rules of probability (Q1) Union of a finite sequence of disjoint events. Recall that in Rule 3,we have for an infinite sequence of pairwise disjoint events A1, A2, ⋯ . Show that for a finite sequence of disjoint events A1, A2, ⋯ An, for any integer n bigger than 1, the below equality holds as a consequence of Rule 3: Please note that in lefthand side of the equation above we have the union of a finite sequence instead of an infinite sequence. (Q2) Probability of a complement. Prove that if Ω is a sample space, S ⊆ Ω is an event and SC : = Ω ∖ S is its complement, then we have ℙ(SC ) = 1 − ℙ(S). (Q3) The union bound In Rule 3, for pairwise disjoint events A1, A2, ⋯, we have ∞ Recall that in the lecture we have also shown the union bound as a consequence of the rules of probability: for asequence of events S1, S2, ⋯, we have ℙ(∪i∞ =1 Si) ≤ ∑ ∞ i=1ℙ(Si). Give an example of a probability space and a sequence of sets S1, S2, ⋯, such that 1 Si ) ≠ ∑1 ℙ (Si ). (Q4) Probability of union and intersection of events. Show that for events A ⊆ Ω and B ⊆ Ω, we have ℙ(A ∪ B) = ℙ(A) + ℙ(B) − ℙ(A ∩ B)
CS 300: Programming II – Fall 2024 P08 JukeBox Overview In this programming assignment, we will be covering stacks and queues. You must be familiar with music streaming services that use a queue to hold songs that you can play. You are going to implement a similar queue in JukeBox! You will use stacks for the album tracklist. You are also going to be implementing a shuffle method, just like Spotify! Grading Rubric 5 points Pre-assignment Quiz: accessible through Canvas until 11:59PM on 11/17. +5% Bonus Points: students whose final submission to Gradescope is before 5:00 PM Central Time on WED 11/20 and who pass ALL immediate tests will receive an additional 2.5 points toward this assignment, up to a maximum total of 50 points. 15 points Immediate Automated Tests: accessible by submission to Gradescope. You will receive feedback from these tests before the submission deadline and may make changes to your code in order to pass these tests. Passing all immediate automated tests does not guarantee full credit for the assignment. 20 points Additional Automated Tests: these will also run on submission to Gradescope, but you will not receive feedback from these tests until after the submission deadline. 10 points Manual Grading Feedback: TAs or graders will manually review your code, focusing on algorithms, use of programming constructs, and style/readability. 50 points MAXIMUM TOTAL SCORE Learning Objectives After completing this assignment, you should be able to: ● Describe the functionality of a Stack and Queue data structure and explain its operational details when implemented using a linked list. ● Predict edge case situations for stack and queue usage and verify that your implementation handles them correctly. ● Implement a simple Jukebox to play music using your stack and queue data structures. ● Implement meaningful unit tests to verify the correctness of a data structure Additional Assignment Requirements and Notes Keep in mind: ● Pair programming is NOT ALLOWED for this assignment. You must complete and submit P08 individually. ● The ONLY external libraries you may use in your program are: java.util.ArrayList (in all files) , java.util.Collections (JukeBox.java) , java.util.NoSuch Element Exception (Album.java, JukeBox.java, JukeBoxTester.java) ● Use of any other packages (outside of java.lang) is NOT permitted. ● You are allowed to define any local variables you may need to implement the methods in this specification (inside methods). You are NOT allowed to define any additional instance or static variables or constants beyond those specified in the write-up. ● You are allowed to define additional private helper methods. ● Only JukeBoxTester.java may contain a main method. ● All classes and methods must have their own Javadoc-style. method header comments in accordance with the CS 300 Course Style Guide . ● Any source code provided in this specification may be included verbatim in your program without attribution. ● All other sources must be cited explicitly in your program comments, in accordance with the Appropriate Academic Conduct guidelines. ● Any use of ChatGPT or other large language models must be cited AND your submission MUST include screenshots of your interactions with the tool clearly showing all prompts and responses in full. Failure to cite or include your logs is considered academic misconduct and will be handled accordingly. ● Run your program locally before you submit to Gradescope. If it doesn’t work on your computer, it will not work on Gradescope. Need More Help? Check out the resources available to CS 300 students here: https://canvas.wisc.edu/courses/427315/pages/resources CS 300 Assignment Requirements You are responsible for following the requirements listed on both of these pages on all CS 300 assignments, whether you’ve read them recently or not. Take a moment to review them if it’s been a while: ● Appropriate Academic Conduct, which addresses such questions as: ○ How much can you talk to your classmates? ○ How much can you look up on the internet? ○ How do I cite my sources? ○ and more! ● Course Style. Guide, which addresses such questions as: ○ What should my source code look like? ○ How much should I comment? ○ and more! Getting Started 1. Create a new project in Eclipse, called something like P08 Jukebox. a. Ensure this project uses Java 17. Select “JavaSE-17” under “ Use an execution environment JRE” in the New Java Project dialog box. b. Do not create a project-specific package; use the default package. 2. Download five (5) Java source file(s) from the assignment page on Canvas: a. StackADT.java b. QueueADT.java c. LinkedNode.java d. Song.java e. JukeBoxTester.java (includes a main method) 3. Create four (4) Java source file(s) within that project’s src folder: a. LinkedStack.java (implements StackADT) b. LinkedQueue.java (implements QueueADT) c. Album.java d. JukeBox.java 1. Stack and Queue Interfaces These files define a simple interface for a stack and a queue implemented using a linked list, outlining operations such as adding an item, removing an item, checking the top/front item, verifying if the data structure is empty, and seeing if it contains a specific item. 2. Testing Your Code The provided JukeBoxTester skeleton file contains stub tester methods for all the various classes you implement in this assignment. ● Test as you go, and you can add private tester methods to your tester class. If your initial classes are not implemented correctly, the later ones will not work correctly either. ● Recommend drawing diagrams to understand the workings of the data structures so you can figure out their behavior. before you start implementing them. ● If you haven’t already, consider spending some time learning how to use your IDE’s debugger tool. It is very helpful for following the execution of your code, especially as we get into more complex programs. There is a tutorial for Eclipse’s debugger linked on our resources page. 3. LinkedQueue and LinkedStack You will need to implement both a stack and a queue using a linked list data structure constructed from LinkedNodes. Follow the details in the interfaces to get a better idea of how to approach doing this. It would be a good idea to write the tester methods for these data structures and ensure they are working as expected. Further classes will be built using them, getting the functionalities correct here will make debugging easier later. Both data structures make use of the LinkedNode class which provides a basic structure for each element in the linked list, including its data and link to the next element. NOTE: LinkedStack and LinkedQueue contain methods NOT defined in StackADT and QueueADT. Don’t forget to implement them! 4. Song and Album The Song class holds metadata for the songs, this class has been provided to you. The Album class allows you to add songs to an album, remove them, or preview the first song of the album. The Album class utilizes the stack class you implemented in the previous section to hold songs. Once done, complete the corresponding tester methods to ensure they are working properly. 5. Jukebox Once you have the Album class ready, move on to the JukeBox class that puts everything together. It contains a queue of songs. Adding an Album empties the stack into the queue. You can add individual songs to the queue as well. You can call shuffle on the queue, and play the songs. Remember to protect against exceptions! No exceptions except those EXPLICITLY stated in the Javadocs should be thrown at any time. 6. Generating Your Own Javadocs (Optional) You can generate your own Javadocs! Generating Javadocs is an important part of learning how to document your code, and can be a useful skill to know when creating your projects. If you wish, you can use the javadoc command to generate HTML files for your commented code. Simply run the command from a terminal and open the generated HTML file in a browser to view your Javadocs. Assignment Submission Hooray, you’ve finished this CS 300 programming assignment! Once you’re satisfied with your work, both in terms of adherence to this specification and the academic conduct and style. guide requirements, make a final submission of your source code to Gradescope. For full credit, please submit the following files (source code, not .class files): ● LinkedStack.java ● LinkedQueue.java ● Album.java ● JukeBox.java ● JukeBoxTester.java Additionally, if you used generative AI at any point during your development, you must include screenshots showing your FULL interaction with the tool(s). Your score for this assignment will be based on the submission marked “active” prior to the deadline. You may select which submission to mark active at any time, but by default, this will be your most recent submission. Students whose final submission (which must pass ALL immediate tests) is made before 5PM on the Wednesday before the due date will receive an additional 5% bonus toward this assignment. Submissions made after this time are NOT eligible for this bonus, but you may continue to make submissions until 10:00PM Central Time on the due date with no penalty.
TU2983: Advanced Databases Individual Assignment 1 Normalized Relational Databases and Basic System Interfaces TASK 1: Build a Normalized Relational Database in Microsoft Access for your individually assigned topic: 1. Refer to the “TU2983 Individual Assignment Topics” document on http://ukmfolio.ukm.my for your individually assigned topic. Decide on an appropriate/catchy name for a shop selling this product (e.g “Solar Panel Mart”). 2. Build a table called TBL_PRODUCTS_ (e.g. TBL_PRODUCTS_A123456) that contains a minimum of 40 rows of products matching your individually assigned topic. This table must have the following attributes: • FLD_PRODUCT_ID → assign your own ID (keep it simple, future assignments will be based on the same data) • FLD_PRODUCT_NAME → copy from the source website (e.g. amazon.com, tesco.com, zalora.com) • FLD_PRICE → copy from the source website, or set your own price. • 2 other attributes that can be used as categories (e.g FLD_BRAND, FLD_TYPE, FLD_SHIRTSIZE) • At least another 2 attributes of any type (e.g. FLD_DESCRIPTION, FLD_QUANTITY, FLD_WARRANTYLENGTH) Your TBL_PRODUCTS_ table must have at least 7 attributes in total. 3. Copy a picture of the product, for each product in your TBL_PRODUCTS_ table, and rename the picture to match your FLD_PRODUCT_ID for the product. (e.g. if the FLD_PRODUCT_ID is “25”, save the picture as “25.jpg”) • Save all you pictures in a subfolder called “pictures” . 4. Build additional tables for the following: • 1 table for Staff information, with the necessary attributes (start with only 3 staff) • 1 table for Customer information, with the necessary attributes (start with only 3 customers) • 1 table for Order information, with the necessary attributes (start with no orders) • And any additional table you need so that: o 1 customer can make many orders, but each order is only for 1 customer o 1 order can contain many products, and each product can be in many orders o 1 staff can process many orders, but each order is only processed by 1 staff • Ensure that all your tables are normalized to at least 3NF. 5. Use the relationship view in Microsoft Access to specify the relationship between each of your tables • Each table must be related to at least 1 other table. • All tables must be connected to each other through relationships. • Enforce referential integrity on all your relationships to show the cardinality of the relationship in the Microsoft Access Relationship View. 6. Your database file must be saved as DB__.accdb (e.g. DB_SOLARPANELMART_A123456.accdb) TASK 2: Build a new Visual Basic .NET project for creating a Basic System Interface for your shop: 1. Build a “Main Menu” for your shop, called frm_mainmenu_.vb (e.g. frm_mainmenu_a123456.vb) • Your “Main Menu” must have buttons, where each button will open a separate form. that can view the contents of one table. You must have enough buttons and forms to open and view the contents of all your tables. • For each table (products, customers, staff, orders) build a form that will open and view the table’sdata. • Each button on your “Main Menu” must open one of these forms. You must have at least 4 buttons. • Your “Main Menu” will be evaluated in terms of aesthetics, design, neatness and professionalism. 2. Your VB.NET project must be saved as prj__ (e.g. prj_solarpanelmart_a123456) SUBMIT THE FOLLOWING: 1. Your entire VB project folder for this assignment’s project. 2. Your Microsoft Access Database, which should be stored in your VB project’s Bin/Debug directory. 3. Your “pictures” subfolder, which should be stored as a subdirectory in your VB project’s Bin/Debug directory. • Compress all the files above into a single *.ZIP or *.RAR, and label this file as _
Module Code: CMT120 Module Title: Fundamentals of Programming Assessment Title: Programming Challenges Learning Outcomes The learning outcomes for this assessment are as follows: • LO1: Use high-level programming languages to complete programming tasks. • LO2: Demonstrate familiarity with programming concepts, simple data-structures and algorithms. Submission Instructions The coversheet can be found under ‘Assessment & Feedback’ in the COMSC- ORG-SCHOOL organisation on Learning Central. All files should be submitted via Learning Central. The submission page can be found under ‘Assessment & Feedback’ in the CMT120 module on Learning Central. Your submission should consist of a single file: Description Type Name Cover Sheet Python Code fi1fi [Student number] .pdf [Student number] .py Replace [Student number] with your Cardif’s user name, which is typ- ically a letter 'c' (or 'd') + your student number, e.g. c1234567. Any code submitted will be run on a system equivalent to the laptops provided to the students, and must be submitted as stipulated in the in- structions above. The code should run without any changes being required to the submitted code, including editing of filenames. Any deviation from the submission instructions above (including the number and types of files submitted) may result in a deduction of up to 10% from the overall mark. Staf reserve the right to invite students to a meeting to discuss course- work submissions. If you are unable to submit your work due to technical difficulties, please submit your work via e-mail to [email protected] and notify the module leader. Assessment Description To complete this coursework, you must complete a set of five programming challenges in Python. The challenges are described in detail below, and you are also provided with a set of test cases that will check whether your code produces the required output or not. In particular, you will be given two test cases per exercise. You should make sure that your submitted code passes the supplied tests to ensure it functions correctly. However, please note that your code will be tested against a further two diferent test cases, which you have not been supplied with. In total then each exercise will be tested against four test cases, including the two provided. You should therefore ensure that you try to cover all possible inputs and that your code still functions correctly. Your code will need to pass all four tests (two seen, two unseen) in order to score full marks for the functionality. Note that there is a time limit of three seconds to each test. If your code does not provide a correct answer within the time limit the test is failed. Instructions for completing the challenges • You will find template code for the assignment on Learning Central. Inside the template you will find a template .py file, in which you should complete your solutions. You will also finda test_template .py file containing the test cases that will check your code’s functionality, along with a folder of test data required for some of the tests. You are also supplied with a Readme .md file containing detailed instructions on how to run the test cases to check your code. • In the templates, the functions’ interfaces are given but the functions’ bodies are empty. Solve the exercises by correctly filling in the func- tions’ bodies. • It is forbidden to change the functions’ interfaces. However, new functions can be defined to support the solution of the exercises. These functions must have names that are diferent from those already present in the templates. • You are NOT allowed to import any additional modules. Use of mod- ule functions will result in zero marks for the corresponding exercises. • In all the exercises, you can assume that the inputs are provided in the appropriate format and type. Therefore, error-checking is not needed. • The final submission should NOT contain any input, print, or console.log statements. You will be given marks for solving each problem within the time limit. Further marks will be awarded for solution style. and quality. The mark scheme is described in further detail later. Exercise 1: Spacemon Competition Spacemons are spirits that come from other planets of our star system. When two spacemons meet, they feel the urge to fight until one or them is defeated. Warlocks conjure, tame, and train teams of spacemons, to make them compete in a spectacular tournament. Note: the paragraph above is a work of fiction. In this exercise, you are required to complete the function exercise1(roster1,roster2), which simulates the result of a competition between two teams of spacemons, roster1 and roster2; the function re- turns True if roster1 wins, or False otherwise. Disclaimer: no spacemon was harmed in the making of this exercise. A spacemon is represented as a three-element tuple (planet, energy, power), where planet represents the type of the spacemon, energy is its stamina, and power is its ability to reduce another spacemon’s energy. A roster is simply a list of spacemons. The planet of a spacemon is particularly important as certain types are stronger/weaker against others, as represented in Table 1. Table 1: Attack multipliers depending on type. In the table, the rows correspond to the attacking spacemon, the columns correspond to the defending spacemon. The cells show the multiplier that must be applied to the attacker’s power to determine how much energy the defender loses. A competition is divided into one-on-one matches. Spacemons take part in the competition according to their position in the roster. There- fore, the first match is between the first spacemon of each roster. The spacemons take turns to attack, with the first roster always attacking first. When a spacemon attacks, the total damage inflicted on the opponent is: damage = type_mult * power, where type_mult is the multiplier specified in Table 1. The damage is then subtracted from the opponent’s energy. If a spacemon’s energy drops to 0 (or less), the spacemon is defeated and the match ends. Then, a new match starts between the winner of the previ- ous match and the next spacemon in the opponent’s roster. The winning spacemon does not recover any lost energy between matches; also, the first spacemon to attack is, again, the one from the first roster. Example: Let us consider the following rosters. • roster1 is comprised of (‘Earth’,100,10) and (‘Earth’,100,10). • roster2 is comprised of (‘Mercury’,80,10) and (‘Venus’,80,10). In the first match, the Earth spacemon defeats the Mercury spacemon; how- ever, it loses 70 points of energy. In the second match, the former winner is defeated by the Venus spacemon, which receives 10 points of damage. Fi- nally, the Venus spacemon wins the third match, losing 35 points of energy. The second roster wins the competition and, therefore, the function returns False. Exercise 2: Five Letter Unscramble For this exercise you need to use the provided wordle .txt file that contains a list of 5-letter words used in the game Wordle. Disclaimer: This list is taken directly from the Wordle game and there- fore may contain some words which some people may find o ensive. Reader discretion is advised. Complete function exercise2(s) that, given a string containing letters, returns the number of unique words in wordle .txt that can be obtained by rearranging the characters in the string. Each character in s can be used at most once. Examples: • exercise2(‘sehuoh’) returns 1, as the string can be rearranged into ‘house’ . • exercise2(‘caarto’) returns 5, as the string can be rearranged into ‘carat’ , ‘carta’ , ‘actor’ , ‘aorta’ , ‘taroc’ . Exercise 3: Wordle Set For this exercise you need to use the provided wordle .txt file that contains a list of 5-letter words used in the game Wordle. Disclaimer: This list is taken directly from the Wordle game and therefore may contain some words which some people may find offensive. Reader discretion is advised. Wordle is a web-based word game created and developed by Welsh soft- ware engineer Josh Wardle. Players have six attempts to guess a five-letter word, with feedback given for each guess in the form. of colored tiles indicat- ing when letters match or occupy the correct position. After every guess, each letter is marked as either green, yellow or gray: green indicates that letter is correct and in the correct position, yellow means it is in the answer but not in the right position, while gray indicates it is not in the answer at all. Multiple instances of the same letter in a guess, such as the “o”s in “robot”, will be colored green or yellow only if the letter also appears mul- tiple times in the answer; otherwise, excess repeating letters will be colored gray (Wikipedia contributors, 2022). Let us define a “Wordle set” as the set of five-letter words in wordle .txt that match a given configuration of green, yellow, and gray letters. Com- plete function exercise3(green,yellow,gray) that returns the cardinality (i.e. the size) of the corresponding Wordle set. In particular, green is a dic- tionary that specifies the letters whose positions are known. The keys are positions (i.e., 0,1,2,3,4) and their associated values are their corresponding letters. Only positions with known letters are included in the dictionary. yellow is a dictionary specifying the letters that are in the answer but their position is not known. The keys are letters and their values are sets of known wrong positions (i.e., 0,1,2,3,4). Finally, gray is a set of letters that are known to not be in the answer. Note that a letter cannot be in gray and, at the same time, in green or in yellow. However, a letter could be both in green and in yellow and the clues could refer to the same letter. Example: Given green = {1:’i’,3:’c’}, yellow = {’e’:{3}}, and gray = {’r’,’a’,’s’,’d’,’f’}, exercise3(green,yellow,gray) returns 5, as the Wordle set is comprised of ‘wince’, ‘mince’, ‘niece’, ‘piece’, and ‘yince’. Exercise 4: 2D Most Rewarding Shortest Path Complete the function exercise4(env), which finds the shortest path from a starting cell A to an arrival cell B on a grid, having the highest reward. Attribute env describes the environment. An environment is a matrix that can contain the following characters: A, B, O, X, and R. A and B are the starting and arrival cell, respectively. An O represents an empty space, an X represents an obstacle, and an R represents a reward. An example is presented in Table 2. Table 2: Sample 2D environment. A cell is adjacent only to other cells in the same row or column. For example, the cell containing an A in the top-left corner is adjacent only to the X on the right and the O at the bottom - diagonals are not considered adjacent. When searching for the shortest path, only empty and reward cells (Os and Rs, respectively) can be traversed. If a path passes through a reward cell, the reward is collected. Figure 1 shows two shortest paths (note: there are actually more than two shortest paths in this example), one approaching the B from the top (in red) and the other from the bottom (in blue); both have a length of seven. However, the former has a total reward of three, while the latter has a total reward of one. Therefore, the red path is the one that the function is looking for. Parameter env is given to the function as a list of sublists, where each sublist contains characters corresponding to a row. The representation cor- Figure 1: Two shortest paths. responding to the environment above would be: [[‘A’,‘X’,‘R’,‘R’,‘R’],[‘O’,‘O’,‘O’,‘X’,‘B’],[‘O’,‘O’,‘O’,‘O’,‘R’]]. The function should return a 2-value tuple containing the length of the shortest path and the total reward collected. Example: Given the environment above, the function should return (7,3). Hint: You might want to enumerate all the paths from A to B (excluding those that pass through the same cell twice) . Then, you can can choose the shortest path having the highest reward. Exercise 5: Social Network Analysis Social network analysis (SNA) is the process of investigating social structures through the use of networks and graph theory. It characterizes networked structures in terms of nodes (individual actors, people, or things within the network) and the ties, edges, or links (relationships or interactions) that connect them (Wikipedia contributors, 2021b). Figure 2 shows a sample social network with seven actors. Figure 2: Sample social network with 7 actors. Network (and graphs) can be represented as adjacency matrices. An adjacency matrix is a square matrix having as many rows and columns as there are actors in the network. A cell is 1 if the actors corresponding to the row and the column are connected by an edge, and is 0 otherwise. The matrix corresponding to the social network in Figure 2 can be found below in Table 3. In turn, matrices can be represented as a list of sublists, as explained in Exercise 9. Table 3: Adjacency matrix corresponding to the social network in Figure 2. In graph theory, a clique is a subset of nodes of a graph such that every two distinct nodes in the clique are adjacent; that is, every pair of nodes in the clique must be connected. A maximal clique is a clique that cannot be extended by including one more adjacent vertex (Wikipedia contributors, 2021a). In SNA, a clique represents a tightly-knit group or community. Figure 3 illustrates all the maximal cliques that can be found in the sample network: (A,B,C), (B,D), (D,F,G), and (D,E,F). Following the definition above, node E cannot be added to the yellow click (D,F,G), as node E is not connected to node G and, therefore, (D,E,F,G) would not be a clique. Figure 3: Maximal cliques in the sample social network. Each clique is highlighted in a diferent colour. As it can be seen from the example, a node can belong to multiple maxi- mal cliques. It is interesting to identify actors that belong to multiple cliques, as they can act as bridges between communities and be extremely influential. In this exercise you need to complete the function exercise5(network) which, given the adjacency matrix of a social network as a list of sublists, returns the number of maximal cliques that each actor belongs to as a list. Example: The result of applying exercise5(network) on the adja- cency matrix in Table 3 would be [1,2,1,3,1,2,1].