Assignment Chef icon Assignment Chef

Browse assignments

Assignment catalog

33,401 assignments available

[SOLVED] BU232620 Empirical Project 1 Linear Econometrics for Finance Prolog

BU.232.620 Empirical Project 1 (Linear Econometrics for Finance) Introduction In this empirical work we aim to explore the factors that drive the returns on stock portfolios, according to the seminal work of Fama and French ( 1993). Same as the Fama and French ( 1993), combing with the asset-pricing model, time-series regression is applied. Monthly returns on stocks and bonds are regressed on the returns to a market portfolio of stocks and mimicking portfolios for size, book-to-market equity (BE/ME), and term-structure risk factors in returns. Our findings reveal that market excess return plays a substantial role in explaining the variations in returns, although the explanatory power varies among different portfolios. Data Description In this work, data including monthly return series of the 25 stock portfolios, as well as the market excess return factor, are all from Ken French’s Data Library. Specifically, Monthly market excess return (Mkt-RF), size factor (SMB), and book-to-market factor (HML), Risk-Free Rate (RF) is defined as the Monthly returns of a one-month Treasury bill. Moreover, Returns on 25 portfolios formed on the intersections of five size groups (ME1 to ME5) and five book-to-market equity groups (BM1 to BM5). Following tables present the Mean, Standard Deviation and T-Statistics of the portfolio intersections, which is applied to further discussion. Table 1 :Mean of Portfolio Intersections Table 2: Standard Deviation of Portfolio Intersections Table 3: T-Statistics of Portfolio Intersections Figure 1: OLS Regression Results In this case, because the lowest T-statistics (2.38) is larger than the 2.064, which is the critical value at 95% significance level and 24 degree of freedom, the null hypothesis: the means equal to zero will  be  rejected  at  95%  significnace  level.  And  accoding  to  the  OLS  Regression  Model,  the skewness equals to 0.329 and kurtosis equals to  13.884, which shows these returns do not follow a normal distribution. Models and Findings To analyze the impact of market factors on the 25 portfolios, we employed a time-series regression model: Rt−Rf= α+β(Mkt-RF)+ϵt Where Rt is the return of the portfolio at time t, Rf is the risk-free rate at time t, Mkt-RF is the   market excess return, α is the intercept, β is the coefficient of the portfolio to the market excess return. Following tables present the result from regression about these parameters: Table 4:β the coefficient All 25 portfolios have positive Beta coefficients, indicating strong and positive sensitivity to market excess returns. Table 5: T-Statitics on β Because  all  the  T-statistics  on  β  is  larger  than  the  2.064,  which  is  the  critical  value  at  95% significance level and 24 degree of freedom, the null hypothesis: The loadings of the 25 portfolios on the market portfolio significantly equal to zero should be rejected at 95% significnace level. Table6: R² Goodness offit The R² values suggest that the market factor explains a large portion of their return variation. Most of the intersections ’ R² value is larger than 0.7, and all intersections ’ R² is larger than 0.5, showing a great explanation power of our regression model. R² indicates how much of the time series variation in the return of each portfolio is explained by the market excess return (MKT - RF), for example, Portfolio ME1 BM1 has an R² of 0.511, meaning that 51.1% of its return variation is accounted for by the market excess return. Conclusion According to the empirical study especially from the time-series regression, it is comfirmed that  the market  excess  return  explains   a  significant  proportion  of  the  variation  in  returns  for  many portfolios. However, evethough all portfolios have over 0.5 goodness of fits,   some of them with ralatively R² values indicate the potential for additional explanatory variables. After reading the Fama and French ( 1993), factors such as size (SMB) and book-to-market (HML) are expected to incorprate into the regression model to better capture the variations in returns. In summary, this project indicated the importance of market factors in explaining portfolio returns while also emphasizing the limitations of using the  single-factor model, as only market excess return (MKT - RF) is considered . Further enhancements could improve the explanatory power, by adding more varaibles in the model to better explain the returns ’ variations.

$25.00 View

[SOLVED] ECON10151 Lecture 5 Automating Tasks with Excel Macros

ECON10151 Lecture 5 Automating Tasks with Excel Macros Oct 2024 Learning Outcomes •  Be able to record and run macros in Excel to automate table formatting and create charts. •  Understand the principles of macros and apply them to efficiently handle repetitive tasks in Excel. Introduction In this week’s lecture, we will explore macros in Excel, which are powerful tools designed to automate repetitive tasks.  A macro is essentially a series of instructions or commands that can execute multiple actions with a single click. Macros are created using Visual Basic for Applications (VBA), a programming language integrated into Excel that allows you to customise functionality. With macros, you can perform a variety of tasks, such as formatting cells, performing calculations, and generating charts, all while saving time and reducing the likelihood of errors. To get started, the first step is to enable macros in Excel. This will allow us to harness their full potential as we delve into creating and using them throughout this course. 1 Setting Up Macros The Macro feature is located under the Developer tab.  However, the Developer tab is not displayed in the Excel ribbon by default, but you can easily add it to access macro-related features. • For Windows Users 1.  Click on the File tab. 2.  Select Options. 3.  In the Excel Options window, choose Customise Ribbon. 4.  In the Customise the Ribbon section, locate the Main Tabs list and check the box next to Developer. 5.  Click OK to apply the changes. • For Mac Users 1.  Click on Excel in the top menu. 2.  Preferences. 3.  Choose Ribbon & Toolbar. 4. the Customise the Ribbon section, find the Main Tabs list and check the box next to Developer. 5.  Click Save to confirm the changes. Save the file: Remember to save your file with the  .xlsm extension to ensure that macros can be enabled and utilized. 2 Practice with Macro Dataset The dataset contains monthly sales data for different Lego themes from October to December.  Each table provides information on the number of units sold (in thousands) and revenue generated (in USD millions). • Theme: The specific Lego product category (e.g., Star Wars, Friends). •  Units Sold: Number of units sold during the month (in thousands). • Revenue: Total sales revenue for the month (in USD millions). Imagine you are a data analyst working for the Lego Company.  You have been assigned the following tasks to enhance the sales data tables for the last quarter report of 2023.  This means you need to complete the following tasks for October, November, and December. Main Tasks: 1.  Format the Table: • Insert Title: – Insert a new row at the top of each table. – Merge the cells in this row to create a title space. – Enter the title: ”Monthly Sales” and ensure it is centred within the merged cells. – Bold the title and apply an appropriate colour to enhance visibility. • Format Headers: – Bold the headers of each table to ensure they stand out. – Select a different shade of colour for the header cells to further distinguish them from the data. • Format Values: – Insert the currency dollar sign $ for revenue data. 2.  Highlight the schemes with the top 10% of units sold and create a chart displaying the units sold for each Lego theme across the months. 2.1 Task 1: Format Tables with Macro To complete these tasks, we first need to apply them to the data for October. Then, we can repeat the same actions for November and December.  The Macro will help us record the steps for October, and we can then run the Macro to automate the formatting and chart creation for November and December. Step 1 Record Macro Go to the Developer tab and click on Record Macro. Figure 1: Record Macro Then, set up the information for this macro and name it ’Format’ . Click OK Figure 2: Name Macro From this point forward, everything you do in Excel will be recorded. 1.  Insert Title: -  Insert a  New Row:  Right-click on the first row number of your table and select Insert from the context menu to add a new row at the top of the table. -  Merge Cells: Highlight the cells in the newly inserted row that span across the width of your table. On the Home tab, click on the Merge & Center button in the Alignment group. -  Enter Title:  Click on the merged cell and type "Monthly  Sales . " , then press Enter.  Ensure the title is centred in the cell. -  Bold the Title: Highlight the title text. Click on the Bold button (or press Ctrl  +  B) in the Font group on the Home tab. - Apply Colour: With the title cell still selected, click the Fill Color button (paint bucket icon) in the Font group on the Home tab. Choose an appropriate colour from the palette to enhance visibility. 2.  Format Headers: -  Bold the Headers:  Highlight the header row of your table.  Click on the Bold button (or press Ctrl +  B) in the Font group on the Home tab. -  Select a Different Shade of Colour: With the header row still selected, click the Fill Color button in the Font group. Choose a different shade of colour from the palette to distinguish the header cells from the data. 3.  Format Values: -  Bold the Month Numbers:  Selecting data (A3:A9) in the ”Month” column.  Next, click on the Bold button in the Home tab. -  Insert Currency Dollar Sign for Revenue Data: .  Instead of selecting the data directly, use the shortcut for this.  Click on cell D3 and then press Ctrl + Shift + Down Arrow to highlight the revenue data until the next empty cell. .  Right-click on the selected cells and choose Format Cells from the context menu. In the Format Cells dialog box, select the Number tab. Click on Currency or Accounting from the list on the left. Choose the appropriate options for decimal places and currency symbol (ensure it is set to $English (United States)). Click OK to apply the formatting. Step 2 Run Macro Now we need to use this macro to help us adjust the format of the data for November. 1.  Go to the worksheet Nov, then click on the Developer tab. Click on Macros - choose ”Format”, and then select Run. Figure 3: Run Macro Please find the results below. Are they correct? Figure 4: Results Note that the headers and the title have been formatted. In the ’Month’ column, not all instances of ’Novem- ber’ are bolded due to the presence of additional rows in the table.  However, the revenue data is consistently formatted with the currency sign.  Despite the varying number of rows, the same formatting has been applied throughout. This discrepancy arises from the different methods used to select the data. To improve this formatting, we can either re-record the entire sequence to update the Macro or edit the Macro by modifying the code behind it. Step 3 Edit Macro Macros are fundamentally based on Visual Basic for Applications (VBA), which will be introduced in the next lecture. For now, consider that each action or step we perform in Excel corresponds to a line of code that can be interpreted by the computer. This means we have the option to edit the code if we want to adjust any steps. Let’s take a closer look at this Macro. • Go to the Developer tab - Click on Macros - choose ”Format” - Select Edit Now you are in the VBA editor, where you can see the code behind Excel. Please find the figure below. Figure 5: Code for Macro Let’s focus on the code related to formatting values. •  Edit Code: To ensure we employ the same procedure to select ’November,’ we can change the code for selecting all cells that include November to: Range("A3").Select Range(Selection, Selection.End(xlDown)).Select The new code should be shown as below, Figure 6: Edited Macro •  Close the window, and let’s clear the formatting applied earlier. Then, run the macro again to see whether it can apply the same formatting despite the varying number of rows. Now the format should be applied to the other table, regardless of the number of data rows. 2.2 Task 2: Highlighting Information and Creating Charts with Macros Step 1: Record a New Macro Named ”Highlight” 1.  Go back to the worksheet ”Oct.” 2.  Go to the Developer tab, click on ”Record Macro,” and name it ”Highlight.” Then click OK. 3.  Go to the ”Units Sold (thousand)” column, click on cell C3, and use  Ctrl+Shift+Down Arrow  to select the cells until the first empty cell. 4.  Goto the Home tab, click on ”Conditional Formatting,” select ”Top/Bottom Rules,” then choose ”Top 10%”, and click OK. 5.  Stop recording. Step 2: Record a New Macro Named ”Create a chart” 1.  Navigate to the worksheet named ”Oct.” 2.  Go to the Developer tab, click on Record Macro, and name it ”Create a chart.” Then, click OK. 3.  Select cell B2, then hold down  Ctrl+Shift+Down Arrow  to select all cells in columns B and C until the first empty cell. 4.  Go to the Insert tab and select Clustered Column Chart to create the chart. 5.  Stop recording Step 3: Run Macros Now, we can run these macros or assign them to buttons to filter or visualize data for the other months: November and December. • Navigate to the Developer tab. •  Click on Insert to add a button.  Assign the macro ”Highlight” to the button and rename the button to ”Highlight” •  Click on Insert to add a button. Assign the macro ”Create a chart” to the button and rename the button to ”Create a Chart.” • Copy and paste these buttons into the worksheets for ”November” and ”December” . •  Run macros by clicking on these buttons Important Note: Check the Chart Data After creating the charts, check whether they display the correct data on the worksheets.  If the charts do not show the correct data, follow these instructions to edit the macro: • Go to the Developer tab. • Click on Macros and select ”Create a chart.” • Click on Edit. •  Delete any specific sheet references in the code to ensure it works on the active sheet. Example: •  Close the window and try running the macro again.

