Department of Electrical and Electronic Engineering EIE373 Microcontroller Systems and Interface Laboratory Exercise 1: Introduction to AVR (Deadline: Check the course information) Objectives: 1. To familiarize students with the use of an AVR microcontroller. 2. To develop C programs under the Arduino platform. Equipment: Atmel Studio and Arduino IDE (software; check the version in the course information) The Arduino Starter Kit (hardware) Important Notices: 1. Download the ATmega328p datasheet from the Blackboard before doing the laboratory exercises. 2. You can buy a kit and bring it to the lab sessions or leave your student identity card in the box beside the kits to borrow one kit box. You get the card back when you return the box. Note that you must return the box five minutes before the end of the laboratory sessions. 3. All components you need can be found in the kit box. Introduction: This experiment introduces some simple applications of an AVR microcontroller to perform arithmetic and I/O operations. Students develop C programs and build simple electronic circuits for such simple applications. Atmel Studio is the integrated development platform (IDP) for developing and debugging Atmel AVR microcontroller (MCU) applications. It gives you a seamless and easy-to-use environment to write, build, and debug your applications written in C/C++ or assembly code. Atmel Studio supports all 8- and 32-bit AVR MCUs and connects seamlessly to Atmel debuggers and development kits. The Arduino Start Kit teaches you the basics of using the Arduino hands-on. You will learn by building several creative projects. The kit includes a selection of the most common and useful electronic components. Procedure: Section A: Create your first simple application 1. Open Atmel Studio: Double-click the icon of Atmel Studio. 2. Change the mode from “Standard” to “Advanced” . 3. Go to the main menu. Select “Tools” → “External Tools” . Type in “Arduino Uno” in the field “Title”. Type in the following paths into the fields “Command” and “Arguments” : C:Users??AppDataLocalArduino15packagesarduinotoolsavrdude6.3. 0-arduino17/bin/avrdude.exe C"C:Users??AppDataLocalArduino15packagesarduinotoolsavrdude6. 3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM4" - b115200 -D "-Uflash:w:$(ProjectDir)Debug$(TargetName).hex":i Note that ?? is your username (e.g., 22123456d). These two paths are in the text file ArduinoUno.txt, which can be found in the zip file “EIE3373 Course Materials.zip”, which can be downloaded from Blackboard. Read “Important information” on Page 4 before downloading your program to your Arduino. Atmel Studio and Arduino IDE are freeware, and you can download them from the Internet to your computer. You can follow the steps below to find the "Command" and "Argument" paths using the Arduino IDE on your computer: 1. Open the Arduino IDE: Launch the Arduino IDE on your computer. 2. Access the Blink Example: Go to File → Examples → 01.Basics → Blink. 3. Select the Arduino Uno Board: Go to Tools → Board → Arduino Uno. 4. Enable Detailed Upload Output: Got to File → Preferences. In the Preferences window, check the box labeled “ Show verbose output during: upload”. Click OK to save the settings. 5. Upload the Blink Sketch: Click the Upload button (the right arrow icon) to compile and upload the Blink sketch to your Arduino Uno. 6. Check the Output Window: Observe the output window at the bottom of the Arduino IDE after uploading. Look for some lines similar to the following texts (usually around line 3): "C:UsersYourUsernameAppDataLocalArduino15packagesarduinotools avrdude6.3.0-arduino17/bin/avrdude" "- CC:UsersYourUsernameAppDataLocalArduino15packagesarduinotools avrdude6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p - carduino "-PCOM4" -b115200 -D "- Uflash:w:C:UsersYourUsernameAppDataLocalTemparduinosketchesF3 4549723ED32139E374C1C89CFACE38/Blink.ino.hex:i" 7. Extract the Command and Argument: Copy the lines to a text file and modify its contents to create the command and argument paths. The lines: "C:UsersYourUsernameAppDataLocalArduino15packagesarduinotools avrdude6.3.0-arduino17/bin/avrdude" "- CC:UsersYourUsernameAppDataLocalArduino15packagesarduinotools avrdude6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p - carduino "-PCOM4" -b115200 -D "- Uflash:w:C:UsersYourUsernameAppDataLocalTemparduinosketchesF3 4549723ED32139E374C1C89CFACE38/Blink.ino.hex:i" Command path: C:UsersYourUsernameAppDataLocalArduino15packagesarduinotools avrdude6.3.0-arduino17/bin/avrdude.exe Argument path: C"C:UsersYourUsernameAppDataLocalArduino15packagesarduinotool savrdude6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p - carduino "-PCOM4" -b115200 -D "- Uflash:w:$(ProjectDir)Debug$(TargetName).hex":i Replace YourUsername with your actual username in the file paths. Important information: a. Note that “COM4” in the above path shows the port the Arduino Uno plugs into your computer. Thus, later, when you plug in the Arduino Uno to your computer, you need to check whether the port is “COM4” or not (Double click the icon “Computer” and Select “Properties” → “Device Manager” → “Ports”. Check the position of the port for the Arduino Uno). You may need to change the port number if it is not “COM4” . b. Moreover,you may goto Blackboard to download the text file “ArduinoUno.txt” in the course material (in the folder “AVR Programming Materials”). This file stores these two paths. Then, you can copy and paste them into such two fields. After that, click the checkboxes “Use Output window” and “Prompt for arguments” and then click the button “OK” . When you finish the setting, a new field, “Arduino Uno” is created under the menu item “Tools”. Note that the above setting must go through once you have opened Atmel Studio for the first time. 4. Go to the main menu and create a new project. Then select “C/C++” and “GCC C Executable Project” to create anew project. Type in the project name “Lab1A”. After that, select “ATmega328p” . Note that the I/O ports of the AVR microcontroller are bit-accessible, but the AVR C compiler does not support this feature. Thus, you should use a mask to set, clear, and check some bits in the I/O ports. 5. Type in the following program into “Lab1A.c” . #include int main(void) { DDRD = 0xFF; while(1) { PORTD = 0x55; } } 6. Go to the main menu. Select “Build” → “Build Solution” to compile the program. 7. Build the circuit below on the Arduino Uno and the breadboard. Check the pinout diagram in the appendix or some files in the course material. 8. Go to the main menu. Select “Tools” → “Arduino Uno” to burn the program into the ArduinoUno. You should see some LEDs are on. If it does not work, check the “Important Information” below. Important information: Note that you should remove any connections topin 0 (RX) and pin 1 (TX) of the Arduino Uno before you burn your program into it; otherwise, your program may not burn successfully. 9. Repeat the above steps, but this time, Port D is toggled between 0x55 and 0xAA with a one to two-second time delay. It would be best to use looping to generate the delay and set the optimization level to the first one (level zero). Show the calculation of how to generate the delay. Note that the clock frequency of the Arduino Start Kit is 16 MHz. When your program works correctly, all LEDs connected to Port D are flash. Section B: Simple applications 1. Connect a switch to PB0; the pin diagram is shown in Step 7 of Section A. Connect an LED to the switch. When the switch is pressed, the LED is on. When the switch is released, the LED is off. Connect an LED to PD2. When the switch is pressed, the LED in PD2 is on. When the switch is released, the LED in PD2 is off. You may connect an LED serially with R1 to check whether the circuit to connect the switch is correct. 2. Use the circuit in Section A and the connection in Step 1. There are two states in the switch: States 0 and 1. When it is in State 0, all LEDs connected to Port D are off. When it is in State 1, all LEDs are on. At the beginning, the switch is in State 0. When (1) the current state is 0 and (2) the switch is pressed and then released, it goes from State 0 to State 1. When (1) the current state is 1 and (2) the switch is pressed and then released, it goes from State 1 to State 0. Demonstrate Section A (Steps 8 and 9) and B (Steps 1 and 2) to our student helpers. Instructions: 1. You are required to demonstrate your programs to our student helpers. 2. Zip all programs (including the whole projects) in Sections A and B to a single file. Please submit it to Blackboard. 3. Deadline: Check the course information.
ECE5470 Prelim 3 Fall 2022 1. General (22 pts) A. Precision Recall The figure to the right shows the location of points for plotting a precision recall curve. Numerically evaluate the Average Precision (AP) AP: 1/11((1*5)+(0.57*4)+(0.5*2))=0.752 AUC: 1 * 0.4 + 0.57 * 0.4 + 0.5 * 0.2 = 0.629 B. PR - ROC (a) Under what condition would you do an ROC analysis in preference to a precision recall analysis? When the costs associated with outcomes are different (b) Under what condition would you do an PR analysis in preference to an ROC analysis? When the populations of positives and negatives are different. That is, there are typically more of one class than the other in the nature. C. ROC A two-class task has the following outcomes for a test set. Carefully sketch the Receiver Operating Characteristic (ROC) on the right. Index Confidence positive Correct class 1 .97 + 2 .35 + 3 .72 + 4 .72 + 5 .49 + 6 .33 - 7 .25 - 8 .20 - 9 .48 - 10 .12 - 11 .34 - 12 .38 - 13 .82 - 14 .15 - 15 .32 - Sensitivity (TPR) 1 – specificity. (FPR) 2. Machine Learning (22 pts) A. The figure presents the learning curve of a neural network. As the number of epochs increases from a certain level, the test error is also increasing. What is the name of this issue and how one can tackle it? Show you solution on the figure. (a). What is the name of the issue? Overfitting (b). What would you do to address it? Early stopping (e.g. At 750 Epochs) B. What action would you take for each of the following cases for learning curves (a) The error for the validation set continues to decrease but the error for the training set begins to slowly increase _ This should never happen. Check the system/program for errors (b) The training error changes significantly (in general alternating from positive to negative) between each epoch. Decrease the Learning rate ______________________________________________________________________ C. P and N (a) Give an equation for accuracy in terms ofT, P, TP, FP, TN, etc. (TP + TN)/(TP + TN + FP + FN) (b) Give an equation for sensitivity in terms ofT, P, TP, FP, TN, etc. TP/(TP + FN ) (c) Based on the given values, fill the confusion matrix from the given values. Label the rows and columns Accuracy = 890/1000 Recall = 560/610 Precision = 560/ 620 Total positive values=610 3. Segmentation and Object recognition (18 pts) A. A common component of a UNet segmentation model is a transposed convolution layer (a) what is the function of this layer? Up-sampling: to convert a feature image to the next higher resolution 2 x 2 times (b) how many parameters (weights) does this layer contain (when used in a Unet)? # channels * 4 + 1 (bias) (c) what activation function is typically used with this layer? Usually, no activation function is used with this layer for U-Net B. Given a multi-object detection task on 256 x 256 color images with 10 object classes (a) What is the difference between a Fast RCNN and. A Faster RCNN? A fast RCNN has an algorithm for region selection whereas a Faster RCNN has a trained Region Proposal Network (RPN) (b) How many (multiclass) outputs does a YOLO Segmentation model have? N x N where N is a fraction of 256 (c) For a Region-based Fully Convolutional Network (R-FCN) How many outputs are trained for each class? 9 Explain why multiple outputs are trained The 9 outputs correspond to nine regions (3 x 3) that cover the object. All the outputs for each “zone” should respond to indicate the presence of the target object. C. A UNet or FCNN used to locate the pixels of small objects has two issues with respect to the loss function. What are these issues and how would you address them? 1. The metric used for testing is DICE score no accuracy (pixels correct). Solution used loss based on DICE score 2. There are many more positive than negative outcomes in the training set; i.e., unbalanced training set. Use a weighted loss function that has a higher loss magnitude for positive errors compared to negative errors. 4. CNN Model (20 pts.) init init The model is designed to classify images of size 128 x 128 into 9 different classes (a) How many weights/parameters are associated with layer1: 160 (b) How many weights/parameters are associated with layer2: 6416 (c) How many weights/parameters are associated with layer3: 4640 (d) How many weights/parameters are associated with layer fc: 73737 For a specific problem a designer decides to preprocess the image with the Fourier transform. (e) What modification, if any, would need to be made to the model to function with the transformed image? 2 input channels instead of 1 (f) By using the Fourier transform. which of the following might the designer expect the performance to be less sensitive to: (a) translation (b) rotation, (c) scale (d) aspect ratio) ______a____________________________________________ 5 .Misc (22 pts) A. CT: Computerized Tomography (CT) scanners are used for a number of applications including medical diagnosis and baggage inspection. To design a deep learning image analysis model for images created by CT scanners requires resolving a number of issues. List three main ways in which CT images differ from traditional camera images. 1. Calibrated images 2. 3D and large 3. Grayscale Indicate how you what you would do differently for CT images with respect ot the following 1. Image Preprocessing No standardization 2. Model Design 3D instead of 2D 3. Training Smaller batch size/ different loss function B. Training 1. Which of the following techniques can be used to reduce model overfitting? (a) Data augmentation, (b) Dropout, (c) Batch Normalization (d) Using Adam instead of SGD A,B,C C. Models (a) What is the main feature of inception net models for performance improvement? Leveraging different filter sizes at once (a) What is the main feature of resnet models for performance improvement? Skip connections to combat vanishing gradient (c) An inception module is shown on the right. Clearly label the function of each box including the function “size” parameter. [do not include number of channels]
Department of Electronic and Information Engineering EIE2111 Lab 2: Introduction to Classes and Objects (Deadline for Submission: Check the course information) Introduction This laboratory exercise is designed to give you hand-on experience in Classes and Objects. Part A: Develop your first class, GradeBook. 1. Run the application software “Microsoft Visual Studio 2019” . - Choose and click “Visual Studio 2019” from the program menu. 2. Create a new project called Lab02PartA. - Select C++ under the “All languages” and click “Windows Desktop Wizard” . - Click the option “New” and then “Project” . - Type “Lab02PartA” in the field “Name” and then click the browse button “ ” to select the storage location e.g. “Desktop” . - Click the button “Create” . Select “Console Application” and “Empty Project” . Then, click the button “OK” (see the figure on the right hand side). 3. Create a C++ program file called Lab02PartA.cpp. - Go to the window “Solution Explorer” and right click the folder “Source Files” . - Click the option “Add” and then “New Item …”. Select “C++ file (.cpp)”, type “Lab02PartA.cpp” in the field “Name” and then click the button “Add” . - Type the following statements in the window “Lab02PartA.cpp” : //Lab02PartA.cpp //Name: #include #include using namespace std; class GradeBook { public: void displayMessage(string courseName) { cout
Department of Electrical and Electronic Engineering EIE373 Microcontroller Systems and Interface Laboratory Exercise 2: AVR Timer/Counter Programming (Deadline: Check the course information) Objective: 1. To develop C programs with timers under the Arduino platform. 2. To develop a C program with a counter under the Arduino platform. Introduction: This experiment introduces the use of timers and a counter inside the AVR microcontroller. Students MUST use the AVR timers in the delay function to finish this lab. Using simple loops only without timers to count the delay or built-in functions is not acceptable. Equipment: Atmel Studio The Arduino Starter Kit Procedure: Section A: Write a C Program to toggle an LED by using a timer 1. Write a C program to toggle an LED connected to PB0 (you should connect the LED to PB0 with a resistor) every second. Use the timer with Normal mode to generate a one- second time delay. Note that the clock frequency of the Arduino Start Kit is 16 MHz. 2. Repeat Step 1, but the timer is in CTC mode this time. DO NOT skip Section A and goto Section B directly. You must finish the laboratory exercise step by step; otherwise, you will find that it is not easy to follow. Section B: Write a C Program to simulate the traffic lights 1. Write a C program to simulate the traffic lights using different pins. You should use a timer in Normal mode. Note that the Arduino Start Kit's clock frequency is 16 MHz. A set of traffic lights for cars (Light 3): PB0, PB1, PB2 (3 LEDs) A set of traffic lights for cars (Light 2): PB3, PB4, PB5 (3 LEDs) A set of traffic lights for pedestrians (Light 1): PC4, PC5 (2 LEDs) Implement the following pattern: Current state Light 1 Light 2 Light 3 Time duration Next state 1 Red Green Red 5 seconds 2 2 Red Yellow Red 1 second 3 3 Red Red Red 1 second 4 4 Red Red Red + Yellow 1 second 5 5 Green Red Green 5 seconds 6 6 Green Blinking Red Yellow 1 second 7 7 Red Red Red 1 second 8 8 Red Red + Yellow Red 1 second 1 2. Repeat Step 1, but the timer is in CTC mode this time. Section C: Write a C program to count a switch Connect a switch to pin T0 (PD4, Counter 0) or T1 (PD5, Counter 1) and a LED to PC0. There are two states in the switch: State 0 and 1. When it is in State 0, the LED is off. When it is in State 1, the LED is on. At the beginning, the switch is in State 0. When the switch is pressed three times and in State 0, it goes to State 1. When the switch is pressed three times and in State 1, it goes to State 0. You should use counter programming in CTC mode to implement this application. You may find that sometimes the state may change, but you do not press the switch three times. It is because of the bouncing effect of the switch. Please google “bouncing switch” to understand the bouncing effect and “debouncing switch” to find a solution to reduce the bouncing effect. Demonstrate Sections B and C to our student helpers. Instructions: 1. You are required to demonstrate your programs to our student helpers. 2. Zip all programs (including the whole projects) in Sections B and C into a single file and submit it to Blackboard. 3. Deadline: Check the course information.
CSCI4160 Fall 2024, Raft Assignment Deadline: Dec 3, 2024, 11:59am 1 Introduction In this assignment, you will build a distributed replicated (key-value) map using Raft [1]. Follow the Raft paper to implement and pass all the test cases in the grader. We thank Shimin Wang from Carnegie Mellon University when preparing this assignment. For the details of Raft please refer to • The detail of Raft presented by their authors: https://youtu.be/YbZ3zDzDnrw and https://youtu.be/vYp4LYbnnW8 • The Raft extended paper annotated by Shimin Wang, which is included in the assign- ment package. • The official web site of Raft, http://raft.github.io. It provides a good interactive demo with the Raft consensus protocol. You do not need to handle all cases in the full Raft paper. Specifically, • You don’t need to randomize the election timeout. The election timeout value would be changed by the grader at run-time to simulate different situations. • You don’t need to implement log compaction and snapshotting. • We don’t need to handle cluster membership changes. • No disk is considered in this implementation. Your key-value map is in memory. When you commit any log, you should directly apply that operation, committed will be treated equally as applied. Consequently, the lastApplied operation in the Raft paper is unnecessary to you. Name Description bin/ Student-compiled binaries and grading tools binary. scripts/ Grading shell scripts (Don’t touch). tests/ Source code of grading tools. (Don’t touch). yourCode/ Your working directory yourCode/src/main/java/RaftRunner. java For Java. Write all your code in this file if you use Java (Work on it). yourCode/main. go For Go. Write all your code in this file if you use Go (Work on it). yourCode/compile . sh Script to compile your program (Don’t touch it). raft . proto The gRPC proto file. (Don’t touch. Just FYI only, since we have already generated the stubs for you.) raft(anotated) . pdf The extended raft paper with some hints for the implementation (Please read it). Figure 1: A condensed summary of the Raft consensus algorithm 2 Your Assignment 2.1 Submission: git classroom We use Github Classroom https://classroom.github.com for assignment managment. Git is a predominant version control system, created by the inventor of Linux. Github is an online hosting of Git and it is now hosting thousands of open-source projects. 2.2 Get the assignment package You are supposed to open a Github account using your CUHK email address (it is fine to use your own Github account if you already have) and follow the steps below to register an account and get the starter code. 1. Use your Github account to come here https://classroom.github.com/a/3qoRTJ1Z to clone the assignment starter package to be under your Github account. 2. If everything runs smoothly, your Github account will show a new repo named cuhk- raft-[your-Github-account-name], like below: 3. As GitHub shut down password authentication since Aug. 2021, you’re required to setup a ssh key for connection following the GitHub Docs. 4. Look for the tab “Code” to get the URL of your assignment repo, like below: 5. Open a terminal, change to a local directory of your desire, type “git clone {Your Repo URL}” and your username/password to get a local copy of the repo on your computer. 6. Finally, we should set the user name and email such that the git system recognizes you. You should do this once only. To begin with, type the followings in the terminal and replace the name and email with your own Git account. 2.3 Get your starter code based on your preferred language First clone the project from your repository. If you use Java, please execute: git checkout java If you use Go, please execute: git checkout go 2.4 Submission Git is actually a complicated version control system (VCS) that has a lot of features. Briefly, it installs a local VCS on your computer and you can do any versioning locally (e.g., commit- ting some changes, reverting some changes). If necessary, you can “push” your local changes from your local repo to an online repo (Github). You may Google the powerful usage of Git online. Here, we focus on how you can commit your finished assignment to your local repo and then push to the online private repo. We will fetch your assignment from your online private repo for grading. The process is essentially the “assignment submission” process: Assuming you have done some edits on the source files, the command git add . states your interest of adding everything under the current directory “.” to your local Git repo. Next, the command git commit tries to commit your changes to your local repo. The parameter -m "comments" is your comment about this commit. Lastly, the command git push origin tries to synchronize your local repo with your online repo. For Git beginners, make sure you use a web browser to login your Github online and check if your source codes have been pushed there successfully. To submit the final version for grading, push the code to the master branch by git push origin go:master -f if you use Go. Replace the branch name go by java to submit if you use Java. Warning: DON’T change the file names, otherwise you get 0 marks 2.5 Your job For Java, write your program in ‘src/main/java/RaftRunner.java ’. For Go, write your program in ‘main.go ’. • Follow the “State” box in Figure 1 to implement RaftNode class (Java) / raftNode struct (Go). You will need to add a lot more than what Figure 1 tells you such as adding a Map to be the in-memory key-value map, adding a server-state to store whether this node is in “Follower”, “Candidate”, or “Leader” state, etc. • Function NewRaftNode: After creating an instance of raftNode, its initial state should be a “Follower”, a node shall create a new thread to kick off a new leader election if it has not heard from the leader within a period of electionTimeout. To kick off the leader election, invoke the others’ RequestVote by RPC concurrently. If a remote node doesn’t respond to your RequestVote, don’t resend RequestVote, wait for the next election. • When a node becomes a “leader”, invoke others’ AppendEntries RPC concurrently based on the heartbeat interval. Follow Figure 1’s “AppendEntries” box to implement it. Once again, if a remote node doesn’t respond to your call, don’t resend, wait for the next heartbeat interval. • RPC Propose: Our grader will call this RPC to put or delete to update the dis- tributed replicated map. Log this operation using LogEntry and append to the local log of the leader. Propose return only after the the log is committed (i.e., replicated to the majority of other nodes). • RPC GetValue: Implement this to return a value given a key. • RPCs SetElectionTimeout and SetHeartBeatInterval: invoked by the grader to set up different test cases. On invoked, these functions (re)-set the election timeout and heartbeat interval based on the input values. After you have finished the assignment, compile it first to check whether there is any syntax error. You shall first enter into yourCode and execute: bash compile . sh A successful compilation would generate the bin/raftrunner file. 3 Run our grader After your program can be successfully compiled, run scripts/rafttest . sh to compile the test framework and check whether you can pass the given test cases. The grader will launch 5 Raft instances as 5 processes. There are 10 test cases: 6 to test the leader election, 4 to test the log replication. For each test case, it may • Set different election timeouts and heartbeat interval on each node (process) • Delay or drop the messages between the nodes • Invoke Propose RPC to update the distributed replicated map • Invoke GetValue RPC to get value by a key and match it with an expected value • Match the messages between different nodes with the expected messages • Note: there is a running time limit for each test case All tests run about 200 ~ 300 seconds. If a test case fails, the reason and the expected messages (if any) will be printed out. For example: In the above, the message “node 0 2: reject, term: 1” means node 0 replies node 2 with a reject, and the one who sends the message (node 0) is in term 1. In the end of the test, you will see a summary. If you see something like below, congrat- ulations. We also provide a script to test for a specific test case. For example: bash . . /scripts/rafttest _single . sh testOneCandidateOneRoundElection Remember to run rafttest . sh at least once before rafttest single. sh, otherwise the grader is not compiled and can’t be found. 4 Grading 1. The TA will fetch and grade your latest version of master branch in your repository as of the deadline. Remember to commit and push before the deadline! 2. 10 test cases in total. 3. Passing one test case will earn you 10 marks. 4. A test case is regarded as PASS if and only if your program always pass it. If it fails once during the grading, it’s regarded as FAIL. 5. Part A is leader election part of Raft. It covers the first six test cases. Part B is the log replication part, which covers the last four test cases. 6. We’ll try to run the grader as many times as we can. As far as we know, 10 times is not enough to find all bugs, please run the grader for more times to fully test your program before submission.
MOS 3362b - Introduction to Taxation in Canada Fall 2024 - Tax Assignment PURPOSE: The purpose of this assignment is to provide practice organizing and analyzing data to determine the federal income tax payable for a taxpayer. This assignment also provides experience using professional communication and using Excel functions, both of which are beneficial in tax and accounting roles. DUE DATE: Sunday, December 1, at 11:55 pm. Will be accepted until Thursday, December 5 at 11:55 pm without penalty. No assignments will be accepted after December 5 for any reason. Completing this assignment is a requirement for passing this course. INSTRUCTIONS: Complete this assignment using this PDF document and the Excel file that is provided on OWL. When you have completed the assignment, submit two separate documents on the OWL Assignment page: (1) your completed Excel document and (2) your letter to Zendor along with a self-reflection. DO NOT SUBMIT AS PDFs. Any document submitted as a pdf will receive a grade of zero. For your letter, use 200 to 300 words, 12-point font and single spacing. Ensure that you use a professional format and tone when communicating with Zendor. You want him to be impressed so that he will ask you to help him again in the future. Remember - you are writing TO Zendor, not just about him. For yourself-reflection, briefly describe how long it took to complete this assignment and any challenges you encountered with completing it. Also include ways you felt the assignment was beneficial. Your reflection should be 100 - 200 words. MEETING NOTES As a senior accountant with the firm Better and Best, you have been asked to prepare the tax return for Zendor McConnell, an electrician operating as a sole proprietor. This is your second year preparing Zendor’s income tax return. Zendor has given you an Excel file with a list of all his transactions for 2024. He has said that he is not certain whether everything relates to his business, and that it may include some items from other years. You made a note to watch for items from years other than 2024 and to carefully consider whether transactions are applicable for income tax purposes. Additional Information 1. Zendor is 52 years old and lives in London, Ontario. His revenue comes from providing electrical services for businesses in London and in Kitchener. He tracks the revenue from these two locations separately in order to best understand his business profitability. 2. Zendor is married to Barbara, age 48, who is disabled. She receives a disability pension of $1,000 per month and has a T-2201 that has been accepted by CRA. The couple has one son, Adam, who is 20 years old, in good health, and attends university full time. Adam’stuition for 2024 was $16,000. He earned $20,000 working during the summer. He would like to transfer as much of his tuition tax credit to his father as possible. Barbara’smother, Janice, is 73 years old and lives with the family. She is in good health and has pension income of $36,000 per year. She helps take care of the home and does things that Barbara is unable to do. She does not receive any compensation for this. 3. Home office expenses: One room in Zendor’s home is dedicated solely as his business office. It is the only place that he uses as an office. The office occupies 12% of the floor space of the home. Zendor does all his administrative work in this office, including purchasing supplies, scheduling jobs, and billing customers. The following home office expenses were incurred in 2024: • Utilities – heat and water • Internet (used 60% for personal purposes) • Municipal property tax – City of London • Office supplies – pens, paper, toner for printer, etc. • Office furniture - new desk and chair 4. Van expenses: On January 1, 2024, Zendor sold a customized van for $15,000 that he had purchased for $80,000 and had a UCC of $5,650. This was the only item in its UCC class. On the same day he purchased a new customized van. He paid for the new van with the $15,000 from the sale of the old vanand wrote a cheque for the additional remaining cost. Both vans could hold two passengers (the driver and one other) and were used exclusively to bring workers and supplies to work sites. The old van was not a zero-emissions vehicle; however, the new van was a zero-emissions vehicle. Operating expenses included gas, auto insurance, vehicle license & registration. Zendor does not use the van for any personal purposes. He has a separate personal automobile that is not used for the business. None of the personal automobile’s costs are on the Excel file you were given. 5. Travel expenses (other than van): Because of the distance, Zendor stays overnight at a hotel in Kitchener when he does work there that will take more than one day. He eats his meals at local restaurants. In August 2024, Zendor flew to Vancouver to attended a three-day Electrician’s Convention at the Vancouver Heritage Hotel in Vancouver, BC. He attends this convention every year, as it is a good opportunity to catchup on the latest electrical devices and techniques. This year, Adam went with Zendor so that he could spend sometime exploring Vancouver. Zendor extended the stay at the hotel by two extra days to allow extra time to spend with his son. No meals were provided by the conference. Zendor spent $200 on meals each day in Vancouver. This was equally split between meals for himself and meals for Adam. 6. General Expenses: In 2024, Zendor paid for a membership in Electrical Contractor Association of Ontario. He also has a magazine subscription to Electrical Contractor Magazine (ECM). He made charitable donations to his church and to the Canadian Red Cross Society, both of which are a registered Canadian charities. He also made periodic donations to the New Liberal Conservative Party of Canada,a registered Canadian political party. He has a gym membership at an Athletic Club that requires monthly payments. He made occasional contributions to his RRSP. He remits quarterly Income tax instalments to CRA based on his Notice of Assessment. Instalments include the CPP for self-employed individuals. He chose not to participate in EI 7. Other: The following additional information relates to Zendor for 2024. He received non-eligible dividends from Pristine Products, Inc. and interest income on a savings account with Fortune National Bank. He received foreign dividends on shares he owns in Frontline Corporation, an American company. 22% foreign income tax was withheld on this dividend, and Zendor received the net amount. He recorded the Canadian dollar amount on his Excel file. He sold to his sister, Nancy, shares in Allister, Ltd. that he had purchased for $50,000. At the time of the sale, the shares had a FMV of $75,000. DETAILED INSTRUCTIONS 1. Ignore GST/HST/PST and Provincial Income Tax for this assignment. 2. Open the Excel file provided for this assignment. Goto Cell 1A of the Bank Transaction tab and add your name and student number. Now select the row that says Date, Account, and Amount. Under the Data menu at the top of your worksheet, select “Filter” to create filters at the top of each column. The data has some errors and needs to be cleaned. Click the filter arrow for the “Account” column and uncheck the “Select All” button. Next check the two “ Revenue …” accounts to filter the data to only show revenue accounts. All revenue amounts should be positive. Find three numbers that were entered as negative numbers. Make those numbers positive. Now remove the checks beside the Revenue accounts and select only Internet. There should have been 12 equal monthly payments, but an error was made one month. Find and fix the error. 3. Go back again to the filter arrow for the “Account” column and check the “Select All” button to make all the data visible again. Click OK. Now create a PivotTable. Click anywhere in the data. From the “Insert” menu, select “PivotTable” and ‘From Table/Range’ . In the PivotTable pop-up window, accept “New Worksheet” for the location for your PivotTable. Click OK. Change the tab name for your new worksheet to ‘2024’ and add your initials. For example, ‘2024-RAS’ . Add your name and student ID to Cell 1A. In the “PivotTable Fields” menu on the right-hand side of the page, put a check mark beside “Account” and “Amount” . [Note – you have to click on the PivotTable box in columns A – B to make the PivotTable Fields show up.] A PivotTable should have appeared that summarizes the total dollar values for each revenue and each expense account. Change the column heading from “Row Labels” to “Account” and leave the column heading that says, “Sum of Amount” . Format numbers so that they have a dollar sign, a comma, and no decimal places. Negative numbers should be shown with brackets, if you have that option on your computer. 4. Click on the PivotTable. From the PivotTable Analyze tab on the menu bar, select “Insert Timeline” . Put a checkmark in the box that says “Date” . Click OK. You will see a timeline that includes all the months for 2023, 2024, and 2025. Make sure that Months is chosen in the upper right corner of the timeline box. Expand the timeline box from the left and from the right so that the months of January through December 2024 can be seen. Select only these months by dragging the highlighted bar toward these months from both sides. This ensures that only current year transactions are included in your PivotTable. When only the months of 2024 have been selected and are visible in your timeline, take a screenshot of your timeline and paste it into Column B in the Analysis tab under Exhibit 1 – Timeline. Resize to fit the space provided. [Note: do not use copy and paste for the timeline – it has to be a screenshot or a picture.] 5. Go back to the 2024 worksheet. You should still seeyour Timeline box there. You can minimize it and click on it to drag it out of your way, but do not remove it. Filter the PivotTable using the arrow next to “Account” and uncheck the “Select All” box. Then check only the boxes next to the two “ Revenue …” accounts. You now have a PivotTable that shows the total for the revenue accounts for 2024. Copy and paste your PivotTable into Columns B and C of your Analysis worksheet under Exhibit 2 – Revenue for 2024. Do not use a screenshot for this part. Adjust columnwidth if needed. 6. Go back to the 2024 worksheet. Click on the PivotTable. Under the “PivotTable Analyze” option on the menu bar, click on PivotChart. Select pie chart. Click on your chart. Use the ‘+ sign’ by the upper right corner of the chart and pick format options you think are helpful. Add a descriptive title, and put your last name at the end of the Title to show that it was made by you. Use the paintbrush by the upper right corner to pick a colour that you like. Click OK. Take a screenshot of your pie chart and paste it into Column B of your Analysis Worksheet under Exhibit 3 – Pie Chart. Change the size as needed to fit comfortably. [Do not use copy and paste for this part, as that would make your charts change when you do the nextsteps.] (For Mac Users, under the “PivotTable Analyze” option on the menu bar, click on PivotChart. A bar graph will appear. To change Bar Graph into pie chart, select “Design” on the menu bar, select “Change Chart Type” and scroll down to “Pie” and select first option under 2D Pie Section.) 7. Go back to the 2024 worksheet. Move your chart out of your way, but do not remove it. Filter the PivotTable by clicking on the arrow next to “Account” at the top of the PivotTable and checking only the boxes next to home office expenses in accordance with information provided in the Meeting Notes. You will need to read carefully through the list of accounts. You should now have a PivotTable that shows all home office expenses for 2024. Copy and paste this PivotTable into Columns B and C in the Analysis worksheet under the heading Exhibit 4 – Home Office Expenses. Expand Column B if needed. The new office desk and chair replaced an old one with an original cost of $3,000, a UCC of $250, and afair market value of $0.00. The old desk and chair were donated to a local charity. Notice what has happened to your pie chart. 8. Go back to the 2024 worksheet. Filter the PivotTable by checking only the boxes next to van expenses in accordance with information provided in the Meeting Notes. Include the purchase of the van. You should now have a PivotTable that shows all van expenses for 2024. Copy and paste this PivotTable into Columns B and C in your Analysis worksheet under the heading Exhibit 5 – Van Expenses. 9. Go back to the 2024 worksheet. Filter the PivotTable by checking only the boxes next to travel expenses in accordance with the information provided in the Meeting Notes. You should now have a PivotTable that shows all travel expenses for 2024. At this point, some personal travel will be included. You will sort that out later. Copy and paste this PivotTable into Columns B and C in your Analysis worksheet under the heading Exhibit 6 – Travel Expenses. 10. Go back to the 2024 worksheet. Filter the PivotTable by checking on all the boxes next to general expenses in accordance with the information provided in the Meeting Notes. You should now have a PivotTable that shows all general expenses for 2024. Copy and paste this PivotTable into Columns B and C in your Analysis worksheet under the heading Exhibit 7 – General Expenses. 11. In Column D, beside Exhibit 4 through Exhibit 7, enter the amount that would be tax deductible for each line. In Column E show any calculations used to determine the deductible amount, or provide an explanation of your amount in Column D. For anything that requires CCA, add 0.00, and a note that CCA applies. 12. Under Exhibit 8 – Net Business Income, use the relevant subtotals from column D to calculate Zendor’s net business income. Complete any CCA calculations and add to your calculation. 13. Go back to the 2024 worksheet. Filter the PivotTable by checking on any accounts you have not included in the previous exhibits. Copy and paste this PivotTable into Columns B and C in your Analysis worksheet under the heading Exhibit 9 – Other Items. You will need to decide whether any of them should be used in your income tax calculations. 14. Now goto the last worksheet – Income Tax Payable. Use the net business income you have determined on the Analysis worksheet and any other information from the Meeting Notes and/or the Bank Transactions file to determine Zendor’s net income tax payable. Letter to Zendor: At the end of your meeting with Zendor, he asked you some important questions that he needs your help with. Please write a 200-to-300-word letter that answers his questions. Use 12-point font and single spacing. Use a professional format and tone. Remember that you are writing TO Zendor, not just about him. Direct your comments to him. 1) He would like to know • His income tax payable (or refund) for the year. If he owes any additional amount, when it needs to be paid. When his income tax return is due. • When Barbara’s income tax return is due. • When Janice’s income tax return is due. • Whether Adam needs to file a tax return, and if so, when it is due. He has heard that individuals with income below $15,000 do not need to file a tax return and would like you to clarify this. 2) As his business has grown, he is finding himself too busy and has been turning away profitable customers due to a lack of time. He is considering adding an assistant but is unsure how to structure his relationship with the assistant. He would like you to explain how to distinguish between an employee and a self-employed contractor. Please share three specific points with him. 3) Zendor has a friend, Lawrence, who has asked him to get some advice from you. Lawrence owns a cottage near Huntsville, Ontario that he rents out during summer months. He is planning to surprise his wife, Cheryl, by gifting her the cottage as a December holiday gift. He wants your advice on the most tax efficient manner to transfer the property. He also wants to know the tax consequences for any future rental income and for the eventual sale of the cottage for himself and for Cheryl. Is it possible for Lawrence to avoid all future tax implications related to the cottage? If so, please explain how this can be achieved. Lawrence has told you that no CCA has ever been claimed on the cottage.
ENME4332 Finite Element Analysis 1 Fall 2024 Final Project [100 points] 1 Project Description In this project, we will solve a steady-state heat conduction problem within an arbitrary 2D domain subjected to a combination of prescribed temperature and flux boundary conditions. As is shown in Fig. 1, this 2D structure consists of two parts made of different materials (material 1: gray; material 2: pink) with different conductance. Please note that the heat source s is applied to the inner subdomains highlighted in pink. The natural boundaries are highlighted in red and blue for inward and outward heat fluxes, respectively. The essential boundaries are highlighted in green. Please rigorously follow the dimensions shown in Fig. 1. With the origin of the coordinate system located at the left bottom corner, the center coordinates of the two circles are (0.4,0.7) and (1.6,0.7), and the radius is 0.1. The parameters a and b are unique values assigned to each student in a separate list. The strong form of the governing equations for this problem is as follows: 2 Abaqus Modeling Construct the 2D model in Abaqus and perform the following tasks: • Mesh the domain with linear triangular elements. • Consider two mesh sizes. The coarse mesh has around 250 - 300 elements, and the fine mesh has around 950-1000 elements. • Solve the problem with these two meshes separately. • Save the mesh details (nodal coordinates and element connectivity) for both mesh sizes into separate spreadsheets or text files for the subsequent usage in our own matlab code. 3 Matlab Implementation Write a MATLAB-based FEM program to solve the described problem, and this set of code has three major steps, namely pre-processing, processing and post-processing. In the pre-processing step, we will: Figure 1: 2D domain with boundary condition, source, and dimensions. Note that all the listed dimensions are in meters. • Define the material properties. • Read the mesh generated by Abaqus to construct the nodal coordinate matrix and element connectivity matrix. • We also need to label the essential/natural boundaries and flag the two subdomains. Then, in the processing step, we will: • Implement the element conductance matrix Ke (Eq. 8.10 in the textbook) and element flux matrix fe (Eq. 8.11) • Assemble the global conductance matrix K and flux matrix f • Apply essential boundary conditions and solve for the unknown temperature. 4 Post-processing and submissions With the solutions obtained with our own FEM code, perform the following tasks. Note: All the previously listed procedures are the hints that guide you through the project. The following questions are where your project will get accessed. Please organize your submission by answering each of the questions clearly with correct numbering. 1. Plot both coarse and fine mesh you generated and report the total number of elements. 2. Create 2D plots of temperature field T(x,y) with both coarse mesh and fine mesh results. Hint: Use the ’patch’command in MATLAB. 3. Plot the temperature T(x,y = 0.4) along the line y = 0.4m for both mesh sizes and compare with Abaqus results. Describe your observations. Hint: Use x coordinate as horizontal axis. On each graph, you will have four lines: MATLAB coarse, MATLAB fine, Abaqus coarse, and Abaqus fine. 4. Create 2D patch plots of flux magnitude |q|(x,y) and 2D arrow plots of flux at center of each element for both mesh sizes. 5. Plot flux magnitude |q|(x,y = 0.4) along the line y = 0.4m for both mesh sizes and compare with Abaqus results. Describe your observations. 6. Provide a better mesh strategy. Due date: 10-Dec-2024 Please submit a zip folder containing your answers in PDF and MATLAB code to Canvas.
Problem Set 3 This is the final homework assignment, which accounts for 60% of your final grade. Unlike the previous problem sets, you are required to collect the data on your own and conduct data analysis based on your collected data. You may work with other students. The maximum number of students per group is two. However, you can work on your own. Be sure to indicate with whom you have worked in your submission. Deadline: Dec 5, 2024 (HK Time 11:59 PM). There is a penalty for late submissions: 5% will be subtracted from the total mark for every additional day after the deadline. If you submit it after Dec 15, 2024, you will get a zero on this homework assignment. Reference Ang, A., Hodrick, R. J., Xing, Y., & Zhang, X. (2006). The cross-section of volatility and expected returns. Journal of Finance, 61 (1 ), 259-299. Background In this problem set, you will examine the pricing of volatility risk in the cross-section of stock returns, following the Journal of Finance paper Ang, Hodrick, Xing, and Zhang (2006) (thereafter, AHXZ (2006)). Specifically, we ask the following questions: Do the stocks with larger exposures to the volatility risk earn higher or lower average returns? To answer this question, we first need to find a measure of volatility exposure. Following AHXZ (2006), we consider the VIX index. The VIX index is constructed so that it represents the implied volatility of a synthetic at-the-money option contract on the S&P100 index that has a maturity of 1 month. It is constructed from eight S&P100 index puts and calls and takes into account the American features of the options contracts, discrete cash dividends, and microstructure frictions such as bid-ask spreads. Because the VIX index is highly serially correlated with a first-order autocorrelation of 0.94, we measure daily innovations in aggregate volatility by using daily changes in VIX, which we denote as ΔVIX. There are three parts in this problem set. PartI. Main Findings of AHXZ (2006) In this part, you need to summarise the main findings in AHXZ (2006). Please list the two findings that you think are the most important (there are more than two, but you do not have to list all of them). For each key finding, please provide an economic explanation of the empirical phenomenon. Part II. Collecting Data The monthly and daily individual stock data come from CRSP, accounting data come from COMPUSTAT, and data on the CBOE implied volatility index, VIX, come from the FRED St Louis. To be clear, AHXZ (2006) use the SP100-based implied volatility index, which has a ticker of VXO, for all tests reported in this paper. You can download the Fama-French three factors (market, size, and value factors) from Ken French's website. I provide some useful links to several datasets at the end of this document. Your first task is to download all the data and load the datasets using pandas . After that, you need to report (1 ) which datasets you use in this problem set and why you need them, (2) how you preprocess the data (e.g., dropping samples based on some requirements, handling missing data, merging datasets, etc.), and (3) how many firms per year your final sample has in the panel data of stock returns. Part III. Pricing Aggregate Volatility Shocks To measure the sensitivity to aggregate volatility innovations, you are required to run the following regression: rt(i) = β0(i) + βM(i)KT−RF ⋅ MKT − RFt + βΔ(i)VIX ⋅ ΔVIXt + ϵt(i) , where: . MKT-RF is the daily market excess return, · ΔVIXt is the daily change in the VIX index, and · βM(i)KT and βΔ(i)VIX are firm i's loadings on market risk and aggregate volatility risk, respectively. You need to run the above regression with daily data for each stock per month. Specifically, for each month, you run the regression for all stocks on AMEX, NASDAQ, and the NYSE, with more than 17 daily observations and obtain the monthly estimates of βM(i)KT and βΔ(i)VIX . In this step, you will need to use the CRSP daily stock return data and also the market and VIX daily data. At the end of each month, you sort stocks into quintiles based on the value of the realized βΔ(i)VIX coefficients over the past month. Firms in quintile 1 have the lowest coefficients, while firms in quintile 5 have the highest βΔ(i)VIX loadings. Within each quintile portfolio, we value-weight the stocks. We link the returns across time to form. one series of post-ranking returns for each quintile portfolio. In this portfolio sorting step, you should use the CRSP monthly stock return data. Your task is to replicate the empirical results in Table I of AHXZ (2006). Please only replicate the numbers in the following attached table. . The first two columns report the mean and standard deviation of the monthly total, not excess, simple returns. . The column labelled % Mkt share shows the percentage of market cap for all the stocks in each quintile. . The columns labelled size and B/M show the average log market capitalization and book-to-market ratio for firms within the portfolio (You do NOT need to replicate these two columns). . The columns labelled “CAPM Alpha” and “ FF-3 Alpha” report the time-series alphas of these portfolios relative to the CAPM and to the FF-3 model, respectively. · The final column reports the pre-formation βΔ(i)VIX coefficients, which are computed at the beginning of each month for each portfolio and are value-weighted. The sample period in AHXZ (2006) is from January 1986 to December 2000. However, I require you to conduct the same data analysis in the out-of-sample, January 2001 to December 2020. Does the long-short portfolio (marked as 5-1 above) have similar performance in the more recent sample from January 2001 to December 2020? How do you interpret your findings? Caveat: It is impossible to get exactly the same numbers as in the original paper.
COMPT6030: Software Engineering (Semester 1, 2024-2025) Coursework Specification Software Engineering of a Modern Computer Application 1 Assessed Learning Outcomes This coursework counts as 100% of the total assessment of this module. It is designed to assess your attainment of the following learning outcomes. 1 Demonstrate an understanding of the software lifecycle and be able to critically analyse a problem to decide on a relevant process model. 2 Demonstrate an understanding of the role of risk in a project and be able to identify and manage both risk and the impact of change on a project. 3 Demonstrate an understanding of the role of requirements analysis and elicitation and the relationship between requirements and design and use this knowledge to be able to create functional and nonfunctional requirements for a project. 4 Be able to critically evaluate and utilise design paradigms of object-oriented analysis and design, component-based design, and service-oriented design. 5 Describe and employ software techniques, in the implementation of designs to achieve desired software quality including reliability, efficiency and robustness. 6 Understand and be able to apply a range of testing methods and techniques. 7 Use refactoring in the process of modifying a software component. 8 Understand how software reliability contributes to system reliability and be able to apply multiple methods to develop reliability estimates for a software system. 2 The problem to be solved In this coursework, you are required to work in a group of 4 students as a software engineering team to develop a given modern computer application by applying appropriate software engineering methodology and technologies. Each member of the team will conduct software engineering activities for developing one subsystem and collaborate with the other members of the team to ensure that these subsystems are integrated and interact with each other to form. a consistent system. A brief description of the specific application is given in the document COMP6030-CW-Case Study, which is available on the module’s Moodle website. You are required to perform. a series of software engineering tasks specified in Section 3 and to produce a set of software engineering documents in order to demonstrate: (a) you understand the principles of software engineering methodologies, (b) you are capable of selecting and applying appropriate software engineering techniques, and (c) you have the skills of using advanced software engineering tools. 3 Tasks to do The following specifies the tasks to be completed in this coursework and the distribution of marks in the assessment. A more detailed marking scheme is given in the file COMP6030-CW-Detailed Marking Scheme, which is also available on the module’s Moodle website. Task 0: Organisation of the Team and Project Management The students are required to form. a team by themselves with four members from the class. The team must set up a management scheme and a collaboration mechanism and work closely throughout the whole semester as a software engineering project. Each team must set up a GitHub repository for the coursework project to host the documents of the project. The team must meet regularly (for example, at least once a week) at a fixed days and times. Each meeting should have an agenda before the meeting and a minute to record the meeting contents, especially, the attendances to the meeting, progress since the previous meeting, a list of actions to take place and issues to be solved. The meeting agendas and minutes must be uploaded to GitHub immediately after it is created. Each member of the coursework team must be responsible to the development of one the following subsystems: (a) ClaClo-Student: a subsystem for students to receive information and learning materials as well as to do exercises and conduct and/or submit assessments works. (b) ClaClo-Teacher: a subsystem for teachers to assign exercises and coursework to the students, to receive and mark student works (include exercises and assessments) and provide feedback to the students. (c) ClaClo-Admin: a subsystem for administrators of courses. (d) ClaClo-Manager: a subsystem for university managers to manage the curriculum of the university. Note: The members of the team should work on different subsystems, while the whole team should develop a coherent system where the subsystems interact with each other. Each subsystem will inevitably have two parts: one part on the user’s computer or mobile device and another part running on servers on the cloud. The parts on the Cloud that belong to different subsystems should be properly integrated so that they interact with each other to enable functions to deliver to various types of users. Moreover, there may well be components running on the Cloud common to more than one subsystem and/or do not belong to any specific subsystem. The team should also work together to perform. the software engineering activities in order to develop such common components. Task 1: Specification and Modelling Software Functional Requirements (20 Marks) In this task, you will work as a requirements analyst in the project to produce a UML model of the software system to be developed using a software modelling tool. The UML model should contain the following types of models. (a) Use Case Model (10 Marks, Individual effort): Each member of the team should develop one Use Case Diagram to define the use cases of the subsystem to specify the scope of the software engineering project. (b) Activity Model (10 Marks, Individual effort): Each team member should select one use case of your subsystem to produce one Activity Diagram for the selected use case to specify the interactions between a user and the subsystem. Task 2: Software Architectural Design (30 Marks) In this task, you will work as a software architect to produce an Architectural Design of the system in the microservices architectural style. The design should be at two different abstraction levels as follows. (a) Architecture of the subsystem (15 Marks, Individual effort): Each member of the team should produce an architectural design of your subsystem with focus on the microservices your subsystem provides and the microservices that your subsystem requests and other subsystems provides. (b) Architecture of the whole system (15 Marks, Team effort): The team should produce an architectural design of the whole system through integrating the subsystems together. Note: a. You should specify the architectural designs in the UML component diagrams with a set of component nodes to represent microservices and a set of interfaces to represent the connectors between them. b. The components and connectors, including their methods and parameters, should be specified in a textual documentation to define their functionalities and meanings. c. In this part of the design, you are not required to give the internal structure of the components and connectors. Task 3: Software Detailed Design (20 Marks) In this task, you will work as a software designer to produce a Detailed Design of the system for object-oriented implementation of the components (i.e. the microservices) in your architectural design of the subsystem. The design should specify the components from both structural and behavioural aspects in UML. (a) Structural Model (10 Marks, Individual effort): Each student should select one component in the architectural design of your subsystem and develop a Class Diagram to define the structure of the component. Note: a. The selected component must be in the architectural model of your subsystem, but not in any other subsystems. b. The UML class diagram must contain the classes and relationships between them. You must give the attributes and methods of the classes. (b) Behaviour Model (10 Marks, Individual effort): Each student should produce a Sequence Diagram for the same component selected in Task 3(a) to define the dynamic behaviour of the component. Note: a. The sequence diagram should specify the internal process of the interactions between the objects inside the component. It must be consistent with the structural model that you produced in Task 3(a). b. The behaviour model must cover all possible scenarios of the operations of the component using advanced modelling facilities such as frames. Task 4: Software Testing (30 Marks) In this task, you will work as a software quality engineer to develop a Software Test Plan. Your test plan should consist of two parts: (a) Unit test plan (15 Marks, Individual effort): You should select one microservice in your subsystem to develop a unit test plan. Note: a. The unit test plan should aim at adequate testing of the same component (i.e. one microservice) that you have developed the structural model in Task 3(b). b. It should include a set of test cases that adequately cover all services and corresponding responses of the selected microservice. (b) System test plan (15 Marks, Individual effort): You should select one use case to develop a system test plan. Note: a. The system test plan should aim at testing your subsystem on the same use case that you selected in Task 1(b). b. It should contain test cases that cover all different scenarios of the use case. 4 Submission of Coursework 4.1 When to submit The submission deadline is at 23:00pm on 6th Dec. 2024 (Friday of Week 11). 4.2 What to be submitted Each group should submit one compressed (zip) file that contains a set of files listed in the table below. The file names and their contents to be included in the coursework submission must follow the convention given in the table below. Note: The text in red ink below should be replaced by your coursework group number. Table 1. Files to be included in submission File name Format Example Content COMP6030_CW_ Gxx.zip Zip file COMP6030_CW_G01.zip The zip file should contain all the files of the coursework submission, where Gxx is your coursework group number. Cover_Gxx.pdf PDF Cover_G01.pdf The standard group coursework cover page. TeamPart_Gxx.pdf PDF TeamPart_G01.pdf It should contain the work of Task 2(a), i.e. the architectural design of the whole system, including the UML component model and the textual documentation of the design. Member_Gxx_StdNum1.pdf PDF Member_G01_1900001.pdf The work of student 1900001, including one UML use case diagram, one UML activity diagram, one architectural design of the subsystem in UML component diagram, one UML class diagram for one component of the subsystem, one UML sequence diagram for the same component of the subsystem, one unit test plan, and one system test plan. Member_Gxx_StdNum2.pdf PDF Member_G01_1900002.pdf The work of student 1900002; See above. Member_Gxx_StdNum3.pdf PDF Member_G01_1900003.pdf The work of student 1900003; See above. Member_Gxx_StdNum4.pdf PDF Member_G01_1900004.pdf The work of student 1900004; See above. ● Your files must be formatted as follows: ❑ It must be word-processed in 11-point Arial font and single-spaced ❑ All pages must be numbered ❑ Margins must be 1 inch on top, bottom, and both left and right sides of the paper ❑ All pages must in A4 size ❑ Student numbers must be entered on the cover page and state which subsystem is developed by which student. ❑ The files should not contain your name(s). Please note that you are required to cite the work of others used in your solution and include a list of references using the university recommended referencing style. Please refer to university’s regulation on academic conduct and plagiarism. If you have used AI empowered tools, you must declare how you have used it in the coursework. 4.3 Where to submit You must upload one zip file containing all components to the module's Moodle website. The original editable files must be uploaded to GitHub with all the history of updating the artefacts. 4.4 Feedback on your coursework ● The formal summative feedback on your coursework will be provided within 2 weeks after your submission of the coursework. ● Informal verbal feedback can be obtained from the lecturer during the delivery of the module during practical classes. The students are encouraged to show their work to the lecturer and seek comments and advice.
CFS Economics GROUP RESEARCH PRESENTATION (10%) In your assigned group you will make a MP4 video, using Microsoft PowerPoint, that explores an externality of a product. Group Presentation Objective: • To work collaboratively to explore and research one product that is either produced or consumed that creates either a positive or negative externality of consumption or production. • To use your knowledge of externalities to explain the concept of market failure and illustrate this concept using relevant economic graphs. • To explain, using real world solutions, how externalities can be internalised, illustrating this concept using relevant economic graphs. • To evaluate the effectiveness of the internalisation strategies you have identified. The product you choose to complete this assessment must NOT relate to cigarettes / beekeeping / factory air pollution. CONTENT: Your Microsoft PowerPoint presentation should include: (The following slide pages are examples, you don’t have to follow the same) • Introduction o Slide 1: Title Page. o Slide 2: Identify the students contributing to the video presentation. o Slide 3: Identify the product and the externality you will investigate. For example: education - positive externality of consumption, or hydroelectricity - positive externality of production. • Part A o Slide 4: Define the term ‘externality’ . o Slide 5: With reference to your chosen externality, identify the third party involved and explain the spillover cost or benefit. o Slide 6: Research and explain the extent of the spillover cost or benefit by providing some relevant, up-to-date research. For example: research data on the benefits of educating young people up to the age of 18 years of age in NZ /research data on greenhouse gases in NZ. Acknowledge the source of this research in your presentation. • Part B o Slide 7: Define market failure. o Slide 8: Graphically represent the externality of your product. Clearly label all relevant parts of your graph. o Slide 8: Explain, with reference to your graph, the market failure occurring. • Part C o Slide 9: Graphically represent government internalisation of externality, explain the method of internalisation refer to the graph. o Slide 10: Explain the advantages and disadvantages of the above method of internalisation. o Slide 11: Research and explain a second method of internalisation that currently use or could be used by the government to internalise the externality. o Slide 12: Explain the advantages and disadvantages of the second method of internalisation. • Reference List o Microsoft Word File: Provide a reference list using APA format (7th Edition) for your sources of information. This Microsoft Word File also needs to be submitted to Teams Assignment. o Final Slide: Copy and paste the reference list using APA format (7th Edition) from the Microsoft Word File to the last slide of your Presentation. MICROSOFT POWERPOINT VIDEO (MP4): Your video should: • Include a narrative from all members of the group. Every member of the group must present on the video. • State the name of the group member presenting on every slide. • Use a common theme throughout your PowerPoint presentation. Save your PowerPoint file in your Teams - Group Presentation channel to allow all members of the group to access the same PowerPoint. • Include images / research data / news articles - all sources should be acknowledged. Use Unsplash or Pixabay to find suitable images that do not require attribution. • Include relevant economic graphs, you need to draw the economic graphs digitally and cannot screenshot from of any the material. • Provide at least two pieces of relevant, up-to-date research related to the externality you have chosen. For example: economic data or newspaper articles. • Use topic related economic language. • Use proper presentation skills, use appropriate annotation or animation. • Include a Reference List acknowledging the source of your information, using APA format (7th Edition). At least two sources are required in your reference list. Length: Your presentation should be between 4-8 minutes - no longer. Research: • All students have free access to the NZ Herald Premium edition while using internet access at school:https://www.nzherald.co.nz/ MICROSOFT WORD REFERENCE LIST: Microsoft Word should: • Include a reference list using APA format (7th Edition) for your sources of information. RECORDING IN MICROSOFT POWERPOINT Check that your ribbon in PowerPoint includes RECORD on the ribbon. Record Tab If your ribbon does not have the RECORD function go to: File Options Customise Ribbon Tick - Record GROUP FORMATION & GUIDELINES • Your teacher will not entertain any request for group members to change. One of the objectives of the assignment is to learn to work with members of a team to complete a piece of collaborative work. • Your group should allocate tasks and share the workload. • You must upload your Microsoft MP4 file and Microsoft Word file into Teams - Assignment by the deadline. • Your group will be assessed on the Microsoft MP4 file submitted in Teams Assignment. • Read the RUBRIC mark scheme carefully - this states how you will be assessed. SUBMISSION DETAILS • Upload your Microsoft MP4 file and Microsoft Word into the Assignment set up in Teams. • Late submissions will be penalised. 24 hours late 10% 48 hours late 20% 72 hours late 30% More than 72 hours late 0%
Department of Electronic and Information Engineering EIE2111 Lab 3: Control Statements (Part 1) Introduction This laboratory exercise is designed to give you hand-on experience in Control Statements (Part 1). Questions 1. One large chemical company pays its salespeople on a commission basis. The salespeople each receives $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who sells $5000 worth of chemicals in a week receives $200 plus 9 percent of $5000, or a total of $650. Develop a C++ program that uses a while statement to input each salesperson’s gross sales for last week and calculates and displays that salesperson’s earnings. You should process one salesperson’s figure at a time. If the input is -1, the program should exit. 2. Write a program that reads the side of a square and then prints a hollow square of that size out of asterisks and blanks. Your program should work for squares of all sides between 1 and 20. 3. A company wants to transmit data over the telephone, but is concerned that its phones could be tapped. All of the data are transmitted as four-digit integers. The company has asked you to write a program that encrypts the data so that it can be transmitted more securely. Your program should read a four-digit integer and encrypt it as follows: Replace each digit by (the sum of that digit plus 7) modulus 10. Then, swap the first digit with the third, swap the second digit with the fourth and print the encrypted integer. Write a separate program that inputs an encrypted four-digit integer and decrypts it to form. the original number. 4. The factorial of anon-negative integer n is written n! and is defined as follows: a) Write a program that reads anon-negative integer, and computes and prints its factorial. b) Write a program that estimates the value of the Mathematical constant e by using the formula Prompt the user for the desired accuracy (i.e., the number of terms in the summation). c) Write a program that computes the value of ex by using the formula Prompt the user for the desired accuracy (i.e., the number of terms in the summation). 5. Combine the above four programs into one. The following is the sample output: Instructions a. You are required to submit your C++ programs (the whole projects created in Microsoft Visual Studio 2019) in Question 5 to Blackboard. Zip all of them into a single file. b. The deadline of the submission: Check the course information. c. It is not required to create any classes or header files for the above exercises. It is fine if all program codes are in the main program.
CS 4321/5321 Project 4 This project is out of 75 points and counts for 22% of your grade. 1 Goals and important points In this last Project, you will bring together the work you did in Projects 2 and 3 and you will add optimization functionality to your interpreter. • you will add code that gathers statistics about the data, in order to allow informed optimization. • you will improve your query plan by pushing selections in a more thorough way than previously. • you will implement an algorithm that chooses the join order for each query rather than following the order in the FROM clause. • you will implement algorithms/heuristics to choose the best implementation for each selection and each join operator in your improved query plan. You do not have to do any further optimizations, such as pushing projections. The goal in this Project is not to develop a full-fledged optimizer, but to focus on a subset of important optimization techniques. You will still support the same subset of SQL as in the previous Projects and should follow the same specification for sorting (ORDER BY). In addition, if a query has a SELECT * and multiple tables in the FROM clause, you should return columns in the order specified by the FROM clause. For example in SELECT * FROM R,S,T WHERE . . . return the columns of R followed by the columns of S followed by T. This ordering happened “naturally” in previous projects because your join tree followed the FROM clause; in this project you will be changing the join order so you need to explicitly enforce the above behavior for SELECT *. 2 Input and output formats The format for input and output is the same as in Project 3, with the following exceptions. First, the PhysicalPlanBuilder configuration file is no longer needed. Previously, you told the plan builder whether to use indexes, and what implementation of join to use. Now, the plan builder will make those decisions by itself. You may hard-code in the PhysicalPlanBuilder the choice of sorting algorithm (use external sort unless you were not able to implement it) as well as the number of buffer pages to be used for BNLJ. Second, you need to gather and write statistics about your data in a stats .txt file. This will sit directly inside the db subdirectory, at the same level as schema .txt and index info .txt. stats .txt contains information on each relation, namely the number of tuples in the relation, and for every attribute, the minimum and the maximum value that this attribute takes. A sample file is given below: Reserves 10000 G,0,5000 H,10,10000 Boats 5000 D,10,500 E,10,500 F,10,500 The first line of this file states that relation Reserves has 10000 tuples, with the values of attribute G ranging from 0 to 5000, and the values of H ranging from 10 to 10000. The attributes are listed in the same order as in the schema .txt file, and for each attribute the attribute name, the min and the max values are separated by commas. The lines in the file may be in any order. We will not test your code with databases containing empty relations, so you do not have to worry about the format of the statistics when a relation is empty. Finally, the configuration file for the interpreter is simplified. It will now only contain three lines, with the input, output and temporary sort directories. You are basically passing it the same information as you did in Project 2, but since you had an interpreter config file in Project 3, we chose to keep this information in the interpreter config file for Project 5 rather than go back to command line arguments. When your interpreter is run, it should gather statistics as described above, build indexes based on the index info .txt file, and execute the queries. In addition to printing out the answers, it should also print out both the logical and physical query plans to the output directory. The logical plan for the ith query goes into file queryi logicalplan and the physical plan goes into the file queryi physicalplan. Thus your output directory will contain three different files per query: the file with the physical plan, the file with the logical plan, and the file with the actual results. The formats for printing out the logical and physical query plans are described next. 2.1 Formats for logical and physical query plans This section explains the format for physical and logical query plans. It should be skipped on first reading; return to this section after you understand the specific structure of the logical and physical query plans we expect, so that you understand e.g. what a union-find is and what it is doing inside a logical join operator. We will be grading your plans through a combination of manual and automated grading; while there is some flexibility in the formats as explained below, you should follow it as closely as possible, since blatant disregard for the format will attract point deductions. The format to be used for the logical plans is illustrated by the following example. Consider the query SELECT DISTINCT S .A, R.G FROM Sailors S, Reserves R, Boats B WHERE S .B = R.G AND S .A = B.D AND R.H B.D AND R.H < 100 ORDER BY S.A; This gives the following logical query plan: DupElim -Sort[S.A] --Project[S.A, R.G] ---Join[R.H B.D] [[S.B, R.G], equals null, min null, max null] [[S.A, B.D], equals null, min null, max null] [[R.H], equals null, min null, max 99] ----Leaf[Sailors] ----Select[R.H 50, S .C > 50, S .C 5 AND S .B > R.A you could infer S .B > 5 or even possibly S.B > 6; however, this kind of constraint propagation adds sufficient complexity that you are not required to implement it. In addition, queries that compare attributes by something other than equality are quite rare, and in practice it makes the most sense to optimize the common case. You are also not required to do anything about constraints using a not-equals ( != or ) operator. If you have a comparison such as R.A 5 you are not required to propagate it to any other attributes, and if you have a comparison such as R.A R.B or R.A S .B you are not required to propagate any other constraints through it. Thus, we distinguish between usable comparisons and unusable comparisons in the WHERE clause. A usable comparison is an equality comparison between two attributes or any comparison between an attribute and a value that does NOT use (or ! =). Any other comparison is unusable. 3.2.2 Implementing selection pushing with union-find To propagate selections through equalities, you need to implement and use a union-find data structure. This is also known as a disjoint-set data structure and is described online in various sources. Fundamentally, a union-find is a collection of elements which are disjoint sets. The idea is that you will partition all attributes that are featured in some usable comparison the WHERE clause into subsets based on equality constraints between them. The union-find allows you to keep track of this partitioning. E.g. if you have WHERE R.A = R.B and S .C = T.D AND T.D = U.F then your union-find will have two elements, the first containing R.A and R.B, and the second containing S .C, T.D and U.F. In every union-find element, you will also keep track of three numeric constraints: any known lower bound for every element in the set, any known upper bound, and any known equality constraint. If there is a known equality constraint, the lower and upper bound must be set to that equality constraint as well. Your goal is to process the WHERE clause and build up a union-find; once your processing is done, the union-find contains all the information you need to push selections. For our example clause from before, R.A < 100 AND R.A = R.B AND R.B = S.C AND S.C > 50 AND S.D = 42 AND S.D = T.F, your union-find that you build should look like this: Every blue box is a single element in the union-find. Now, how do you build the union-find from the WHERE clause? Start by writing a class that implements a union-find data structure. It should contain a collection of elements, where each element consists of a set of attributes and three numeric constraints. The API you need for your union-find is as follows: • given a particular attribute, find and return the union-find element containing that attribute; if no such element is found, create it and return it. • given two union-find elements, modify the union-find data structure so that these two elements get unioned, i.e. merged. • given a union-find element, set its lower bound, upper bound, or equality constraint to a particular value. Now, write a visitor that walks the WHERE clause and builds up a union-find. It should process each comparison as follows: • if the comparison has the form att1 = att2, find the two elements containing att1 and att2 and union them. • if the comparison has the form att OP val, where val is an integer and OP is =,, find the element containing att and update the appropriate numeric bound in the element • if the comparison has any other form, it is an unusable comparison; put it aside for separate processing later as it does not go into the union-find. At the end of this process, you have a union-find that captures a lot of constraints. You may also have some “residual” unusable comparisons. You may assume we will not give you “bad” where clauses which would generate inconsistent constraints of any sort (e.g. R.A = 1 AND S.B = R.A AND S.B = 2), and that all comparisons in the WHERE clause will involve one or two attributes. That is, you will not encounter comparisons of the form val1 OP val2 with val1 and val2 both integers. 3.2.3 Bringing it all together Now you are ready to use the union-find to generate a logical query plan with fully pushed selections. For every child of the logical join use the union-find to retrieve all numerical bounds/constraints that apply to attributes of that child. Make a selection operator with those constraints. In addition, make sure to add to that selection any “residual” unusable comparisons that couldn’t go into the union-find and that relate just to that child. This leaves you with some state that needs to be placed inside the logical join operator. This state is the union-find data structure which you will need later, and any residual unusable comparisons that connect attributes from different tables. For example, for the query SELECT * FROM R, S, T, U WHERE R.A U.B AND R.A = S .B AND S .C = T.D AND R.A = 2 AND T.D = T.X AND U.Y 42 You want the following logical query plan: Note that the R.A U.B is not the whole join expression, it is just the remaining unusable comparison that will have to go into a join somewhere but did not make it into the union-find. In summary, the overall structure of your logical plan should now be as follows (all operators are optional except at least one leaf). The topmost operator is a duplicate elimination operator, followed by a sort, a projection, and a single logical join operator. The children of the join are selections or leaves as appropriate. 3.3 Choosing selection implementations Now that you have an optimized logical plan, the rest of your work will be in the physical plan builder. As mentioned in Section 2, the PhysicalPlanBuilder configuration file is no longer needed. Previously, you told the plan builder whether to use indexes for selections, and what implementation of join/sort to use. Now, the plan builder will make those decisions by itself. You may hard-code in the PhysicalPlanBuilder the choice of sorting algorithm (use external sort unless you were not able to implement it) as well as the number of buffer pages to be used for BNLJ. Your next task is to have your PhysicalPlanBuilder choose an implementation for each selection. This is simliar to what you did for Project 3, except that now you may have multiple indexes to choose from and you need to pick the best access path (index or scan) based on estimated cost. For each selection and each available access path, you should estimate the cost in number of I/O’s. For the scan, you can estimate the cost by asking your friendly database catalog how many tuples the base table has, multiplying by the size of one tuple, and dividing that by the page size which is still 4096 bytes. For using an index, estimate the cost as follows. Start by computing the reduction factor for the portion of the selection that is handled via the index. This is the range of values being selected divided by the total range of values for the attribute. For example if your selection condition contains R.A >= 10 and R.A
MATH36031 Project 3 - deadline 13th December 2024, time 1100hrs. For this project you need will need to download the bananas. csv file on Blackboard, and it will located in the Projects folder in the Project 3 section. This is a very large datafile with more than 13000 entries, so do not try to print the file! The first few lines of the file are as shown in figure 1. The Origin denotes the country or region of origin of the bananas. The Figure 1: The first few lines of the bananas.csv file. Date header shows the date and the Price column the cost in pounds sterling for a kilogram of bananas. You will notice that there are entries with the country of origin as ‘all bananas’ which is an average of the collective data for that date. You need to process the file using MATLAB to answer the following questions: 1. From the data produce a list of the distinct entries under the Origin header (for example something like columbia costa rica honduras panama guatamala for the sample in Figure 1). 2. Banana prices fluctuate a lot during the year. From which region is the average price lowest, and for which region is the average price highest. The average here is defined as the mean of the prices taken over the data for that region. 3. Produce a boxplot comparing the variation of the prices of bananas with countries of origin ‘colombia’, ‘costa rica’, ‘honduras’, ‘windward isles’ and ‘all bananas’, and com- ment on your results. 4. Produce a time series plot showing the variation of the prices of bananas with countries of origin ’colombia’ . Analyze the time series and comment on any seasonal trends. 5. Use the MATLAB corrcoef function to calculate the correlation coefficient between the fluctuation of ’columbia’ and ’ecuador’ prices and comment on your results. Outputs required You are required to submit a report (maximum 8 pages including any appendices) in pdf form. via the Turnitin submission box on Blackboard. Additionally you need to submit your m-files or mlx-files used for the MATLAB codes via the Blackboard Submission Box also on Blackboard. Additional information and guidelines 1. All coding must be done in MATLAB. 2. Keep to the page length not exceeding eight A4 pages, and there is no need for a title page or abstract for a relative short report like this. Font sizes should be no smaller than 11 point, and page margins no smaller than 2cm. 3. List the complete code of the whole function at the end of each question, or in an ap- pendix. Make your source code more readable, by keeping the indentation and stylistic features, and it can be copied from your submitted work. Codes submitted should be the same as those in the report. Your published results should be reproducible from the code attached. 4. Have a look at the generic rubric about how your report will be marked, and also the intended learning outcomes about what you are expected to achieve in the end. 5. Avoid copying (too many) sentences directly from the project description, and try to restate the problem with your own words or examples if possible. 6. You may use your report in the future as evidences of written work, so take it seriously. 7. Your target audience is a fellow student on your course: explain the questions so that the report can be understood without this project description and your approach could be implemented in another computer language like Python. The report should indicate to the reader how well you understand the problem and the approach you took. Your goal will be to communicate your solutions to another person rather than to show you’ve completed the assignment. 8. Balance the explanation of the approach and the comments in the code. Avoid under- commenting and over-commenting. 9. Aim for precision and clarity of writing. 10. Since there is no final exam, you are advised to spend at least 15 hours on each project, with additional self-study if you are less experience with computer programming. Re- member for a 10 credit module like this one, you are expect to spend 100 = 10 × 10 hours in total (including lectures, labs, self-study and coursework). 11. Please do not put any personal information on the report, only your student ID number. 12. The submission for each project will be open two weeks before the deadline. Only your last submission will be marked, and anything submitted after the deadline will be treated late and any penalty will be applied by the Teaching and Learning O ce in June according to the Undergraduate Student Handbook. 13. Whilst this project can be done without the use of any artificial intelligence (AI) software tools, if you use any AI tools or software to help you with your project, you must mention this in the report. Please study the guidelines at https://manchester-uk.libanswers.com/teaching-and-learning/faq/264824 on how to do this correctly. The content and accuracy of the report will be your responsibility alone, and any factually incorrect statements or mathematically incorrect content will be penalised. 14. Your attention is also drawn to to the University’s Academic Malpractice Policy, see https://documents.manchester.ac.uk/display.aspx?DocID=639. See also the guide- lines on the use of AI via the course on Academic Integrity at: https://www.education.library.manchester.ac.uk/mle/academic-integrity/ 15. We are obliged to report cases of suspected academic malpractice, and people may be subject to an additional oral assessment on the content of the report and codes submitted.
CS-350 - Fundamentals of Computing Systems Homework Assignment #8 - EVAL Due on November 14, 2024 — Late deadline: November 15, 2024 EoD at 11:59 pm EVAL Problem 1 In this EVAL problem, we will study how the nature of input requests can impact the parallelism that can be exploited in multi-threaded applications. a) Let’s start easy for this part of the assignment and establish a clear evaluation methodology and baseline. In particular, we will define a base request pattern and then gradually extend it to understand how the server runtime is impacted. For this part, we will test with only one worker, but the same exact client input scripts you generate for this part will be used for the next part. The base command template to use for this part is the following: /usr/bin/time -v ./server_mimg -q 1500 -w 1 -p FIFO 2222 & ./client 2222 -I ./images/ -L This command assumes that both server_mimg and the client (v4.2!) are in the same current folder, and that the images folder contains ALL the test images, including all the cute cat BMPs!. There should be a total of 16 images in there. The will be comprised of three parts: (1) Intro, (2) Mid, (3) Outro. Intro and Outro will not change, but we will progressively enxted the Mid section of the script. Be careful about not omitting the comma “,”at the end of these pieces when concatenating Intro, Mid, and Outro. (1) Intro (register 10 images): 0:R:1:6,0:R:1:7,0:R:1:8,0:R:1:9,0:R:1:10,0:R:1:11,0:R:1:12,0:R:1:13,0:R:1:14,0.5:R:1:15, (2) Mid (repeating pattern): 0:r:1:0,0:b:1:0,0:s:1:0,0:v:1:0,0:h:1:0,0:r:1:0,0:b:1:0,0:s:1:0,0:v:1:0,0:h:1:0, 0:r:1:1,0:b:1:1,0:s:1:1,0:v:1:1,0:h:1:1,0:r:1:1,0:b:1:1,0:s:1:1,0:v:1:1,0:h:1:1, 0:r:1:2,0:b:1:2,0:s:1:2,0:v:1:2,0:h:1:2,0:r:1:2,0:b:1:2,0:s:1:2,0:v:1:2,0:h:1:2, 0:r:1:3,0:b:1:3,0:s:1:3,0:v:1:3,0:h:1:3,0:r:1:3,0:b:1:3,0:s:1:3,0:v:1:3,0:h:1:3, 0:r:1:4,0:b:1:4,0:s:1:4,0:v:1:4,0:h:1:4,0:r:1:4,0:b:1:4,0:s:1:4,0:v:1:4,0:h:1:4, 0:r:1:5,0:b:1:5,0:s:1:5,0:v:1:5,0:h:1:5,0:r:1:5,0:b:1:5,0:s:1:5,0:v:1:5,0:h:1:5, 0:r:1:6,0:b:1:6,0:s:1:6,0:v:1:6,0:h:1:6,0:r:1:6,0:b:1:6,0:s:1:6,0:v:1:6,0:h:1:6, 0:r:1:7,0:b:1:7,0:s:1:7,0:v:1:7,0:h:1:7,0:r:1:7,0:b:1:7,0:s:1:7,0:v:1:7,0:h:1:7, 0:r:1:8,0:b:1:8,0:s:1:8,0:v:1:8,0:h:1:8,0:r:1:8,0:b:1:8,0:s:1:8,0:v:1:8,0:h:1:8, 0:r:1:9,0:b:1:9,0:s:1:9,0:v:1:9,0:h:1:9,0:r:1:9,0:b:1:9,0:s:1:9,0:v:1:9,0:h:1:9, (3) Outro (retrieve 10 images): 0:T:1:0,0:T:1:1,0:T:1:2,0:T:1:3,0:T:1:4,0:T:1:5,0:T:1:6,0:T:1:7,0:T:1:8,0:R:1:9 For the first run, concatenate Intro, Mid, and Outro with no spaces between them. For the second run, concatenate Intro, 2× Mid, and Outro. For the third run, concatenate Intro, 3× Mid, and Outro. And so on, up to a total of 10 runs. The last run will have a script. comprised of Intro, 10× Mid, and Outro. Now, plot the total runtime of each run on the y-axis and the number of times the Mid section was repeated (aka the run number) on the x-axis. You can measure the total server runtime by either adding an extra clock_gettime(...) call at the beginng/end of your handle connection function, or by looking at the wall-clock time reported by the time utility. b) For this part, repeat the same commands for the 10 runs above, but only change the number of workers passed to the server. Use -w 10 instead of -w 1. Produce the same plot as in Part 1, and compare the new line with the performance you measured in Part 1. Comment on the speedup that you observe thanks to the multi-threading that was introduced. Is it more or less than what you expected? c) For this part, we will run an experiment very similar to Part 2. In particular, we will still use -w 10 but we will change how the Mid section is constructed. The new Mid section will be: (2) Mid (repeating pattern): 0:r:1:0,0:r:1:1,0:r:1:2,0:r:1:3,0:r:1:4,0:r:1:5,0:r:1:6,0:r:1:7,0:r:1:8,0:r:1:9, 0:b:1:0,0:b:1:1,0:b:1:2,0:b:1:3,0:b:1:4,0:b:1:5,0:b:1:6,0:b:1:7,0:b:1:8,0:b:1:9, 0:s:1:0,0:s:1:1,0:s:1:2,0:s:1:3,0:s:1:4,0:s:1:5,0:s:1:6,0:s:1:7,0:s:1:8,0:s:1:9, 0:v:1:0,0:v:1:1,0:v:1:2,0:v:1:3,0:v:1:4,0:v:1:5,0:v:1:6,0:v:1:7,0:v:1:8,0:v:1:9, 0:h:1:0,0:h:1:1,0:h:1:2,0:h:1:3,0:h:1:4,0:h:1:5,0:h:1:6,0:h:1:7,0:h:1:8,0:h:1:9, 0:r:1:0,0:r:1:1,0:r:1:2,0:r:1:3,0:r:1:4,0:r:1:5,0:r:1:6,0:r:1:7,0:r:1:8,0:r:1:9, 0:b:1:0,0:b:1:1,0:b:1:2,0:b:1:3,0:b:1:4,0:b:1:5,0:b:1:6,0:b:1:7,0:b:1:8,0:b:1:9, 0:s:1:0,0:s:1:1,0:s:1:2,0:s:1:3,0:s:1:4,0:s:1:5,0:s:1:6,0:s:1:7,0:s:1:8,0:s:1:9, 0:v:1:0,0:v:1:1,0:v:1:2,0:v:1:3,0:v:1:4,0:v:1:5,0:v:1:6,0:v:1:7,0:v:1:8,0:v:1:9, 0:h:1:0,0:h:1:1,0:h:1:2,0:h:1:3,0:h:1:4,0:h:1:5,0:h:1:6,0:h:1:7,0:h:1:8,0:h:1:9, Other than that, construct the full commands just like in Part 1. Next, produce one last plot with the new performance trend across the 10 runs. This plot should have three lines: one for Part 1, one for Part 2, and one for the experiment in this part. Notice that the hashes returned by the client at the end of each run on all the experiments so far *should* match. Thus, the same exact operations are being performed on the 10 images. Compare now the runtime trend of the system in Part 2 vs. Part 3. What is the additional speedup? Where is the additional improvement coming from if we are performing the same exact operations over the same images? d) No more experiments here! But just a conceptual question. You see that both the experiments in Part 2 and 3 perform. the same exact operations on the images. Yet, the server exhibits different performance. Is there a better strategy to schedule the requests in the queue that could allow the server to exhibit the same performance on both experiments? No need to overthink this. Provide an exact scheduler policy in your answer in a way that, ideally, a person reading your answer should be able to implement the policy you are describing.
ENEM101 Wind Mapping Assignment Brief Submission deadline: Friday 22nd November 2024, 12pm. Submission format: Electronic, via ELE This assignment is worth 20% of the overall module mark. Outline: Wind turbine development opportunities in the Roseland peninsula The mapping exercise is an initial analysis to identify potential wind energy development sites in the Roseland peninsula by considering the wind energy potential and development constraints for different turbine sizes. This will involve mapping the area in QGIS and evaluating all the relevant constraints on turbine locations. Please include reasonable amount of detail in textboxes as your submission will be used as a stand- alone presentation of your findings for local discussion and consultation. The objectives of this assignment are: a) Demonstrate your ability to make use of GIS software b) Demonstrate knowledge of relevant wind farm development parameters (constraints/buffers/mitigation). Background An active local energy group are keen to understand the potential for wind in the Roseland peninsula. The Neighbourhood Development Plan (NDP) is on the ELE page and this shows the included parishes and planning framework. For a parish of your choice in the Roseland Peninsula, you may recommend new sites for development and/or suggest the re-powering/extension of existing projects. You will prepare up to Four A3-sized maps of the relevant area. This will include a main map up to A3 size*; and at least one inset map**; and a table of the sites you have identified***. Further insets may be used if you feel they are appropriate and/or useful. Ensure that the title block of your map contains title, date, and STUDENT NUMBER - NOT YOUR NAME. Ideally, within the title block area, an additional table of notes should be included that indicates the sources of data used in preparing the map and table. Note that all maps should be accompanied by a legend, a suitable scale, a North arrow and any relevant copyright notice. *The maps will show i) all the candidate/potential sites; ii) polygons indicating the extent of designated/constrained areas restricting development; iii) site boundaries; iv) relevant geographic information (locations of towns, the road and power distribution networks etc.); and v) your table of candidate sites (See below ***). **This inset map - approximately A5/A4 size - will give the detailed local constraints affecting your preferred site. It will also include turbine location information and potential access tracks etc. ***Produce a list/table of prospective sites (maximum of 10) - numbered and giving site name, 12 figure e.g. E123456 & N987654 site centre location, wind speed & other useful information- that meet the site suitability criteria. Site suitability 1) Wind speed. Not less than 7.5 m/s at 45 m above ground level. 2) Site access. Site entrances should be no more than 500 metres from the public road network (including minor roads). 3) Proximity to electrical distribution (33kV) networks (within 5 km). 4) Microwave links. The turbine(s) should not stand within the buffer zone of an existing microwave communication link. 5) Urban areas. For ≤ 12MW, turbines should be at least 5 x Tip-height from the nearest non-financially involved dwelling to minimise disturbance by turbine noise or shadow flicker. For >12MW, turbines should beat least 6 x Tip-height from the nearest dwelling non-financially involved dwelling. 6) Watercourses. The sites should have a clearance of 50m from any mapped river, lake, stream, or other watercourses. 7) You should apply relevant buffers to any sensitive features you identify. 8) Environmental criteria. You should clarify if your sites impinge on any of the following: a. Areas of Outstanding Natural Beauty b. National Parks c. Sites of Special Scientific Interest d. Special Protected Areas e. Special Areas of Conservation f. National Nature Reserves g. Local Nature Reserves h. RAMSARS (International wetlands designation) i. World Heritage Sites j. Scheduled Monuments k. Heritage Coasts 9) Aspect: By visual interpretation of the OS maps or use of QGIS - the location should, preferably, be approximately facing the South-West compass 'quadrant' since the prevailing wind direction is assumed to be from the south-west. 10) Slope: By visual interpretation of the OS maps use of QGIS - the slope of the site should be less than 15 degrees for construction considerations. 11) By visual interpretation of Google Earth aerial images, confirm there are no constraints affecting your main chosen site that have not appeared on OS maps. Use NOABL data for the wind speeds. Strategi, Meridian and Land-line/Mastermap, Digimap products contain vector road network data. You may use the previously supplied QGIS tables as a guide for the electrical distribution network and microwave links. Use OS maps of appropriate scales for the backgrounds to your finished maps. QGIS tables are available to model most of these environmental criteria on ELE. Natural England has on-line up-to-date constraint data in QGIS format. Data for the remaining criteria lie within the Edina Digimap products. If you wish to edit some of these datasets you will need to re-save them under an alternative name before you are able to do so. Assessment Submission Procedure Your final printout is intended to be as clear and informative as possible. There can be issues in converting your on-screen finished map layout to a PDF file - loss of image quality or the computer might seize-up - because of the potential file size and the PDF print software version you have. Resolution of the images should be at least 300 dpi. You must follow the instructions regarding the hand-in and ensure your file is suitable for printing. • The hand-in must be anonymous • Image quality should be maintained when exporting a PDF file for electronic hand in. Please check the images before submitting the assignment ENEM101: Wind Mapping Assignment Marking Scheme Candidate Number Criteria Feedback Your Mark Max. Mark Marker/label for all sites meeting the site suitability criteria. Detail, accuracy, clarity, and extent of 'candidate' site polygons etc. 10 List of suitable sites with required information and reasons for exclusion if any 15 Clear indication on maps of: -- all environmental, topographical and other relevant constraints etc. 15 Clear indication on maps of: ---- all road, urban areas, and watercourses etc. ----electrical distribution, microwave links and individual dwelling constraints etc. 15 Title block and other map presentation criteria 10 Turbine choice, farm layout and access routes 15 Discretionary 20 Total 100
MAEG 5030: Geometry Computing for Design and Manufacturing Remarks on Coding Assignment & Project Project and Oral Presentation Topics for course project (oral presentation): Form. a group of 3 students; Selected from your own research project/related field that connected with geometry computing (design, manufacturing, robotics, …); Or selected topics from given papers, available at https://www.dropbox.com/scl/fo/vmleua68rvr8mrl5f5qxy/h?rlkey=b9agoqzzzgvy9w16n1fx1p7x5&dl=0 Oral Presentation will be 7 mins + 3 mins Q&A, it should cover What task is solved and how did authors formulate it as geometry processing problem Which algorithm is proposed What’s the technical contribution of the work and why it outperform. with existing work Project and Oral Presentation Oral Presentation (each student should present 1-2 parts) Project report (2-3 pages, IEEE standard, double column, pdf format): Introduction of the problem Formulation of geometry computing problem Pseudocode of the algorithm Analysis of the method and contribution Provide the contribution statement. Example: xx: Writing – xx section; Discussion xx; Slicer making xx page xx-xx; Coding Implementation xx; Algorithm Writing xx; Coding Assignment (C++/python) CRML-code: using CMAKE for cross-platform. building. Cmake: https://cmake.org/download/ Eigen Library: https://eigen.tuxfamily.org/index.php?title=Main_Page Suggest to use Visual Studio 2022 for the project. https://visualstudio.microsoft.com/vs/community/ Make sure you have the c++ for desktop development installed. Qt visualizer (Ver. 5.12!) https://download.qt.io/archive/qt/5.12/5.12.3/ Recommended install position: C:QtQt5.12.3 Make sure you select MSVC 2017 64-bit during the installation Qt creator – write function and add button. Sample function will be provided. Usage of coding framework Select the folder of source code and build direction. Push Configure bottom and select x64 as the optional platform. Add the path in line 41 of Cmake file set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH} C:\Qt\Qt5.12.3\5.12.3\msvc2017_64\lib\cmake\Qt5") Click Generate and open project in visual studio Right click “CRML” in solutions and set as start up project Generate Solutions Note: You can also finish the assignment with coding language you feel comfortable with. Coding Assignment 1 Handle documents (pdf file) with screenshot of the code, and graphics pictures demonstrate the result. Hint on Assignment 1: 1. Search Data Structures (30%): To build the hash data structure of point set (e.g., 20 x 20 x 20 boxes) 2. Search k-neighbors of each point (30%) 3. Using Principal Component Analysis (PCA) to compute the normal of every point by its neighbors (30%) 4. Display the point set with normal estimated from PCA (10%) 5. Bonus: ICP-based algorithm for two point clouds (30%) Coding Assignment 2 Handle documents (1 pdf file) with screenshot of the code, and graphics pictures demonstrate the result. Hint on Assignment 2: 1. Read point cloud, and corresponding UV coordinate (10%) 2. Build sparse matrix A for B-spline surface fitting (40%) 3. Construct matrix b and solve linear system (10%) 4. Uniformly sample vertex on b-spline surface, build topology connection, and create vertex table and face table. (30%) 5. Construct triangle meshes for point cloud 1 - 4 (20%) 6. Bonus: Compare the performance of different parameters (number of control points and order) of a B-spline surface. Evaluate the fitting error. (30%) Coding Assignment 3 Handle documents (1 pdf file) with screenshot of the code, and graphics pictures demonstrate the result. Hint on Assignment 3 1. Write iterative way of surface smoothing – based on connectivity (40%) 2. Using Laplace operator for surface smoothing (40%) Hint: Build sparse matrix A as Laplacian Operator 3. Compare the performance between two method with different iteration time (20%) 4. Bonus: Implementing cotangent weights of Laplacian Operator. (30%)
Assignment 8 EMATM0061: Statistical Computing and Empirical Methods, TB1, 2024 Introduction This is the 8th assignment for Statistical Computing and Empirical Methods. This assignment is mainly based on Lectures 21, 22, 23 and 24 (see the Blackboards). Please note that you don’t need to submit this assignment. Load the tidyverse package: library(tidyverse) 1. A chi-squared test of population variance Suppose we have an i.i.d. sample X1, ⋯ ,Xn ∼ N(μ, σ 2) and a conjectured value for the population variance σ0(2). We wish to test the null hypothesis that σ0(2). (Q1) Implement a function called “chi_square_test_one_sample_var” which takes as input a sample called ““sample”” and a null value for the variance called “sigma_square_null” . (Q2) Conduct a simulation study to see how the size of the test varies as a function of the significance level. You can consider a sample size of 100, μ = 1, σ 2 = 4. For example, you can create a plot similar to the one below. (Q4) Conduct a simulation study to see how the statistical power of the test varies as a function of the significance level. You can consider a sample size of 100, μ = 1, σ 2 = 6 and σ0(2) = 4. For example, you can create a plot similar to the one below. (Q5) Load the “Palmer penguins” library and extract a vector called ““bill_adelie”” consisting of the bill lengths of the Adelie penguins belonging to the Adelie species. Suppose we model the sequence of bill lengths as a sample of independent and identically distributed Gaussian random variables X1, ⋯ ,Xn ∼ N(μ, σ 2) with a population mean μ and population standard deviation σ . Now apply your function ““chi_square_test_one_sample_var”” to test the null hypothesis that the population standard deviation is 3 mm at a significance level of α = 0.1. 2. Obstacles to valid scientific inference (Q1) The following concepts have been introduced in Lecture 21. For each of the following concepts, give (A) an explanation of the concept and (B) an example of a situation (real or hypothetical) where they create a barrier to drawing scientific conclusions based on data. You are encouraged to discuss these concepts with your colleagues. 1. Measurement distortions 2. Selection bias 3. Confounding variables 3. Multivariate distributions and parameter estimation Suppose that we have a sample of red-tailed hawks and we want to investigate the distribution of several features (Wing, Weight and Tail) of red-tailed hawks. We model the Wing, Weight and Tail with a multivariate Gaussian distribution. First, load the “Hawks” data frame. from the “Stat2Data” library. library(Stat2Data) data(Hawks) (Q1) Now extract a subset of the data frame called ““hawks_rt”” that contains only the rows corresponding to hawks from the “Red-tailed” (RT) species and three columns - ““Wing”“, “”Weight”“, “”Tail”“ . Remove any rows of “”hawks_rt”” with missing values from one of the relevant columns. (Q2) Now, lets model the three features ““Wing”“, “”Weight”” and ““Tail”” with a multivariate Gaussian distribution. Suppose that your data frame. “hawks_rt” consists of a i.i.d. sample X1, ⋯ ,Xn ∼ N(μ, Σ). Here we model the three features ““Wing”“, “”Weight”” and ““Tail”” with a multivariate Gaussian distribution with population mean μ and population covariance matrix Σ . Compute the minimum variance unbiased estimates (MVUE) of the μ and Σ . 4. Basic concepts in classification In lecture 24, we introduced some concepts in classification. Try to refresh your memory of these concepts by explaining them. (Q1) Write down your explanation of each of the following concepts. Give an example where appropriate. 1. A classification rule 2. A learning algorithm 3. Training data 4. Feature vector 5. Label 6. Expected test error 7. Train error 8. The train test split 5. The train test split Suppose you want to build a classifier to predict whether a hawk belongs to either the “Sharp-shinned” or the “Cooper’s” species of hawks. The feature vector will be a four-dimensional row vector containing the weight, and the lengths of the wing, the tail and the hallux. The labels will be binary: 1 if the hawk is “Sharp-shinned” and 0 if the hawk belongs to “Cooper’s” species. (Q1) Begin by loading the “Hawks” data frame from the “Stat2Data” library. Now extract a subset of the data frame called ““hawks_total”” with five columns - ““Weight”“, “”Wing”“, “”Hallux”“, “”Tail”” and ““Species””. The data frame should only include rows corresponding to hawks from either the “Sharp-shinned” (SS) or the “Cooper’s” (CH) species, and not the “Red-tailed” (RT) species. Convert the Species column to a binary variable with a 1 if the hawk belongs to the sharp-shinned species and 0 if the hawk belongs to Cooper’s species. Finally, remove any rows with missing values from one of the relevant columns. (Q2) Now implement a train test split for your ““hawks_total”” data frame. You should use 60% of your data within your training data and 40% in your test data. You should create a data frame consisting of training data called ““hawks_train”” and a data frame consisting of test data called ““hawks_test””. Display the number of rows in each data frame. (Q3) Next extract a data frame called ““hawks_train_x”” from your training data (from ““hawks_train””) containing the feature vectors and no labels. In addition, extract a vector called ““hawks_train_y”” consisting of labels from your training data. Similarly, create data frames called ““hawks_test_x”” and ““hawks_test_y”” corresponding to the feature vectors and labels within the test set, respectively. (Q4) Now let’s consider a very simple (and not very effective) classifier which entirely ignores the feature vectors. The classifier is defined as follows. Let ^(y) ∈ {0,1} be a fixed value. For any input x, the output of classifier is always the fixed value ^(y). In other words, your classifier is of the form φy(^)(x) ≡ ^(y) for all x ∈ ℝ4 (note that ^(y) is fixed). Based on the training data from the previous questions, your task is to choose a value ^(y) from {0,1} such that the classifier has a smaller training error. (Q5) Next compute the train and test error of φy(^) . In general, φy(^) performs poorly, as it does not use any information of the feature vector. However, in the example, the train error and test error seems relatively low (much less than 50%). Try to explain why the errors are relatively low. In which cases we might have a error of φy(^) close to 50%?
MATH 331 — Fall 2024 Assignment 5 (due December 3) Scan your solution to each of the following four problems as separate files and submit them by 11:59pm on the due date via CrowdMark (log in to https://app .crowdmark .com/sign-in/queensu using your OnQ account). 1. The following system of diferential equations is a model for two competing populations: Find allequilibria of this system and classify them. Compute all therelevanteigenvectors relevant for drawing the phase-plane diagram. Sketch the phase plane diagram (by hand) in the first quadrant. 2. Here we consider an example of a hyperbolic equilibrium where linearization fails to give the correct phase-plane diagram close to the equilibrium (the conditions under which this can happen will be in later lectures). Consider the following function, The origin is clearly an equilibrium of the system (a) Show that h is continuously diferentiable on B(0; 1). (b) Let Draw the phase-plane corresponding to the linearized system What is the classification and stability of the origin for this linearized system? (c) Transform the diferential equation to polar coordinates. Show that for r ≠ 0 and r b. (d) Draw bifurcation diagram of the system showing das the bifurcation parameter (in the horizontal axis) and x in the vertical axis. Identify the bifurcation that occurs at d = b.