$25.00 View

[SOLVED] STAT0021 Assessment 4 Instructions Term 1 2023-24

STAT0021: Assessment 4 Instructions Term 1, 2023-24 1    Introduction Please read and understand these instructions before you begin the assessment. Assessment 4 will begin with the release of these instructions on the STAT0021 course Moodle page within the “Assessment 4 – Individual Coursework – Term 1” section at 1pm on Wednesday 13th December 2023. The intention of the assessment is for you to apply the techniques you have learned during the course to a real-world dataset made up of a number of variables (percentage of the population double vaccinated for COVID-19, median household income, median house price, etc.) measured for subregions of London. A copy of the data to be analysed is available as an Excel spreadsheet on the course Moodle page within the “Assessment 4 – Individual Coursework – Term 1” section. Assessment 4 makes up 50% of your module mark for STAT0021 2    Data The data are real measurements for subregions (Middle Layer Super Output Areas, or MSOAs) of London. In total, there are 11 variables recorded for 982 observations. Vaccination data was recorded in December 2021. Demographic data is accurate as of the 2011 census, but can be treated as being contemporaneous with the vaccination data. Variable name               Description .VaxPercentThepercentage of thepopulation whohavereceived atleast two subregionislocated.0: 1:Labour2: Other(LiberalDemocrat ornomajorityparty)PopDensityThepopulationdensity(/2 erObesityThepercentage of thepopulation who are classified asob -(e.g. )UnemploymentThepercentage of thepopulation who areunemployedHHBenefitThepercentage of th 3    Submission structure You should structure your analysis and subsequent write-up according to the below headings. 3.1    Exploratory data analysis The first step in any data analysis is to explore the data to get a sense of what the variables represent and the potential for relationships between them. Your submission should include three separate, distinct exploratory analyses, each of which contains all of: A.   The results of a single numerical calculation (e.g. a summary statistic or the results of a hypothesis test). B.   A single figure (generally containing a single plot, but potentially containing up to three related plots). C.   A discussion of what your numerical result and figure tell us about the London and justification of why this information is interesting. Note that: 1.    Each of your exploratory analyses will be marked out of 6 marks (for a total of 3x6=18 marks overall for this section of the assessment). 2.    Marks will be awarded for the degree of insight shown in each part of the analysis. A numerical result and/or plot which is not discussed will receive a poor mark – a large proportion of the marks will be awarded based upon the degree to which your discussion correctly interprets your results and justifies why they are insightful. 3.   Variety across the three analyses will be rewarded. For example, submissions which repeat the same analysis and discussion for three sets of variables fail to show a breadth of understanding and will receive a poor mark. 4.    Neither of your discussions should include VaxPercent, as this is the focus of the later parts of the assessment. 5.   You are free to transform and/or combine variables, and to identify and potentially remove any outliers from the data. Any such decisions should be justified in your discussion. 3.2    Simple linear regression VaxPercent is the focus of this part of the task. How can the other variables be used to explain the variability in VaxPercent via simple linear regression? Your submission should include: A.   Justification of which variable can be used as a covariate to produce the best simple linear regression model for the outcome VaxPercent. B.   An interpretation of the estimated model coefficients for your best simple linear regression model. C.   Comments on the fit of your best simple linear regression model. D.   A plot of VaxPercent against the covariate in your best simple linear regression model with the accompanying regression line. Note that: 1.   This component of your submission will be marked out of 9 marks. 2.    There is not a specific definition of the “best” model. It is likely to be based both upon how well the model fits the data and how well the assumptions underlying simple linear regression are satisfied (quantitative and qualitative evidence). Include in your justification why you would categorise your model as being the best and the steps you took to arrive at this best model. 3.    Your model can include a variable which is not present in the original dataset, but which has been obtained via a transformation or combination of variables in the original dataset. You should not bring in external data. You should provide a justification of why any new variable is useful/interesting if you haven’t already given an explanation earlier in your submission. 4.   You should support your justification, interpretation and comments with suitable Stata output. 5.    If there are any particularly unusual observations identifiable as a result of your analysis, you should mention them using their ID and justify why you do or do not believe them to be outliers. If you believe them to be outliers, then you can exclude them when fitting your model. Your submission should also include: E.    The lower quartile, median, and upper quartile value for the covariate in your best simple linear regression model. F.    A mathematical equation to indicate how your best simple linear regression model can be used to make predictions of VaxPercent. G.   Predictions of the value of VaxPercent when the covariate in your best simple linear regression model takes its lower quartile, median, and upper quartile values. Note that: 6.   This component of your submission will be marked out of 3 marks. 7.    If your best model includes variable x as the covariate, you should use Stata to calculate the lower quartile, median, and upper quartile values of x. Then, calculate the corresponding predicted values of VaxPercent according to your best model. 3.3    Multiple linear regression VaxPercent is again the focus of this part of the task. How can the other variables be used to explain the variability in VaxPercent via multiple linear regression? Your submission should include: A.   Justification of which variables can be used as covariates to produce the best multiple linear regression model for the outcome VaxPercent. B.   An interpretation of the estimated model coefficients for your best multiple linear regression model. C.    Comments on the fit of your best multiple linear regression model fit. Note that: 1.   This component of the assessment will be marked out of 9 marks. 2.    There is not a specific definition of the “best” model. It is likely to be based both upon how well the model fits the data and how well the assumptions underlying multiple linear regression are satisfied (quantitative and qualitative evidence). Include in your justification why you would categorise your model as being the best and the steps you took to arrive at this best model. 3.    Your model can include variables which are not present in the original dataset, but which are obtained via a transformation or combination of variables in the original dataset. You should  not bring in external data. You should provide a justification of why your new variables are useful/interesting if you haven’t already given an explanation earlier in your submission. 4.   You should support your justification, interpretation and comments with suitable Stata output. 5.    If there are any particularly unusual observations identifiable as a result of your analysis, you should mention them using their ID and justify why you do or do not believe them to be outliers. If you believe them to be outliers, then you can exclude them when fitting your model. Your submission should also include: D.   The lower quartile, median, and upper quartile values for each covariate in your best multiple linear regression model. E.    A mathematical equation to indicate how your best multiple linear regression model can be used to make predictions of VaxPercent. F.    Predictions of the value of VaxPercent when the covariates in your best multiple linear regression model jointly take their lower quartile, median, and upper quartile values. Note that: 6.   This component of the assessment will be marked out of 3 marks. 7.    If your best model includes variables x1, x2, … as the covariates, you should use Stata to calculate the lower quartile, median, and upper quartile values of x1, x2, … . Then, calculate  the corresponding predicted values of VaxPercent according to your best model. That is, you should submit three predicted values. One for when all of your covariates take their lower quartile values, one for when they all take their median values, and one for when they all take their upper quartile values. 3.4    Linear regression with a factor variable as a covariate Linear regression is useful for understanding how continuous variables influence other continuous variables. There may be occasions when we would like to understand how categorical variables, also referred to as factor variables, influence a continuous variable. Careful consideration of a factor variable can allow for its inclusion as a covariate within a linear regression. While linear regression with a factor variable as a covariate isn’t taught as part of STAT0021, you should be able to extend your knowledge of linear regression from STAT0021 to understand the basics of linear regression   with a factor variable as a covariate through a small amount of research. VaxPercent is the outcome of interest, with the link to Political being the aim of the investigation. Your submission should include: A.   Stata output including the results of an appropriate test taught as part of STAT0021 to determine whether the mean value of VaxPercent differs according to the levels of Political. B.   An interpretation of those test results. C.   A suitable plot to compare VaxPercent and Political. D.   Plot (or plots) necessary to verify whether the assumptions of your test are satisfied. Note that: 1.   This component of the assessment will be marked out of 3 marks. Your submission should also include: E.    Stata output including the results of a linear regression model for VaxPercent using Political treated as a factor variable as the covariate. F.    An interpretation of the estimated model coefficients from that linear regression model. Note that: 2.   This component of the assessment will be marked out of 3 marks. Your submission should also include: G.   A mathematical equation to indicate how this regression model can be used to make predictions of VaxPercent. H.   Predicted values of VaxPercent when Political takes each of its three different levels. Note that: 3.   This component of the assessment will be marked out of 3 marks. Your submission should also include: I.     Discussion of the benefits of building a linear regression model using Political as a  factor variable covariate in contrast to the drawbacks of a linear regression model using Political as a continuous variable covariate when wishing to determine how VaxPercent varies with Political. Note that: 4.   The component of the assessment will be marked out of 3 marks. 3.5    General marks 6 marks are available to submissions which: A.   Are clear, well-written and formatted; with plots and Stata output adequately sized and labelled; and which correctly follow the submission format instructions. 4    Submission details 4.1    Submission format You should submit a single file, saved as a pdf and named as “Assessment 4 [your student number]” . For example, if your student number is 22000000 then your submission should be a single pdf file named “Assessment 4 22000000” . Your submission should also include within it your student number, but should not contain your name. 4.2    Submission length Your submission should be made up of no more than: .    Five A4 pages of discussions which cover all of the requirements outlined in the previous section, with a font size no smaller than 10 points. .    Ten pages of Stata output (as screenshots) and other relevant figures. Each figure should have a number by which it is referred to in your discussions. Figures should be of a suitable size and quality to be easily interpretable. .    One page, if necessary, of references to journal articles, books, websites, AI tools, etc. Requesting the discussions and figures be separated in this way may seem unusual, but is done to stress both that enormous amounts of writing are not expected for this assessment and that carefully chosen figures can be just as (or even more) useful than a greater volume of text. The permitted length is an upper limit, not a guide for how much you are expected to submit. If you can clearly explain your thoughts more concisely then shorter submissions will not automatically be marked lower. Any submission which is over the permitted length will suffer a penalty of 10 percentage points, although any such penalty will not reduce a mark below the pass mark of 40%. 4.3    Submission procedure and deadline You must complete your submission via the “Assessment 4 – Individual Coursework – Term 1” section of the STAT0021 course Moodle page before the deadline of 1pm on Wednesday 17th January 2024. There are standard non-negotiable penalties for late submissions which you can read about in the UCL Academic Manual. Any extension to the deadline can only be granted where a student has a Summary of Reasonable Adjustments (SoRA) or has successfully claimed extenuating circumstances. Extenuating circumstances are handled by your parent department and not by the teaching department. 4.4    Stata Throughout the information above on the expected submission structure it is mentioned that you should include supporting evidence from Stata. This is referred to because use of Stata has been taught as part of STAT0021. If you would prefer to make use of other software to perform the analyses, and you believe that you can obtain results just as good as those produced by Stata, then  you are free to do so. If you are considering this, you are strongly encouraged to contact the course lecturer at [email protected] to discuss your decision.

$25.00 View

[SOLVED] ENGD3103 Communication Networks 1 Coursework Assignment 2023-2024 Study of Protocol Layers Jav

ENGD3103 Communication Networks 1 Coursework Assignment 2023-2024 Study of Protocol Layers Aim: In this assignment, you will use Wireshark to study TCP/IP layers by capturing and examining packet traces. What to submit: Your coursework must be submitted as a report. Snapshots of the Wireshark interface showing the details of the captured traces should be included in the report. You must submit the report electronically in Word or PDF format to learning Zone. All references must be in IEEE format. Presentation: Please note that  [4 marks] will be allocated to the presentation and organisation of your report. Introduction: Capturing a Trace The following steps show how to capture a packet trace using Wireshark. -    Launch Wireshark and start a capture to record standard web traffic -    Set the display filter to “http” -    After the capture is started, browse the internet for any given website, e.g. www.dmu.ac.ukorwww.bbc.co.uk -    Return to Wireshark and stop the trace You should now have a short trace similar to the one shown in Fig. 1. If you have visited https websites, then your trace may not be presented under “http” but under “tls” instead where TLS stands for Transport Layer Security. -     Save the output as you will need it for later steps If you cannot capture a trace yourself, use the provided traces available in the Lab folder under Learning Materials in Learning Zone. Task 1: Frame Structure [7 marks] Find the GET HTTP packet in the trace similar to the snapshot presented in Fig.  1. Examine the details of the Frame presented in the middle panel of the Wireshark graphical interface. 1)  Present the packet you examined showing the size in bytes of the TCP, IP, and Ethernet protocol header fields and their payloads. Show a snapshot of your trace that supports your answer.   [4 marks] 2)  By examining the details of the Ethernet and IP headers in your trace, determine the demultiplexing key in these protocol layers and present their values. Show a snapshot of your trace that supports your answer. Discuss the importance of the demultiplexing keys.     [3 mark]   Fig. 1: Trace of a traffic showing the details of the captured trace Task 2: Ethernet [8 marks] Find a GET HTTP packet in the trace similar to the snapshot presented in Fig. 1. Examine the details of the packet presented in the middle panel of the Wireshark graphical interface. 1)  Sketch a figure of the GET message that shows the position and size in bytes of the Ethernet header fields. Show the range of the Ethernet header and the Ethernet payload. Show a snapshot of your trace that supports your answer.  [3 marks] 2)  Draw a figure that shows the relative positions of your computer, the router, and the remote server. Label your PC/laptop and the router with their Ethernet addresses. Label your PC/laptop and the remote server with their IP addresses. Show a snapshot of your trace that supports your answer.  [3 marks] Change the display filter to arp, which denotes ‘address resolution protocol ’. Choose a packet, expand the Ethernet header field (using the “>” expander or icon) and examine the details. 3)  What is the broadcast Ethernet address and which bit of the Ethernet address is used to determine whether it is unicast or multicast/broadcast? Show a snapshot of your trace that supports your answer.   [2 mark] Task 3: IP Packet Structure [15 marks] Change the display filter to “ip” . 1)  Select any packet in the trace and expand the IP header fields (using the “+” expander or icon) to see the details similar to the snapshot presented in Fig. 2. Examine the details of the IP header  fields presented in the middle panel  of the Wireshark  graphical interface. By examining the details of the IP packets in your trace, answer the following questions: a.   What does the TTL field represent and what is its initial value? Discuss the importance of this field.   [3 mark] b.   What does the Total Length field include? Provide an example from the trace to support your answer.   [2 mark] c.   How  can  you  check  whether  a packet has been  fragmented? Discuss your answer. Discuss the importance of fragmentation.  [4 mark]   Fig. 2: Trace of a traffic showing the details of the IP header 2)  What is the percentage of TCP packets in your captured trace to the total traffic? What is the percentage of UDP ones?   [2 marks] 3)  Generate an I/O Graph that shows the traffic of each of the TCP and UDP transport protocols analysed in the previous point 2).   [2 marks] 4)  Use Wireshark to measure the average bit rate of your captured trace (or the trace you obtained from the Learning Zone module shell).   [2 marks] Task 4: IP Header Checksum [6 marks] 1)  Pick a packet from the trace captured in the previous task, and check that the IP header checksum is correct. Support your  answer showing the summation process and a snapshot.   [3 marks] 2)  Explain why the checksum in IP covers only the header and not the data.   [3 marks]

$25.00 View

[SOLVED] 27285 Services and Retail Marketing R

Assignment Remit   Programme Title   MSc Marketing   Module Title   Services and Retail Marketing   Module Code   07 27285   Assignment Title   Analysis of a Service Provider or a Retailer’s Strategy   Level   M   Weighting   70%   Hand Out Date   1st November 2024   Deadline Date & Time   See canvas   12pm   Feedback Post Date   16th working day after the deadline date   Assignment Format   Essay   Assignment Length   3000 words   Submission Format   Online   Individual Module Learning Outcomes: This assignment is designed to assess the following module learning outcomes. Your submission will be marked using the Grading Criteria given in the section below. In this assessment the following learning outcomes will be covered: LO1: Explain service and retail marketing principles and analytical techniques LO2: Analyse the importance of the retail and services sectors to the world, national and local economies LO3: Appraise and critique the complex relationships between service and retail providers;customers; suppliers and additional stakeholders LO4: Critically analyse the role of employees in retail and service organisations LO5: Evaluate the ethical responsibilities of service and retail organisations in the light of current and emerging technologies, including its digital element. LO6: Critically analyse the problems and challenges experienced by service and retail organisations and demonstrate thoughtfully considered solutions Assignment 2 – Individual Assignment Assignment Title: Analysis of a Service Provider or a Retailer’s Strategy Select ONE service provider or retailer of your choice. Using your service provider or retailer evaluate their strategy. Your service provider or retailer may be either online, in-store or both. The following areas must be discussed: a. Critically evaluate your service provider’s or retailer’s strategy. Identify THE MOST IMPORTANT STRATEGY for your company and support your choice with theoretical evidence. Areas that you may want to consider are (you are not limited to these areas – please look at the module content as a whole) (1000 words): - Product range - Brand strategy - Innovations - Use of technologies - Customer experience - Place design and location - Customer service - Online strategy b. Analyse the ethical and social responsibility strategy of your service provider or retailer. Evaluate and appraise the CSR or ethical practices of your service provider or retailer. Areas you may want to consider are - you are not limited to these areas – please look at the module content as a whole. You should ensure that you use the theories within the module or from wider reading to support your arguments (1000 words): - Sustainable design - Farming and sourcing practices - Work with charities - Pay - Employee Benefits and Opportunities - Product design c. Using the innovations from your group assessment, make TWO recommendations for your chosen service provider or retailer on how they can enhance their strategic offering. You should ensure that you use the theories within the module or from wider reading to support your recommendations (1000 words). The report should contain substantial evidence of wider academic reading. A minimum of 15 peer reviewed academic journal articles should be used. *You must use services and retail theory and not general marketing theory e.g. Porter’s 5 Forces/ BCG Matrix. To gain maximum marks you should provide evidence for the statements that you make. This may include applying further service and retail theory to your chosen company. Word Length: A maximum of 3,000 words – please ensure that the word count is listed on your coursework. There is no additional allowance. This excludes tables, models and the reference list etc. The word counts for section A, B and C listed above are a guide only – it is essential that you do not exceed the maximum allowance of 3000 words. Assignment Structure: Your structure the essay as follows: · Short introduction to your company (you should not include a long company history or company overview) · Section A · Section B · Section C · Short conclusion – you should not introduce any new information in the conclusion – this should be a very short summary · Reference list (using Harvard Referencing conventions) You should NOT include additional appendices – all tables/ models/ pictures must be included within the main body of your assignment

$25.00 View

[SOLVED] COMP3173 24F Set Algebra Calculator Python

COMP3173 24F Project Description Project Title: Set Algebra Calculator Grouping: Two students are in a group, no need to be in the same section. Once grouping is completed, students are not allowed to change their groups. Please follow the instruction in the email from Lily on Oct. 8 and complete grouping on AUTOLAB. Grouping is accomplished only if both two students in a group confirm. Objective: In this project, you will develop create a small calculator for Set Algebra. This algebra is simplified, which only consists of integers, set of integers, predicates, integer operators, set operators, logical operators, and relational operators. This language is designed to be straightforward and simple, making it easier for you to implement. So, some features look wired. Please accept if you see any and consider them as intentional design choices. Before commencing work on the project, it is imperative that you thoroughly review this document. Note that is long. The input will be a source code file, which may include zero or multiple variable declarations (integer or set) and one single calculation expression. The calculator will then analyze the source code which is formulated in in Set Algebra. The analyzer should detect and highlight any errors presented in the source program; if no errors are found, the calculator will proceed with evaluation. The first part of this document explains the language’s features with examples, which is like a programming language user manual. By reading it, students will gain a comprehensive understanding of the language, enable them to write expressions in this language and to identify errors in source code. The subsequent part of the document outlines the instructions of implementation by different phases. Students are expected to complete the project by sequentially completing these 3 phases. Implementation Language: C or Python, you have your own choice. Startup codes and instructions for both languages are given in the package. Grading: · Submission – 5% · Compilation – 5% · Phase 1 – 40% · Phase 2 – 30% · Phase 3 typing – 10% · Phase 3 evaluation – 10% · Bonus 1 “simplify” without Distributive Law – 2% · Bonus 2 “simplify” with Distributive Law – 2% · Bonus 3 function or inequality order testing – 1% DDL: We do not put DDLs for each phase. The DDL for the entire project will be Dec. 17 midnight, the last day of classes. But, do not wait until the last minute. Please expect that the project will cause 40 human hours. Students will submit their works to AUTOLAB. (More instructions will be given later.) Marking will be purely based on testcases by AUTOLAB. Testcases: More testcases will not be with this project description. Because students can check the correct outcome at Set Algebra Playground. (←Please try this!!!) Students can also write their own testcases and understand the language better. Language Feature The user manual of this language is listed. Keywords: · “let”: initiates a variable declaration. · “be”: acts as the assignment operator in other programming language. · “int”: specifies the variable is of integer type during its declaration. · “set”: specifies the variable is of set type during its declaration. · “show”: acts as the main function in other programming languages, which initialize a calculation. Data types: · Integer: o Basic data type o A single-digit integer is an arbitrary decimal number. o A multi-digit integer starts with a non-zero decimal number and followed by any sequence of arbitrary decimal numbers. o Users can only declare non-negative integers. Negative integers are constructed through subtraction operations. · Arithmetic expression: o Constructed data type o Users are not allowed to declare an arithmetic expression. There is no specific data type keyword for arithmetic expressions in the language. This data type only exists in the compiler. You can also check the keywords. There is no data type keyword for arithmetic expressions. o An atomic arithmetic expression is either an integer constant or an integer variable. o A compound arithmetic expression consists of two arithmetic expressions connected by an arithmetic operator (addition “+”, subtraction “-”, multiplication “*”). And parentheses are used to define substructures within expression. For example, 1 + 2 – 3 * 4 is parsed as: ( 1 + 2 ) - ( 3 * 4 ) · Predicates o Constructed data type o Same as arithmetic expression, predicates are not directly declared by users but are instead managed within the compiler. o An atomic predicate is a relational comparison, which can be of two types: - Integer value comparison: involving the comparison of two integers using relational operator less than (“”), or equality (“=”); or - Membership testing: used to determine if an element is a member of a set using the membership operator “@”. o A compound predicate is formed by combining “smaller” predicates (either atomic or compound) using logical operators: - Binary logical operators: two (atomic or compound) predicates connected by a conjunction (“&”) or disjunction (“|”) - Unary logical operators: Negation (“!”) which precedes another predicate. For example, P & Q and ! R where P, Q, and R are predicates. o Parentheses are also used to define substructures in predicates. Parentheses are essential for defining the precedence and grouping of operations within predicates, ensuring the correct evaluation of complex expressions. · Bool: o Basic data type o Cannot be declared by users o Has only two constants: “true” and “false” o A Boolean is produced by the evaluation on a predication without uninitialized variables. For example, x > 5 is a predicate if variable x has not been initialized. But if x has been initialized as 3 previously, then the predicate becomes 3 > 5 and can be evaluated to be Boolean “false”. The behavior. of “>” will be explained later in this document. · Set: o Constructed data type o Can be declared by users o A set is defined in using this syntax within the language { x : P(x) } where - a set defnition is enclosed within curly braces “{ }”; - “x” is a variable name called representative, whose scope is limited within this set definition; - “:” is another punctuation separating the representative x from the rest part of the definition; - “P(x)” is a predicate that applies to the variable x, serving as the characteristic function of the set, which performs a logical test on x. If P(x) evaluates to true, then x is an element of the set; otherwise, x is not in the set. o This project focuses solely on sets of integers. Other types of sets, such as sets of strings, pairs, or sets of sets are not included. This limitation is intentional, aiming to simplify the implementation process. Goliath is trying to make your life easy! · Void: o Basic data type o Cannot be declared by users o For subexpressions without any type Identifier: arbitrary strings of English letters in lower case and are not reserved by keywords. Operators: · Arithmetic operators: o “+”: integer addition, calculates the sum of two integers o “-”: integer subtraction, calculates the difference of two integers o “*”: integer multiplication, calculates the product of two integers o Multiplication has the highest precedence. Addition and subtraction have equal precedence, which is lower than multiplication. · Relational operators (for integers): o “” (Greater Than): returns “true” if the integer on the left-hand side is greater than the integer on the right-hand side integer o “=”: (Equal), returns “true” if the integer on the left-hand side is equal to the integer on the right-hand side integer · Relational operator (membership): o “@”: This operator checks if the element on the left-hand side is a member of the set on the right-hand side. It returns “true” if the element is in set, otherwise it returns “false”. · Logical operators: o conjunction “&”, disjunction “|”, and negation “!” are behaved as the following. Truth Tables for Logical Operators: & true false | true false true true false true true true x true false false false false false true false !x false true Conjunction table Disjunction table Negation table o Negation has the highest precedence, then conjunction, and then disjunction. · Set operators: o “I”: set intersection, calculates the intersection of two sets o “U”: set union, calculate the union of two sets o Intersection has a higher precedence than union. Sentences: · Each source code contains zero, one, or multiple variable declaration(s); and exactly one calculation expression. · Each variable declaration is in the following syntax let T id be E . where o T is a type name (either int or set), o id is a variable identifier, o E is an expression that assigns a value (a set definition is also a “value”, even it is not a number) of the specific type to the variable. o The period “.” Marks the end of the declaration. For example, let int a be 5 . defines an integer a whose value is 5. And let set s be { x : x = 5 } . defines a set s which contains only one integer 5. · A calculation expression starts with keyword “show” and followed by an algebraic expression, which can be an arithmetic expression, a Boolean expression (a predicate with all variables initialized), or a set algebra expression. A calculation expression is also ended by a full stop “.”. For example, o To calculates the union of sets S1 and S2:  show S1 U S2 . o To calculates the sum of integers 1 and 2: show 1 + 2 . o To test if integer 3 in S1 or not: show 3 @ S1 . Output: After the calculation, the program prints the outcome on the screen (type and value). (see the examples below). For set operators, the “show” statement does not simplify the characteristic function. For example, show { x : x > 3 } U { x : x > 5 } . will output { x : ( x > 3 ) | ( x > 5 ) } rather than { x : x > 3 } even though the two sets are equivalent. This requirement will make this project easy. The simplification of predicates is an advanced feature and will be a bonus and explained later.  

$25.00 View

[SOLVED] MSCI 242M Spreadsheet Modelling for Management R

MSCI 242M Spreadsheet Modelling for Management Individual Coursework 2024 Emissions Modelling With around 1.5 billion cars in the world today, vehicle emissions area highly relevant topic, in terms of climate change, pollution, electric vehicles usage, safety, health, noise and sustainability. The supplied dataset by the Vehicle Certification Agency (VCA) provides fuel efficiency and emissions data for 53 car manufacturers, for over 40,000 vehicles tested between 2015 to 2023. Part A – BMW Analysis [20 marks] 1. How many BMW cars have been tested? 2. How many petrol BMW cars have been tested? 3. What is the average MPG value for BMW cars, rounded to 1 decimal place? 4. What is the average MPG value for petrol3  BMW cars, rounded to 1 decimal place? 5. What is the median CO2  value for BMW cars, rounded to the nearest integer? 6. How many BMW cars are missing a numerical MPG value? 7. How many BMW cars have a transmission code which contains a number? 8. What is the highest CO2  value for a BMW car? 9. What is the lowest CO2  value for a BMW car, excluding electricity-only5  fuel types? 10. How loud (in decibels) is the loudest BMW petrol3  car? Part B – Global Analysis [20 marks] 11. How many total cars have been tested by the VCA in the supplied dataset? 12. How many petrol cars have been tested? 13. How many diesel cars have been tested? 14. How many electricity-only cars have been tested? 15. How many electric hybrid cars have been tested? 16. What is the maximum engine capacity? 17. How many cars do not have a numerical CO2  value? 18. How loud (in decibels) is the loudest car? 19. How loud (in decibels) is the loudest diesel4  car? 20. What is the model of the loudest diesel4  car? Part C – Analysis by Year [20 marks] 21.Which year saw the fewest cars tested? 22.Which year saw the biggest increase in the number of tests, compared to the previous year? 23.Which year saw the biggest increase in the numbers of tests for electric hybrid6  cars, compared to the previous year? 24.Which year has the highest number of non-numerical MPG1  values? 25.Which manufacturer registers the highest yearly average CO2? Part D – Analysis by Manufacturer [20 marks] 26.Which manufacturer has the most electric hybrid cars tested? 27. How many manufacturers have no electric hybrid cars tested? 28.Which manufacturer has the loudest cars (dB), on average? 29. Which type of transmission is the loudest, on average, for petrol  cars? 30. Ignoring manufacturers that produce solely electric-only cars, which manufacturer8 is missing the most MPG1  values? Part E – Fleet Modelling [20 marks] The sheet ‘Fleet Database’ contains data on 100 journeys made by 16 drivers. 31. Calculate the fuel cost for each of the 100 journeys, rounded to the nearest pence, based on the fuel prices given on the ‘Fleet Database’ sheet. Present the total cost of all 100 journeys in the answer cell. 32. What is the total fuel cost for female drivers of petrol  cars, rounded to the nearest pence? 33. Of the female drivers with at least 6 journeys, which driver registers the highest distance per journey? If there are no female drivers with at least 6 journeys, then return ‘no drivers’ in the answer cell. 34. It has been suggested that some of the 12 fleet cars may have an ‘incorrect’ MPG figure, in that it is it different to the MPG value for the same car listed in the VCA dataset (or the average MPG value if there are multiple versions of the car in the VCA dataset). Can you investigate this? Which of the 12 fleet cars (car code), if any, has an incorrect MPG value? If more than one of the fleet cars is incorrect, then list/spill the car codes down from the answer cell. If none of the 12 fleet cars have an incorrect MPG value, then return ‘all correct’ in the answer cell. ** Single-term students only ** You must also complete the following task. Part F – Datastack Creation [20 marks] Include a macro that will create a datastack of the electric hybrid6  vehicles only, for a single manufacturer, as chosen by the user. The datastack should be constructed on a new sheet, which should not already exist in the submitted workbook (hidden or otherwise). Ensure that the macro has no bugs, runs without crashing, can be run repeatedly without issues, and runs in a reasonable amount of time. A button has been provided on the user sheet to run the macro. Model Design The design of your model will not be assessed directly. All marks are based solely on the accuracy of your results. However,a well-structured and well-organised model will tend to be more efficient in its calculations, more accurate, and less prone to errors. Data Collection This coursework must be completed individually. The dataset you must use is the last 3 digits of your ID number. For example, if your ID number is 12345678, then you should use the dataset 678.xlsx All the datasets are different, sousing the incorrect dataset will generate incorrect results. If you have any issues about this then you must contact the tutor beforesubmission. Nothing can be done post-submission. All datasets are held on moodle in a folder called ‘Coursework Data’ Submission Deliverable is an Excel 2021 workbook addressing the tasks, uploaded to moodle. The model rules areas follows. Failure to comply with these rules will result in a mark penalty The workbook should open on the User sheet All answers should be presented in the correct cells on the User sheet The User sheet should also include your ID number Only correct results will receive full marks The workbook will be assessed on a university-specification PC running Excel 2021 All answers must be formula or function-based they must not be simple/static/pasted values they must not be generated by simple sorting/filtering methods they must not be found manually by the user The workbook should not contain links to external files The workbook should not have any hidden sheets The workbook should not have anyun-named sheets The workbook should not have any circular references The workbook should not exceed 15MB in size

$25.00 View

[SOLVED] LINC12 Fall 2024 Final Assessment Short Answer PortionPython

Final Assessment Short Answer Portion LINC12 Fall 2024 December 10, 2024 1            Putting it all Together – Translations Below you will find a short passage. The following questions are about this passage. (1)     Yusuf and Bolor are friends. Bolor has a cat, named Rosemary. Of course, Yusuf and Bolor are people. Bolor’s mother, Tuyaa, is afraid of cats.  If Tuyaa wasn’t afraid of cats, Tuyaa could visit Bolor.  Yusuf might cat-sit Rosemary. If Yusuf takes Rosemary, Bolor will be grateful, and give him a gift.  If Yusuf can take Rosemary, Tuyaa will also be grateful, and she might cook for him and Bolor.  Tuyaa has not met Yusuf, but if she cooks for him and Bolor, she must meet him. 1.1       Writing a Model (10 points) Create (write) a model that contains all of the necessary individuals and predicates to translate the passage in (1) into predicate logic. 1.2       Translations (15 points) Translate the following sentences from the passage above into Predicate Logic: (2)    If Tuyaa was not afraid of cats, she could visit Bolor. (3)    Yusuf might cat-sit Rosemary. (4)    If Yusuf takes Rosemary, Bolor will be grateful and give him a gift. (Ignore ‘will’ here; treat it as tense. ) (5)    If Yusuf can take Rosemary, Tuyaa will be grateful, and she might cook for him and Bolor. (6)    Tuyaa has not met Yusuf, but if she cooks for him and Bolor, she must meet him. 2           Quantifiers 2.1       Quantifiers in Set Relations (15 points) The underlined phrases in the following sentences below can be analysed as quantifiers.  For each of these sentences, write the truth conditions as a translation of the sentence in set notation. (7)    Acme Co. has received less than 1600 applications. (8)     The majority of people who visit St. Johns are Canadian. (9)     More than half, but not every person who got sick visited a doctor. (10)     None of the anthropologists that Chigozie knows like Chomsky. (11)    Sandra sells most of the gifts she receives from Bruno. 2.2       Modals as Quantifiers – Relative Scope (10 points) For each of the sentences below with a modal and a quantifier (or negation), write the translation into pred- icate logic using the quantificational representation of the modal force (possibility or necessity) in either Surface Scope or Inverse Scope, as indicated for that sentence. (12)    Peter must return every book. Inverse scope (13)    Sylvia can catch a fish. Surface scope (14)    Every passenger must show a ticket to the conductor. Surface scope (15)    Jess does not have to stay. Inverse scope (16)    A guard might catch Robert. Inverse scope 3            Events 3.1       Telicity (5 points) For each of the following sentences, perform and clearly evaluate one adverbial test to determine whether the underlined predicate is telic or atelic (17)    Maryam installed several light fixtures. (18)    Please submit your completed assignment online. (19)    My cat does dramatic stretches every morning. (20)    Diligent researchers have filed away thousands of hours of data logs. (21)    She was sweeping up after the event. 3.2       Aktionsart (10 points) Determine the Aktionsart of the underlined predicate in following sentences by writing and clearly evaluat- ing at least two test sentences that illustrate its defining characteristics. (22)    Vincent has a sister who repairs pianos. (23)    Jorge painted portraits for the Queen. (24)    I was terrified when the light flickered. (25)    Shelly will forget to bring my cake pan back, I promise you. (26)    Chris drove to the airport to pick me up. 3.3       Tense & Aspect (10 points) For each of the following sentences, indicate whether the Topic Time (TT) precedes, follows or is the same as (=) the Utterance Time (TU), and whether the Situation Time (SitT) contains the Topic Time, or the other way around. You can write this using angled brackets (< for precedes) or the equals sign (=) to indicate the order of TT and TU, and subset symbols (c) to describe the inclusion of SitT and TT or you can write your answer in text. For example, for the sentence “I was sleeping when Marie arrived.” you can say: the topic time is included in the situation time, and the situation time is before the Utterance Time, or: TTcSitT, TT

$25.00 View

[SOLVED] BU232620 Empirical Project 2 Linear Econometrics for Finance Python

BU.232.620 Empirical Project 2 (Linear Econometrics for Finance) Extending the the analysis in the Empirical Project 1 that focuses on the single-factor CAPM model, you will analyze the performance of multi-factor models for returns of U.S. common stocks in the Empirical Project 2. There are two tasks you are expected to take on: 1.  For the 25 stock portfolios formed on Size and Book-to-Market that you analyzed before, we now want to use the following multivariate linear regression R (t) − RF(t) = a + b [RM(t) − RF(t)] + sSMB (t) + hH ML(t) + e(t).               (1) To analyze this model and report the results, consider the following issues: •  For the two new factors (or explanatory variables in econometric language) SMB (t) and HM L (t), report their summary statistics similar to the summary statistics of RM(t) − RF(t) you reported before.  Importantly, examine the correlations of the three factors—refer to Table 2 of Fama and French (1993, page 14)—to understand whether multicollinearity is a problem. •  Tabulate the results of the multivariate linear regression model Eq. (1); refer to Table 6 in Fama and French (1993) (page 24) •  Questions to answer: Are the loadings of the 25 portfolios on the two new factors significant? Is the three-factor model better in accounting for time series variation in the return of each portfolio better than the CAPM model used in the Empirical Project 1? •  Conduct a test for the hypothesis that neither SMB (t) nor H ML (t) has significant explanatory power beyond the market excess return. 2.  Read the following seminal article (you can download it from our Canvas course site). Fama, Eugene F. French, Kenneth R., 2015. “A five-factor asset pricing model," Journal of Financial Economics, Elsevier, vol. 116(1), pages 1-22. Based on your reading and understanding, do the following analyeses: •  Download the monthly return series of the 25 stock portfolios formed on Size and Operating Profitability and the 25 stock portfolios formed on Size and Investment, again, from Ken French’s Data Library https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html Once more, you are expected to be able to find the right data; this is one of the most important skills in practice! •  Like for the portfolios formed on Size and Book-to-Market that you analyzed before, summarize the returns of these two new sets of portfolios. •  For each of the new portfolios (50 in total), examine whether the three-factor model in Eq. (1)can account for their variations. Write a project report of the aforementioned analyses.  The report should still contain the following three sections in general, but with more meat given the multiple tasks involved 1.  The first section is Introduction, which should contain a high-level summary of the re- search question, model, and findings. 2.  The second section should describe the data, including the data source and summary. •  There are multiple sets of portfolios considered, so you want to highlight the differ- ences between them. 3.  The third section should explain the model used and the findings. •  There are more than one tasks involved. For example, in the first part, you are asked to compare the performance of the one-factor and three-factor models, while in the second part, you use the three-factor model to explain two new sets of portfolios. Hence, it is naturally interesting and important to compare whether the three-factor model fares better in explaining the portfolios sorted on Size and Book-to-Market than in explaining than the two new sets of portfolios. 4.  The last section is Conclusion. What You Need to Submit • The project report • The code you use in generating all the empirical results in the report – The TA Regression Demonstration Session will teach you the key Python proce- dures necessary in conducting regression analyses. – The TA Regression Demonstration Session will only cover the key procedures rather than showing a complete code that you can simply copy and run to generate all the results needed for the report!!  You will need to learn the key procedures and then write your own complete code to generate all the results. – Some notes that discuss the main Python procedures are provided; see Canvas an- nouncements. – I will check the code to make sure no one simply copies the code from other people (the code will look somewhat different if one really writes his/her own code)!

$25.00 View

[SOLVED] Assignment 2 Introduction to Statistical Methods Matlab

Assignment 2 Please use programming to solve the following problems! Please attach your code and the corresponding output! 1.  A hospital surveyed women who had received inadequate prenatal care.  The selected mothers were divided into two groups X and Y: mothers having no more than five prenatal visits and at least six prenatal visits. The collected birth weights (in ounces) of the babies from these two sets of mothers are given below X 49 108 110 82 93 114 134 114 96 52 101 114 120 116 100 89 108 112 105 107 95 Y 133 108 93 119 119 98 106 131 87 153 116 129 97 110 121 136 115 126 125 126 120 (a)  Assume that population X is normally distributed, answer the following questions i.  Construct a 95% confidence interval for the population mean μ . ii.  Use significance level of 0.05 to carry out a hypothesis test to show that the population standard deviation is greater than 10. (b)  Assume that both populations X and Y are normally distributed, answer the following questions i.  Use significance level of 0.05 to carry out a hypothesis test on whether two population variances are equal. ii.  Based on the previous result, construct a 95% confidence interval on the difference between two population means and comment on it (c)  Use significance level of 0.05 to test whether the median of population X is 100.  [Hint:  use signrank function in Matlab]. (d)  Use significance level of 0.05 to test whether two populations have same medians.  [Hint:  use ranksum function in Matlab]. (42 marks) 2.  In order to know hours spent on assignments per week, 20 students from 4 programmes are randomly selected in a University. The corresponding data is given in the table below. Programme Hours A 2.8 3.2    3.5    4.0 3.6 B 3.2 2.9    3.6    4.5 4.8 C 2.5 3.2    3.5    4.1 3.9 D 4.6 4.2    3.9     5.8 5.2 Assume that all populations are normally distributed with equal variances. Answer the following questions. (a)  Construct a one-way analysis table and comment on it. Test with α = 5%. (b)  Perform Bonferroni method to determine which pairs of subjects differ in their means.  Test with α = 5% and use Matlab to get tα if necessary. (16 marks) 3.  A social researcher survives 50 people whose incomes range from  15k to 80k and ask them to rank their happiness on a scale from 1 to 10. Use data in txt to answer the following questions. In this dataset, income is recorded in 10k. (a)  Draw a scatter plot and comment on it.  [Hint: use scatter function in Matlab]. (b)  Estimate the regression line μY | x  = β0 +β1 x.  Do you think happiness is significantly related to income? Explain your reason. (c)  Report the R2  and comment on it. (d)  Check the normality of residuals. (e)  Estimate the mean value of happiness when income is equal to 7, and construct a 95% two-sided confi- dence interval for it. (f)  Construct a 95% two-sided prediction interval for happiness when income is equal to 7. (42 marks)

$25.00 View

[SOLVED] LINC12 Fall 2024 Midterm Short Answer Portion Python

Midterm Short Answer Portion LINC12 Fall 2024 October 24, 2024 1            Implicatures (20 points) 1.1       Calculating Implicatures (10 points) Below you will find two short dialogues, followed by an implicature that could be generated by each dialogue. Your job is to calculate how the implicature arises using Gricean reasoning. Formulate your calculations from the perspective of speaker (a). 1.1.1    Dialogue 1 (1)    Context:  Speaker A is friends with both speaker B, and their sibling, Sam.  The two siblings are  both students. Speaker A is asking about their semester. a.    Which courses are you and Sam taking this term? b.    I’m taking several psychology and linguistics courses. Sam has at least three courses. Implicature: (B) does not know which courses Sam is taking. 1.1.2    Dialogue 2 (2)    Context:  Speaker B is tired, and walking home from work.  They pass through a busy intersection, where an energetic public salesperson (speaker A) with a clipboard begins to follow them and ask questions. a.    Nice sweater! You seem like a fashionable person. Have you heard about the new store opening up a few blocks from here? I have coupons for 20% off on shoes! Where do you live? b.    I live in Antarctica. Implicature: B wants the salesperson to leave them alone. 1.2        Implicature or not?  (10 points) Below are five sentences, followed by an inference. Determine whether or not this inference is an implicature of the sentence by performing a test and evaluating the results.  Clearly state what test you are performing, and what the conclusion is. (3)    a.    Some of my friends are vegetarian. b. Inference: not all of my friends are vegetarian. (4)    a.     Brìghde started teaching Gaelic this year. b. Inference: Brìghde didn’t teach Gaelic before. (5)    a.     Dalton called his mother and drive back to the reservation. b. Inference: Dalton called his mother first, and then drove back, in that order. (6)    a.     I know Chim came home some time late – must have been after midnight. b. Inference: The speaker does not know exactly when Chim returned. (7)    a.     My mother drove my car to the airport because hers broke down. b. Inference:My mother drove to the airport. 2            Entailments and Presuppositions (12 points) For the following pairs of sentences, decide whether the second sentence is an entailment of the first, or is a presupposition, or whether there is no relation.  Support your answer by performing test(s), evaluating the results, and describing the conclusions. When there is no logical relation between two sentences, make sure you demonstrate this with entailment tests from both directions.  When you can demonstrate entailment or presupposition, focus on showing the the second sentence is an entailment or presupposition of the first sentence. (8)    a.     Virginia was unable to find my favourite restaurant again. b.    Virginia had found my favourite restaurant before. (9)    a.     Sandra and her aunt adore wildflower honey. b.    Sandra’s aunt adores wildflower honey. (10)    a.     Winter is especially harsh in the Maritimes. b.    Winters are cold in the Maritimes. (11)    a.     The texture of this dessert is oddly pleasing. b.    The texture of the dessert is odd. (12)    a.     It’s odd that Regina didn’t come into work today. b.    Regina didn’t come to work today. (13)    a.     Bjorn rushed home after work to practice accordion. b.    Bjorn went home after work. 3           Speech Acts (5 points) Below you are presented with a number of sentences. Your job is to identify, descriptively, the illocutionary force of these sentences if uttered in the real world, and then to classify this illocutionary force under one of Searle’s classes of illocutionary acts. (14)    Do you have any hot sauce? (15)    I’ll be home by 10pm. (16)    I’m so glad you could visit. (17)    Meeting adjourned. (18)    Let passengers exit the train first. 4           Truth Tables (18 points) 4.1        Filling in Truth Tables (4pts) In the following truth table, there are missing values, represented by __.  Fill these in to complete the truth table. Note: in this presentation, the value of an expression (e.g.  (p → r) ) appears under the connective, (e.g. → ). You can consider this to be a column containing that whole expression.  For negation of a proposition (e.g.  →r), the value appears under the connective (e.g.  →) as well.  As these columns are sub-parts of the larger expression, they will appear next to or inside of larger expressions, with the truth value of the entire formula being represented under the highest-level connective, in the centre of the table.  Below, this is the biconditional. 4.2        Identifying Errors in Truth Tables (4 points) In the following truth table, there are several errors.  Identify these errors, and state what the correct value should be. This can be done by circling or crossing out the incorrect value and writing the correct one near it, or on the side connected by an arrow.  Rows have also been numbered, so alternatively, you can answer descriptively in text in the following way, for example: “In row 4, the value for (p Λ r) should be F” Note: in this presentation, the value of an expression (e.g.  (p → r) ) appears under the connective, (e.g. → ). You can consider this to be a column containing that whole expression. For negation of a proposition (e.g. ¬r), the value appears under the connective (e.g. ¬) as well. As these columns are sub-parts of the larger expression, they will appear next to or inside of larger expressions, with the truth value of the entire formula being represented under the highest-level connective, in the centre of the table. 4.3       Using Truth Tables to identify Equivalence (10 points) Are the following two formulas equivalent? (19)    a.     (pΛr)∨¬(rΛq) b.    (¬p∨¬q)∨(¬p∨¬r) To answer this question, first fill in the final two columns of the truth table below. (The beginning of the truth table with some relevant sub-formulas has been provided for you.) Then, state clearly in written form. whether or not the two formulas in (19) are equivalent, and identify any / which valuation rows in the table that lead you to this conclusion. 5           Predicate Logic and Models (20 points) The questions in this section are about the following model, M1 •  U = {Bjorn, Sam, Regina, Lemon, Basil, Laura, April} [ b ] M1 = Bjorn; [ s ] M1 = Sam; [ r ] M1 = Regina; [ e ] M1 = Lemon; [ i ] M1 = Basil; [ l ] M1 = Laura; [ a ] M1 = April •  [ CAT IM1  = {Lemon, Basil} •  [ PERSON IM1  = {Bjorn, Sam, Regina, Laura, April} •  [ CHILD IM1  = {Sam, Regina, April} •  [ INTRODUCE IM1  = {〈Laura, Sam, Bjorn〉,〈Regina, Bjorn, Lemon〉,〈Regina, Basil, Lemon〉} •  [ LIKE IM1  = {〈Bjorn, Lemon〉,〈Bjorn, Basil〉,〈Regina, Lemon〉,〈Regina, Basil〉,〈Laura, Lemon〉} •  [ BITE IM1  = {〈Basil, Lemon〉,〈Basil, April〉,〈Basil, Laura〉} •  [ SLEEPY IM1  = {Sam, Regina, Lemon, Basil, April} 5.1        Evaluating Truth of statements relative to M1 (14 points) Below are several statements, written in either plain English, or in the syntax of Predicate Logic. You should determine whether these statement are true in the given model, and say very briefly (one or two sentences) how you know, or where you looked to determine this. 1.   |{x :〈[ i IM1  , x〉∈ [ BITE IM1}| ≤ 3 2.  Laura likes every cat. 3.  {x : (x ∈ [ CHILD IM1) V (x ∈ [ CAT IM1)} ∈ [ SLEEPY ]M1 4.  Basil bit a child. 5.  {x :〈[ i IM1  , x〉∈ [ BITE IM1 } C {x :〈x , [ i IM1〉∈ [ LIKE IM1} 6.  INTRODUCE(r,s,e) 7.  Only one childlikes a cat. 5.2       More work with M1 (6 points) 5.2.1 Write a new definition for a “know” relation in M1 that reflects those individuals that have been introduced to eachother. 5.2.2 Rewrite the definition of the LIKE relation in M1 so that Lemon likes all the children (everything else in the LIKE relation remains the same). 5.2.3 Lemon has started scratching people.  Write a definition for a “scratch” relation where Lemon scratches at least three other individuals.

$25.00 View

[SOLVED] NBS8289 - Research Methods SQL

NBS8289 - Research Methods End-of-module summative assessment In your end-of-module summative assessment, you should address the following brief: With reference to academic literature, discuss the issues to be considered when analysing research data. [The assessment brief is asking you to write about the things that a researcher should take into account when analysing research data: what should a researcher think about when planning their data analysis and/or when analysing their data?]. In your response, you must draw on and cite at least four methodological journal articles and two empirical journal articles on a topic relevant for your programme of study. In completing your Assessment, you must engage with recent research - that is:       methodological articles that have been published in the past 10 years       empirical articles that have a publication date in the last 7 years Methodological journal articles       The Module’s Reading List includes more than 50 methodological journal articles – you can choose relevant articles from this list to develop your essay.       If you wish to source your own methodological articles, that meet the essential requirements of the brief, then see the Module's Reading list, 'Journals - Methodology and Methods' section for journal titles.       You must choose a methodological article that considers a qualitative method of data analysis (e.g. thematic analysis) or a quantitative method of data analysis (e.g. regression analysis). Do not draw on an article that uses mixed data (both qualitative and quantitative).       For advice on sourcing articles via the Library website, the Library have produced this blog -> ‘Finding empirical and methodological articles’ Empirical journal articles         The Module’s Reading List includes more than 50 empirical journal articles – you can choose relevant articles from this list to develop your essay.       If you wish to source your own empirical articles, that meet the essential requirements of the brief, then you can search within a range of journal titles including The International Journal of Human Resource Management; Journal ofInternational Business Studies; Work, Employment and Society; Organization Studies; Journal of International Management; Employee Relations and Human  Resource Management Journal. For more journal titles that relate to your programme of study see the 'Module Handbook'.       You must choose a methodological article that considers a qualitative method of data analysis (e.g. thematic analysis) or a quantitative method of data analysis (e.g. regression analysis). Do not draw on an article that uses mixed data (both qualitative and quantitative).       For advice on sourcing articles via the Library website, the Library have produced this blog -> ‘Finding empirical and methodological articles’ Approaching the Assessment: You choose the method of data analysis that will form. the basis of your essay, but you might choose to write about the data analysis method that most interests you (this could be the approach that you are likely to use in your future studies). Whatever method of data analysis you choose to write about in your essay; first, proactively engage with the module’s ‘data analysis’ materials. Next, read the relevant chapter in the module’s text book to build your foundational knowledge around data analysis. Then, search for methodological articles that discuss your chosen approach. Read the articles to acquire further knowledge of the data analysis approach; for example, what are its strengths, weaknesses, when is it useful, what are the potential problems etc. Note: you would not simply describe the strengths and weaknesses etc. of the approach to data analysis in your essay; rather, this broad knowledge   gives you a foundation to build on. Next, search for empirical articles that use your chosen approach to data analysis and consider what issues (things) the author(s) took into account when analysing the data they had collected. Read the empirical article/s with the aim of understanding the research project - its aims, processes and claims. Then, you can apply and integrate your knowledge from the methodological journal articles with your knowledge of the empirical journal articles to address the Assessment brief. Formative feedback:       Drop-in session 3 in Teaching Week 15 is dedicated to the providing formative feedback for this end-of-module assessment       This Drop-in session will be delivered via zoom and will provide a valuable opportunity for you to discuss your ideas with peers and ask questions of  faculty to help you identify the key ‘issues’ (things to be considered) that  surround data analysis, prior to submitting your assessment       During Teaching Week 15, you will also be able to post any additional questions about the assessment on the dedicated Canvas ‘Discussions’ board       Please note: The Drop-in session and ‘Discussions’ board are your only opportunity to ask questions about the assessment. Please do not email faculty on the assessment; the module team cannot answer any questions on the assessment via email, unless specified in a Student Support Plan Deadline:       The deadline to submit your Assessment is Monday 06 January 2025 at midday (12pm) (UK, Greenwich Mean Time) Format:       The word count is 1,400 words (+ / - 10%)       Your Assessment must be word processed and submitted as Word or PDF file       Please use Times New Roman or Arial as your font in size 12       You must include a Reference list at the end of your essay. A Reference list details the works that have been cited in the essay.       The Reference list is not included in the word count.       Please use Cite Them Right Harvard as your referencing style       Intext citations e.g. (Author, year) are included in the word count.       There is no template cover sheet - instead, on the first page of your Assessment enter 1) the module number and module name and 2) the word count of your essay       The Assessment will be marked anonymously; please do not put your name anywhere on the document       Further formatting guidelines are in the 'Module Handbook' on Canvas Submission:       Your Assessment must be submitted electronically through the TurnItIn link, which will be made available in the ‘Assignments’ section on Canvas       The 'Assignments' section will be made available in Canvas' left-hand menu during the assessment period       You do not need to submit a hard copy of your Assessment       You only have one opportunity to submit your Assessment via TurnItIn       You will need to check if your submission has been successful via TurnItIn on Canvas       If there is no record of your submission on Canvas, your submission has been  unsuccessful. This means that TurnItIn has no record of your Assessment and, therefore, it cannot be marked. You are likely to be penalised for late submission and may have to be reassessed in the next assessment period       You must keep all documentation relating to your Assessment until the marks   have been confirmed by the Board of Examiners at the end of your programme of study Marking and Summative Feedback:       This Assessment is worth 70% of the module mark       Your Assessment will be marked in accordance with the marking scheme provided in your degree programme handbook and the ‘Postgraduate Assessment Criteria’ posted to Canvas       We endeavour to provide you with your grade and individual feedback via TurnItIn within 20 working days of the end of assessment period

$25.00 View

[SOLVED] 09 38897 LC Studying Societies Social Anthropology Statistics

LC – Studying Societies: Social Anthropology Module Code: 09 38897 Assessment weighting: 50% You should write an essay of 1000 words in response to the essay question listed below.  For further guidance on the format and submission of the essay see the module canvas page. How do contemporary social anthropologists understand “culture” and why are they careful about how they use this term? NB: Essays submitted later than the deadline will incur a penalty of 5 marks per working day (12 noon is the end of a working day for these purposes).  Penalties will also be applied if you go more than 100 words above the word limit of 1000 words. This word limit includes quotations, references, and footnotes, but not your bibliography.

$25.00 View

[SOLVED] EEC 210 Practice Final Problems C/C

EEC 210 Practice Final Problems December 2, 2024 1 Transimpedance Amplifier Figure 1 shows a transimpedance amplifier. Source iin  is a small-signal current source only. For this problem, use the transistor parameters in Table 1, and IBIAS  = 100 µA, RL  = 10 kΩ, RS  = 625 Ω, and CL  = 100 fF. Table 1: Problem 1 Transistor Parameters. Problem 1.1 (3 points) Find the width W of M1 such that the large-signal output voltage VO  = 2 V. You may ignore channel- length modulation for this part. Figure 1: Transimpedance amplifier. Problem 1.1 (cont.) Problem 1.2 (4  points) Draw and label the small-signal model for the amplifier assum- ing M1 is active and ignoring all junction and overlap capacitances (i.e., consider intrinsic capacitance only). Problem 1.3 (5 points) Find the small-signal transimpedance DC gain ZDC  = i in/vo. Problem 1.4 (6  points) Estimate the -3dB frequency (in Hz) using the method of zero- value time constants (open circuit time constants). Problem 1.5 (2 points) Suppose the transfer function of the amplifier is modeled as: where ZDC  and ω−3dB  = 2πf−3dB  are as you found above. Find the location of the second pole ω2  = 2πf2  > ω−3dB  such that the phase margin is 45◦ when the amplifier is placed in unity gain feedback. Problem 1.6 (2 points) Is your answer for Problem 1.5 realistic? Why or why not? Figure 2: Operational amplifier. 2    Operational Amplifier Figure 2 shows the circuit schematic for an operational amplifier. For this problem, use the transistor parameters in Table 2.  Assume that all transistors are biased in saturation and the following circuit parameters:  VS  ≈ 0V, IB1  = IB2  = 2 mA, RB1  = 500 kΩ, R1  = R2  = 20kΩ, (W/L)1  = (W/L)2  = (W/L)3  = (W/L)4  = 200, (W/L)5  = (W/L)6  = 20. Table 2: Problem 2 Transistor Parameters. Problem 2.1 (5 points) Find the differential-mode gain, v id/vo, where vid  = v+ − v− . Problem 2.2 (4  points)  Assume the  second stage common-mode gain Acm   =  −60 dB. Find the common-mode rejection ratio (CMRR) for the op amp expressed in dB. Problem 2.3 (3  points) Suppose resistors R1   and R2  can each deviate from its nominal value by  ±5%.   Assuming  there  is  no  other  mismatch,  find  the  approximate worst  case magnitude input-referred offset VOS . Problem 2.4 (2 points) Do you expect mismatch in transistors M3-M6 to make a signifi- cant contribution to the input-referred offset? Why or why not? Figure 3: Current source. 3 Current Source Figure 3 shows a current source. For this problem, use the transistor parameters in Table 3. Table 3: Problem 3 Transistor Parameters. Problem 3.1 (9 points) Find the smallest (W/L)1 , (W/L)2 , and (W/L)3  which simulta- neously set the output current IOUT  = 400µA, VO,MIN  = 100 mV, M1 and M2 in the active (saturation) regime, and M3 in the triode (linear) regime. You may neglect channel length modulation for this first part. Problem 3.2 (2  point)  Find  the output resistance  RO   of the  current source given the dimensions you found in Problem 3.1. Figure 4: Bias voltage generator. 4 Bias Voltage Generator Figure 4 shows a proposed bias voltage generator circuit.  For this problem, use the transistor parameters and constants in Table 4. Assume that a startup circuit (not shown) forces the branch currents to be nonzero. Table 4: Problem 4 Parameters. Problem 4.1 (8 points) Find (W/L)1  = (W/L)2 and (W/L)3  = (W/L)4 such that VBIAS  = 1.75 V at T = 300 K. Problem 4.2 (8 points) Find the RMS output noise voltage due to the shot noise of diode D2 over a bandwidth of 100 MHz for the transistor sizes you found and the operating point in Problem 4.1.

$25.00 View

[SOLVED] Assignment Three Database Java

Assignment Three: Database Released: 20th November 2024 Due: 23:59, 18th December 2024 Synopsis: You are going to store and manipulate some data in aMongoDB database. The data are related to events and locations, similar to the suggested dataset in our project. Problem 7E and Problem 8E are compulsory questions for ESTR students. For CSCI students, you may also attempt these questions. However, we will only give you feedback without any extra scores. Environment setup: Please follow lab08 to setup a basic web server using Node.js and Express. Also, please follow lab09 to setup aMongoDB database and access it using Mongoose in Node.js. Problem 1: Database Schema (20%) Schema and Model in Mongoose help to confine the types of data to be stored. Your task is to setup two Schemas: 1.   Event: a.   eventId: number, required, unique b.   name: string, required c.   loc: ObjectID -> location documents* d.   quota: number 2.   Location: a.   locId: nmuber, required, unique b.   name: string, required c.   quota: number *Remarks: Try to accommodate the reference to documents in the location collection. Check Lecture 17 MongoDB from the Blackboard. Problem 2: GET (15%) Your Express server should respond to this request: GEThttp://server-address/ev/eventID When the server receives this request, look up the event with the given event ID from the database. Then print the event name, location ID, location name, event quota on separate lines, as shown in the illustration below. The location quota is not necessary. All field names and string  values  should  be  quoted  with  double  quotes.  Extra  spacing  is  allowed,  and brackets/commas do not need to be in separate lines. If the given event ID is not found, output an understandable message in the response body with status  code  404. All the response  should  be  sent  as  HTTP responses  with  content  type text/plain.   Problem 3: POST (15%) Your Express server should respond to this request: POSThttp://server-address/ev When the server receives this request, it should use the parameters submitted in the HTTP request body to create a new event in the database. A simple HTML form. like lab8_task2.html in Blackboard can be used. However, instead of letting the user decide the event ID, your code should assign a new maximum event ID by looking into the database. For example, if 123 is the current maximum event ID, the new event ID would be 124. Modify the form so that it asks the user for the location ID. A lookup should be done to check if the location quota is larger than or equal to the new event quota. If not, the event should not be created, and an error message should be responded to the user with status code 406. (Note: There is no need to check other event at the same location.) If the event is created successfully, respond to the user with the URL of the created event. Use HTTP status code 201. Problem 4: DELETE (10%) We allow users to delete an event using this request: DELETE http://server-address/ev/eventID If the event ID is found, the event should be removed from the database. Send a response with status code 204, and nothing in the body. If not found, show a simple error message in the body with status code 404. Problem 5: Some more queries (20%) The following four requests need to be handled: Q1: GEThttp://server-address/ev List all the events available, with details formatted similar to the illustration below. Q2: GEThttp://server-address/lo/locatoinID Show the details for this location ID, with details formatted similar to the illustration below. Respond with an error message if the location ID is not found with the status code 404.   Q3: GEThttp://server-address/lo List all location available. Show details similarly to the illustration in Q1. Q4: GEThttp://server-address/ev?q=number List all the events with enough quota, with a similar format in Q1. Respond with an empty array if there is none. Problem 6: Updating with PUT (20%) Implement a simple HTML user interface for updating event information. Assume that the user always types in an existing event ID to load the event information. The current data from the database should be shown to the user, so that they can decide what to edit, in an HTML form. Then, update the database with the user data on submission, using this request: PUThttp://server-address/ev/eventID The event should always be updated successfully. Respond to the user with the updated event  details as in Problem 1. You may combine this HTML form. with the POST form in Problem 3 or create a new HTML file. Checking of event and location quota is not necessary here. Problem 7E: Counting GET (15%) In every GET queries in this assignment, add an extra field “query_no”, which indicates the total count of GET queries for this user on this browser including requests giving errors. Show it only in the response when there is no error. The count should be reset if there is no further query in 5 minutes. Q1: Perform GET http://server-address/ev/1 (or any other GET operations) for several times   and show the details for this response with “query_no” larger than 1 similar to the illustration below.   Q2: GEThttp://server-address/ev/1 (or any other GET operations) after 5 minutes and show the details for this response with “query_no” equal to 1 similar to the illustration below.   Problem 8E: GraphQL GET (20%) You are required to transform. all GET operations in this assignment into a GraphQL API using Apollo Server while maintaining the same underlying data model and business logic. After starting     the      server      with     node      server_graphql.js      command,      navigate     to http://localhost:3000/graphql in your browser. You can query all locations and events, and your response should be similar to the examples below:   Formats and assumptions: Please pay attention for the followings: 1.   In this assignment, since the response body do not always confirm to standard JSON formats, e.g., for error messages, please always use text/plain as the Content- Type. 2.   The  JSON-like  objects  and  arrays   should  be  readable  by  standard  JavaScript JSON.parse() if all newline characters are removed. 3.   Use the CORS middleware for express to enable submission from local HTML forms (more details in lab08). 4.   Unless otherwise specified, the HTTP status code should be 200 OK by default. 201 Created is used for responding to successful POST requests, and 204 No Content is used for responding to successful DELETE requests. 5.   For development, you may feel free to populate your database with testing data (i.e., create your own fake data for testing). Please create a folder named database_setup. You can create database whose name is assignment3 and create two collections which are locations and events. In the locations collection, please import from JSON file database_setup/assignment3.locations.json. In the events collection, please import from JSON database_setup/assignment3.events.json. 6.   For grading, graders will use another set of data in their database. Hence, you code should be adaptive to different data. Assume that there is always at least one location and one event in the database when grading (i.e., it will not be an empty database). All locations linked from events are valid in the database. 7.   Assume that the input data type is always correct, i.e., only numbers will be input for number fields. All numbers are positive numbers. When grading, no fields are blank. 8.   Assume that user always enters a valid and existing location ID when creating or updating events. 9.   Unless otherwise specified, events or locations with missing quota will not be tested. 10. The  Node  server  should  start  at  port  3000.  Assume  the  access  URL  starts  with http://localhost:3000. 11. There are no cosmetic requirements for this assignment. You are welcome to implement extra styles and features at your own ability. 12. Your submission should contain only one JavaScript file (one more JavaScript file for Problem 8E).

$25.00 View

[SOLVED] Math 425 Fall 2024 - HW 11 Prolog

Math 425 Fall 2024 - HW 11 Due Friday 11/15, 11:59pm, via Gradescope Please note: (1). Please include detailed steps. Only providing the result will not get full credits. (2). Please write at most one problem in each page. If you reach the bottom please start a new page instead of writing two columns in one page. If a problem contains multiple small questions, you may write them in one page. (3). Please associate pages with problems in Gradescope. 1. Let X and Y denote the coordinates of a point uniformly chosen in the circle of radius 1 centered at the origin. Find the joint density function fR,Θ(r, θ) of the polar coordinates R = √X2 + Y2 and Θ = arctan(X/Y). 2. If X1 and X2 are independent exponential random variables, both having parameter λ, find the joint density function fY1,Y2 (y1, y2) with Y1 = X1 + X2 and Y2 = e X1. 3. Amy throws a fair die and simultaneously flips a fair coin. If the coin lands head, then she wins twice of the value that appears on the die. If tails, then she wins one-half of the die value. Determine her expected winnings. 4. If X and Y have joint density function (1). Find E[XY ]. (2). Find E[X]. (3). Find E[Y ].

$25.00 View

[SOLVED] CSC110Y1F Final Examination 2022 Python

CSC110Y1F (All Sections) Final Examination Date: December 2022 Examination Period 1. [15 marks] Short answer. (a) [3 marks] Each of the following interactions in the Python console ends with an expression and blank space. For each one, write the value that would be displayed.  If evaluating the code would cause an error, write  “ERROR” and briefly  explain why the  error would occur. >>>  len('CSC110')  +  len({'abc'}) >>>  {'hi':  2,  'bye':  3}[2] >>>  sum([x  *  2  for  x  in  [1,  3,  5]  if  x  >  2]) >>>  words  =  ['chocolate',  'orange',  'is',  'tasty'] >>>  words[1][0]  +  words[0][1]  +  words[3][0] >>> my_stack  =  Stack1()   #  Assume  this  is  a  valid  Stack  implementation >>> my_stack.push(1) >>> my_stack.push(2) >>> my_stack.pop() >>>  numbers  =  [10,  1,  3] >>>  numbers  =  list.sort(numbers) >>>  numbers[0] (b) [5 marks] Answer each of the following questions.  You only need 1-3 sentences per response. (i)  David says, “The Python interpreter allows us to access private instance attributes of a class, so it’s useless to mark instance attributes as private.” Explain why David is incorrect. (ii)  Tom says, “The Diffie-Hellman algorithm is an example of a symmetric-key cryptosystem.” Explain why Tom is incorrect. (iii)  Define the term abstract method. (iv) In our Python files, we typically write testing code like doctest.testmod() inside an if statement, if name ==  ‘ main ’ . Explain why we do this. (v) In our run simulation function, we used a priority queue (events) to store the simulation’s events. For your reference, here is the main simulation loop code: while  not  events .is_empty(): event  =  events.dequeue() new_events  =  event.handle_event(system) for  new_event  in  new_events: events.enqueue(new_event) Explain why we used a priority queue instead of a queue. (c) [3 marks] Consider the following code: @dataclass class  Person: """A  person . Instance  Attributes: -  name:  The  name  of  this  person . -  pet:  A  pet  dog  that  this  person  owns,  or  None  if  this  person  does  not own  a  pet  dog . """ name:  str pet:  Optional[Dog]  =  None @dataclass class  Dog: """A  pet  dog . Instance  Attributes: -  name:  The  name  of  this  dog . -  owner:  The  person  who  owns  this  dog . """ name:  str owner:  Person (i) What does the type annotation Optional[Dog] (for pet) mean? (ii)  Translate the following Person representation invariant into valid Python code:  “If this person (self) owns a pet dog, then that dog’s owner is the same object as self.” (d) [4 marks] Consider the following function definition, which uses the defintions from the previous part. def  get_dog(person:  Person,  dog_name:  str)  ->  Dog: """Modify  the  given  person  to  become  the  owner  of  a  new  dog  named  dog_name . Return  the  new  dog . Preconditions: -  person.pet  is  None """ #  MARKER  A new_dog  =  Dog(name=dog_name,  owner=person) person.pet  =  new_dog #  MARKER  B return  new_dog Suppose we run this function in the Python console and execute the following code: >>>  tom  =  Person(name='Tom') >>>  get_dog(tom,  'Fluffy') The object-based memory model diagram below shows the state of memory at MARKER  A, when get dog is first called. Modify the diagram to show the the state of memory at MARKER  B, immediately before get dog returns. You may need to add additional boxes for new objects, and/or modify existing parts of the diagram. 2. [9 marks] Programming. (a) [4 marks] Implement the following function, according to its docstring.  You must use comprehension expressions in your solution, and may not use loops. You may, but are not required to, define a helper function in your solution.  Any helper functions you define must include type annotations but do not need to include a docstring. def  len_special_lists(lists_of_numbers:  list[list[int]])  ->  list[int]: """Return  the  lengths  of  the  given  lists  of  numbers  that  contain at  least  one  even  integer . >>>  lists1  =  [[1,  3],  [110],  [1,  2,  3,  4]] >>>  len_special_lists(lists1)   #  [110]  and  [1,  2,  3,  4]  have  at  least  one  even  integer [1,  4] >>>  lists2  =  [[],  [1],  [1,  3,  5,  7]] >>>  len_special_lists(lists2)   #  No  list  has  at  least  one  even  integer [] """ #  TODO:  write  your  function  body  here (b) [5 marks] This part considers a function nutrient totals with two parameters: •  foods:    set[str]. A set of foods in a meal, for example: {'twinkie',  'fries'} •  food to nutrients:   dict[str,  dict[str,  int]]. A nested dict that stores the number of grams of  ‘carbs’ , ‘protein’, and ‘fat’ in different food items. For example: {'twinkie':       {'carbs':  47,  'protein':  2,   'fat':  9  }, 'fries':             {'carbs':  40,  'protein':  3,   'fat':  17}, 'protein  bar':  {'carbs':  21,  'protein':  20,  'fat':  5  }} nutrient totals returns a new dict containing the total number of grams of ‘carbs’ , ‘protein’, and ‘fat’ across all of the given foods. Complete function nutrient totals by implementing the function body. You may  not  define any helper functions. def  nutrient_totals(foods:  set[str], food_to_nutrients:  dict[str,  dict[str,  int]])  ->  dict[str,  int]: """See  description  above . Preconditions: -  all(food  in  food_to_nutrients  for  food  in  foods) -  food_to_nutrients  is  in  the  format  described  above >>>  f_to_n  =  {'twinkie':       {'carbs':  47,  'protein':  2,    'fat':  9  }, . . .                      'fries':             {'carbs':  40,  'protein':  3,   'fat':  17}, . . .                      'protein  bar':  {'carbs':  21,  'protein':  20,  'fat':  5  }} >>>  actual  =  nutrient_totals({'twinkie',  'fries'},  f_to_n) >>>  expected  =  {'carbs':  47  +  40,  'protein':  2  +  3,  'fat':  9  +  17} >>>  actual  ==  expected True """ #  Accumulate  the  result  in  the  following  provided  dict   nutrients_so_far  =  {'carbs':  0,  'protein':  0,  'fat':  0} #  TODO:  complete  the  body  of  the  function return  nutrients_so_far 3. [5 marks] Debugging and testing. Consider the following function definition. def  space_counts(strings:  list[str])  ->  list[int]: """Return  the  number  of  space  characters  in  each  given  string . >>>  space_counts(['Tom',  'David  is  cool']) [0,  2] """ spaces_so_far  =  0   counts_so_far  =  [] for  string  in  strings:   for  char  in  string: if  char  ==  '   ':                 #  Check  whether  char  is  a  space spaces_so_far  +=  1 list.append(counts_so_far,  spaces_so_far) return  counts_so_far This implementation of space counts does pass the doctest example, but actually has a subtle error, and so is not correct on all possible inputs to the function. (a) [2 marks] Complete the unit test below to show an example valid input to space counts that will cause the test to fail because this implementation returns an incorrect value. def  test_space_counts_error()  ->  None: """A  test  case  for  space_counts  that  reveals  an  error  in  the  given  implementation . If  we  ran  this  test  with  pytest  and  the  current  implementation,  we  would  expect this  test  to  *fail*  because  of  the  error  in  the  function  body . """ actual  =  space_counts(                                                                                    )  #  FILL  THIS  IN expected  =                                                                                                              #  FILL  THIS  IN assert  actual  ==  expected (b) [1 mark] Explain what is the error in the given implementation.  Do not explain how to fix the error here. (c) [1 mark] Explain how to fix the error. (d) [1 mark] Explain why the doctest example passes for the given implementation of  space counts, even though that implementation has an error. For your reference, here is the doctest example: >>>  space_counts(['Tom',  'David  is  cool']) [0,  2] 4. [6 marks] Number theory. Consider the following statement: “For all integers a, b, and c, IF gcd(a,b) = 1 and a divides bc, THEN a divides c.” (a) [1 mark] Translate the above statement into symbolic logic. You may use the gcd function and divisibility symbol | in your translation; do not expand the definition of divisibility. (b) [5 marks] Prove the above statement. Your proof may use any definitions and theorems provided on the Reference Sheets, but no other theo- rems/properties of divisibility or modular equivalence. We have left space for rough work here and on the next page, but please write your formal proof in the box below. Hint: use the GCD Characterization Theorem and multiply an equation by c. 5. [9 marks] Object-Oriented Modelling. In this question, you will write Python code to model students and courses at a university. (a) [5 marks] First you’ll create a data class to represent a student, based on the following description: A student has a user name (e.g., ‘liudavid’) and a mapping to keep track of courses they have passed, where each key of the mapping is a course code (e.g.,  ‘CSC110’) and the associated value is the integer grade they received in that course (e.g., 85). Each student must satisfy the following properties: 1.  The student’s user name is non-empty. 2.  Every grade associated with a passed course is between 50 and 100, inclusive. In the space below, complete the data class by writing instance attribute names and type annotations in the class body and appropriate representation invariants in the docstring. NOTE: You may not use the dict .values method in this question. @dataclass class  Student: """A  class  representing  a  university  student . NOTE:  you  do  not  need  to  write  English  descriptions  of  the  instance  attributes . Just make  sure  to  pick meaningful  attribute  names  in  the  class  body . Representation  Invariants:    (TODO:  write  appropriate  representation  invariants  here) """ #  TODO:  write  appropriate  instance  attribute  names  and  type  annotations  here (b) [4 marks] In the space below, we’ve begun a class Course to represent a university course. class  Course: """A  class  representing  a  university  course . Instance  Attributes: -  code:  This  course's  course  code,  e.g .  'CSC110' -  students:  A  list  of  students  currently  enrolled  in  this  course Representation  Invariants: -  every  student  in  self .students  has  a  unique  user  name """ code:  str students:  list[Student] Complete the following method for the Course class. You may not define any helper functions. class  Course: . . .  #  continued  from  above def  enrol(self,  student:  Student)  ->  bool: """Enrol  the  given  student  in  this  course  and  return  whether the  student  was  successfully  enrolled . Do  NOT  enrol  the  student  if  either: 1 .  The  student  has  already  passed  this  course  (i .e . ,  this  course's  code  is in  the  student's  "passed  courses" mapping) . 2 .  There  is  a  student  with  the  same  user  name  already  enrolled  in  this  course . (In  those  two  cases,  False  should  be  returned.) """ 6. [6 marks] Running-time analysis. Analyse the running time of the following function, in terms of n, the length of its input list, and/or the input value m. To simplify your analysis, you may ignore the running time of Line 4. def loopy(numbers: list[int], m: int) -> None: # Line 1 """Precondition: m >= 0""" # Line 2 for number  in numbers: # Line 3 (Loop 1) i = 1 # Line 4 while i   None: """Precondition: m  >=  0""" for  i  in  range(0, m): if  i  in  numbers: print('Found') else: print('Not  found') (a) [5 marks] Perform. a lower bound analysis of the worst-case running time of this function, in terms of n, the length of numbers, and/or the input value m.  The Omega expression that you conclude should be tight, meaning that the worst-case running time should be Theta of this expression, but you are not required to show that. (b) [2  marks] Suppose we modify f so that the numbers parameter is a set[int] instead of a list[int]. How would the running time of this function change?  Briefly explain your answer, but do not  perform a formal running-time analysis. 8. [3 marks]  Stacks/Queues/Priority Queues ADTs. Warning: this is meant to be a challenging question, and is deliberately weighted less than other questions. We strongly recommend completing the rest of this  exam  before  attempting  this question. Implement the following function, according to its docstring. You may not define any helper functions. def  pop_biggest(stacks:  list[Stack])  ->  int: """Remove  and  return  the maximum  item  that  is  on  the  top  of  one  of  the  given  stacks . Return  0  if  all  given  stacks  are  empty . Preconditions: -  the  top  element  of  each  stack  is  an  int  and  is  >  0 -  the  top  element  of  each  stack  is  unique  (so  don't  worry  about  ties) """ #  TODO:  write  your  function  body  here

$25.00 View

[SOLVED] AE6102 ADVANCED MACROECONOMIC THEORY PROBLEM SET 2 Python

AE6102 ADVANCED MACROECONOMIC THEORY PROBLEM SET 2 IS-MPR-PC Instructions: You are required to work on Problem Set 2 for submission on NTULearn by 15 December 2024, 1159pm. Group 3 is to present Question 1, Group 4 Question 2 and Group 5 Question 3. 1.     The IS curve is given by: yt   = yt(*) — α(it  — πt   — r *) + εt(y) Monetary policy rule (MPR) is: it  = r *  + π *  + βπ (πt  — π *) And the Phillips curve (PC) is: πt  = πt(e) + Y(yt  — yt(*)) + εt(π) All variables and parameters are as described in the lectures. Assume that βπ   >  1. (a)   Derive the IS-MPR curve by substituting the monetary policy rule into the IS curve. Show the full derivation and explain the role of βπ   in determining the slope and intercept of this curve. (b)   Assume a positive aggregate demand shock. Solve for the new equilibrium levels of output and inflation algebraically. Provide graphical illustrations. (c)    If inflation expectations rise following the aggregate demand shock, analyze how this amplifies the impact on inflation and output. Discuss the central bank’s response under different values of βπ . 2.     Using the IS-MPR-PC model, examine the effects of a rise in public inflation expectations when the central bank adjusts interest rates according to a Taylor rule with an additional response to the output gap such that: it  = r *  + π *  + βπ (πt   — π *)+βy (yt   — yt(*)) (a)   Derive the IS-MPR curve with the Taylor rule, showing how βy modifies the relationship between inflation and output. (b)   Solve for inflation and output when inflation expectations rise. Discuss how the central bank's response coefficients βπ  and βy   interact to influence the outcomes. (c)   Evaluate the conditions under which the central bank can stabilize both inflation and output effectively. Discuss trade-offs that arise when βπ and βy are too low or too high. 3.   Analyze the implications of adaptive inflation expectations in the IS-MPR-PC model, incorporating supply shocks. (a)   Derive the dynamic path of inflation and output over four periods  (t, t + 1, t + 2, t + 3) following a temporary positive supply shock and an aggregate demand shock. (b)   Discuss  the  conditions under which the economy exhibits counter-cyclical inflation-output loops. Analyze how these dynamics depend on βπ , α , and Y .  Provide both graphical and algebraic explanations. (c)   Compare the outcomes under adaptive expectations to a scenario where inflation expectations are anchored at π * . Discuss policy implications for central bank communication strategies and inflation targeting framework.

$25.00 View