Assignment Chef icon Assignment Chef

Browse assignments

Assignment catalog

33,401 assignments available

[SOLVED] ENGF0003 Ocean Acidification 24-25

Ocean Acidification ENGF0003 Coursework 24-25 Guidelines: • Type your coursework in Word or LaTeX. Follow UCL Accessibility Guidelines to format your document. Include a table of contents, page numbers, and use built-in styles (Heading 1, Heading 2) to structure your document. • All figures and tables must be numbered and contain informative captions. All the main equations throughout your work must be numbered and typed appropriately. • Submit a single PDF document. Do not write down your name, student number, or any information that might help identify you in any part of the coursework. Do not copy and paste the coursework brief into your submission – Rewrite information where necessary for the sake of your argument. This coursework counts towards 20% of your final ENGF0003 grade. Context The Great Barrier Reef (GBR) is a collective of over 2,900 individual reefs near the coast of Queensland in Australia. Selected as a World Heritage Site in 1981, the GBR is the largest structure composed of living organisms on the planet. The GBR is a fundamental component of ocean health, supporting a wide diversity of marine life. However, it is estimated that the Reef has lost half of its corals over the last three decades due to ocean acidification and temperature variations. What is Ocean Acidification? When the oceans absorb excess carbon dioxide, chemical reactions increase the abundance of hydrogen ions, lowering the pH of the water and making it less alkaline. It is estimated that the oceans have absorbed about 23% of all CO2 emitted by human activities. "For eons, the world's oceans have been sucking carbon dioxide out of the atmosphere and releasing it again in a steady inhale and exhale. The ocean takes up carbon dioxide through photosynthesis by plant-like organisms (phytoplankton), as well as by simple chemistry: carbon dioxide dissolves in water." (Holli Riebeek in an article for the NASA Earth Observatory, 2008) The ocean's ability to absorb carbon is decreasing. MIT scientists found in a 2017 study that the amount of carbon absorbed by the ocean has decreased by 1.5% due to human-caused CO2 emissions. • This decrease means an amount of CO2 equivalent to the UK's yearly emissions. • This excess carbon dioxide remains in surface waters and is not absorbed by the deep ocean. The issue here is a change in the planet's natural carbon cycle. An increase in the atmospheric temperature and concentration of carbon dioxide makes the ocean's surface supersaturated with CO2. The less alkaline surface ocean waters can absorb less atmospheric carbon, leading to additional atmospheric heating due to accumulated CO2. • Current estimates are that the oceans have the lowest mean pH of surface seawater in the last 800,000 years. • This change in the chemistry of ocean surface water affects the ability of corals to build skeletons and provide a habitat for marine life. • Without reefs, these ecosystems collapse, and marine life is endangered. • This has profound implications for marine biodiversity since 25 to 30% of all marine species depend on coral reefs at some point in their life cycle. How can mathematics help us analyse this problem? You will analyse a dataset sourced from the Australian National Mooring Network (ANMN). This dataset contains measurements of ocean surface temperature [°C], atmospheric pressure [kPa], and carbon dioxide content [ppm] for both air and seawater. This data has been collected daily from 24 March 2011 to 24 March 2021 at midday. The data collection site is shown in Figure 1. To learn how to analyse the data, it is important to complete Statistics Onramp and Common Data Analysis Techniques. These self-paced courses will teach you how to do basic statistical analysis of data in MATLAB. Figure 1. Site of data collection (23°27'29.9"S 151°55'35.8"E). 1. Visualise, Summarise & Communicate the Data 20 MARKS - 2 PAGE MAXIMUM Your task is to summarise, visualise, and describe the dataset attached to this brief and communicate the main patterns in the data in a concise, accurate and accessible way. 1.1. Produce one table summarising key metrics and statistics in the dataset. 1.2. Provide one short paragraph (300 words or less) justifying why you have chosen to summarise the data in the way you did in 1.1. 1.3. Explain the main trends and patterns you can take from this summary of the data. 2. Model and Evaluate Linear Behaviours in the Data 30 MARKS - 3 PAGE MAXIMUM Your task is to create mathematical models of the data. Calculate a linear regression of the temperature T [˚C], atmospheric y [ppm] and water x [ppm] concentrations of CO2 as a function of time t in days. 2.1. Explain what the coefficients of the linear regression mean and evaluate the quality of the regressions by calculating, contrasting and comparing the coefficient of determination R2 for each model. 2.2. Produce figures containing scatterplots of pressure, temperature, atmospheric, and water concentrations of CO2 with respect to time. Plot your linear regressions over the scatterplots. 2.3. Use your linear regression to forecast the concentration of CO2 in the atmosphere in 2030, 2050, and 2100. What do you think the concentration of CO2 in the atmosphere will be like? Discuss your confidence in your predictions, as well as factors that could make it inaccurate. 3. Model and Evaluate Seasonal Patterns in the Data 30 MARKS - 3 PAGE MAXIMUM Use the template code provided in this brief to model temperature T in ˚C as a function of time t in days. The template code calculates the parameters k1, k2, k3 and k4 that minimise the error between Equation 1 and the data provided. 3.1. Use your knowledge in trigonometric functions to explain what the parameters k1, k2, k3 and k4 mean, giving real-world or engineering examples and analogies. 3.2. Demonstrate that the formula for the root mean square (RMS) of a sinusoidal wave of amplitude A over one period τ in Equation 2 is: Then, estimate the amplitude of seasonal variations k1 for Eq. 1 through applying Eq. 2 to the data. 3.3. Use your knowledge or research in trigonometric functions and the provided data to make initial guesses for k2, kl3 and k4 and justify them. 3.4. Use your initial guesses in the code provided and describe the process of finding the best approximation possible. Contrast and compare the error of this approximation to the error of the linear regression approximation for T obtained in Task 2. Template code: Q3model = @(params, d) params(1) * sin(2 * pi * params(2) * d + params(3)) + params(4); %insert your initial guesses for initial parameters in this vector by replacing the '_' elements initial_parameters = [_ , _, _, _]; %insert your initial guesses for the lower bound of parameters in this vector lower_bounds = [ _, _, _, _]; %insert your initial guesses for the upper bound of parameters in this vector upper_bounds = [_ , _, _, _]; [fitParams, resnorm, residual, exitflag, output] = ... lsqcurvefit(Q3model, initialParams, d_, T, lower_bounds, upper_bounds); % Write code to access the 'fitParams' variable to find out the values fitted for each parameter % Calculate the fitted model T_fit = Q3model(fitParams, d_); % plot a comparison of the data and your results figure; plot(d, T, 'b.', 'MarkerSize', 12); hold on; plot(d, T_fit, 'r-', 'LineWidth', 2); xlabel('x label'); ylabel('y label'); title('Plot title'); legend('Legend entry 1', 'Legend entry 2'); grid on; 4. Reflection of learning 20 MARKS - 1 PAGE MAXIMUM Write a conclusions section for your coursework. Write paragraphs or use bullet points summarising the main ideas and take-aways from each section in terms of: • What you have learned while doing each question. Contrast and compare your knowledge, skills and attitudes before your studies at UCL and after completing this Coursework. • What your results and analysis tell you about the concentration of CO2 in the GBR. Use an argument based on your mathematical knowledge and work to communicate succinctly how you arrived at your conclusions. • What are the implications of your results for the environment, society and the economy. Provide a reasoning of what is important to you in analysing sustainability problems. Make a statement about how engineering students should approach problems involving mathematics and sustainability.

$25.00 View

[SOLVED] CAES9920 Academic Communication for Business Economics Assessment 1 Academic EssayR

CAES9920 Academic Communication for Business & Economics Assessment 1: Academic Essay (40%) The academic essay aims to assess whether students are able to effectively demonstrate understanding of Environmental, Social and Governance (ESG) from a corporate perspective, control their use of sources and adopt an academic tone and style appropriate for writing tasks within a business and economics context at university. It allows students to demonstrate achievement in the following learning outcomes: • Evaluate, extract and synthesize relevant information from business and economics sources for use in academic and professiona l writing • Demonstrate an understanding of the appropriate structure and features of academic and business writing • Select and acknowledge information sources in writing accurately using appropriate referencing and citation Assessment question Is Environmental, Social and Governance (ESG) beneficial to a company’s performance? What approach should companies therefore take towards ESG? Illustrate your answer with reference to at least two companies within one particular industry. Word count: 1200 words (minimum: 1100 words; maximum: 1270 words) (not including the reference list)

$25.00 View

[SOLVED] Homework 1 - Review sheet on Simple Keynesian

Homework 1 - Review sheet on Simple Keynesian –  via NYU Classes Assignment tab You may handwrite if you wish but please try to make it legible (1) Explain the following 3 ways of writing the condition for equilibrium income (i) Y = E; (ii) I = S; (iii) Ip = Ir  where Ip = planned investment and Ir = realized investment. In which component of investment is a discrepancy between the two likely to occur? (2) Suppose that initially equilibrium income was 200 units (Y=200) and that this was also full employment the full-employment level of income.  Assume that the consumption function is C = 25 + 0.8(Y-T) From this initial equilibrium level, assume investment decline by 8 units. i. What will be the new equilibrium level of income? ii. What increase in government spending would be required to restore income to the initial level of 200 units? iii. Alternately, what reduction in tax collections would be sufficient to restore an income level of 200? (3) Explain carefully why the tax multiplier [dy/dT = -b/(1-b)] is negative and why it is smaller in absolute value than the government expenditure multiplier [dy/dG = 1/(1-b)] (4) Given: C = a + b(Y – T); I = I G = G Supposed that instead of a fixed level of taxes (lump-sum taxes), taxes depend on income as follows (tax is endogenous): T = tY where 0

$25.00 View

[SOLVED] Art History 196/296 Art Law and Ethics

Art History 196/296: Art, Law, and Ethics Course content and goals: This course addresses a broad range of ethical and legal issues pertaining to art, ownership, looting and theft, museum policies, and cultural heritage. Beginning with a review of the key international and nation laws, this course will then explore a series of case-studies related to the collection, trade, and display of art, from Greek and Roman antiquities to Indigenous material cultural, from paintings looted in wartime to photographs of troubling or disturbing subjects. We will also explore the broader ideologies connected with the acquisition and display of cultural heritage, such as nationalism and the universal museum, as well as the role of modern museums and our ethical responsibilities as art historians. Learning outcomes: after completing this course, students should: 1.   Understand the key legal frameworks that govern the collection of objects of cultural heritage as well as their limitations 2.   Demonstrate an awareness of ethical considerations in the collection and display of cultural heritage as well as related theoretical issues such as the role of museums in society, colonialism, and nationalism 3.   Communicate the outcomes of independent research in both oral and written presentations and gain skills in leading seminar discussions. Prerequisites: none Required materials: all readings will be posted to Canvas Communication expectations: I aim to respond to all emails within one working day (M-F, 9am-5pm). Please let me know about any issues that may impact your ability to participate in this course as soon as possible. Weekly course outline: Week 1 (January 7): Introduction and legal frameworks What are the major international laws that concern the trade of cultural property? How does this differ from national laws? What are the limitations of these laws? How is cultural property defined and who defines these terms? Read before class: Fitz Gibbon, K. 2005. “Chronology of cultural Property Legislation” in K. Fitz Gibbon (ed.) Who Owns the Past? Cultural Policy, Cultural Property, and the Law. Rutgers University Press, pp. 3-9. To be discussed in class: Hague Convention for the Protection of Cultural Property in the Event of Armed Conflict, 1954 UNESCO “Convention Concerning the Protection of the World Cultural and Natural Heritage, 1970 UNIDROIT Convention on Stolen or Illegally Exported Cultural Objects, 1995 Week 2 (January 14): Art, archaeology, and the nation What is the relationship between ancient artefacts and modern nations? How have antiquities been used for modern political agendas? How are links between ancient and modern peoples legitimized in the context of the ownership of cultural property? Case study: Parthenon marbles Fitz Gibbon, K. 2005. “The Elgin Marbles: a summary ” in K. Fitz Gibbon (ed.) Who Owns the Past? Cultural Policy, Cultural Property, and the Law. Rutgers University Press, pp. 109-121. Merryman, J. H. 1985. “Thinking about the Elgin Marbles,” Michigan Law Review 83(8), pp. 1880- 1923. Melina Mercouri’s speech at the World Conference on Cultural Policies organized by UNESCO in   Mexico City (1982): https://melinamercourifoundation.com/en/unesco-in-mexico-july-29- 1982/ Hamilakis, Y. 2007. “Recollecting the fragments of national memory” and “Purifying the landscape,  producing the heterotopia of Hellenism” in The Nation and Its Ruins: Antiquity, Archaeology, and National Imagination in Greece. Oxford: Oxford University Press, pp. 78-99. Cuno, J. 2010. “Identity Matters” in Who Owns Antiquity? Museums and the Battle over Our Ancient Heritage. Princeton, pp. 121-145. Additional reading for 296 students: Hamilakis, Y. and R. Greenberg. 2022. Archaeology, Nation, and Race: Confronting the Past, Decolonizing the Future in Greece and Israel. Cambridge  University Press. Week 3 (January 21): Museums and their colonial legacies How are museums entangled with colonialism and what ideologies lie behind “anthropological” collections? Where, when, how, and from whom was cultural heritage collected in the past? What are the current approaches to restitution of this cultural heritage and have they been successful?  Does the idea of the “universal museum” still have value today? Case study: the Benin bronzes British Museum, Contested Objects: the Benin Bronzes: https://www.britishmuseum.org/about- us/british-museum-story/contested-objects-collection/benin-bronzes Cuno, J. 2011. “The Enlightenment Museum” in Museums Matter: in Praise of the Encyclopedic Museum, University of Chicago Press, pp. 11-33. Appiah, K. A. 2006. “Whose Culture is It?” New York Review of Books 53, February 9. Van Beurden, J. 2022. “Benin Dialogue Group: a Model for a European Approach?” in Inconvenient Heritage, 161-176. Additional reading for 296 students: Coombes, A. 1994. Reinventing Africa: Museums, Material  Culture, and Popular Imagination in Late Victorian and Edwardian England, Yale University Press. OR Mitter, P. 2013. Much maligned monsters: a history of European reactions to Indian art. Oxford University Press. Week 4 (January 28): Antiquities, provenance, and looting How are antiquities acquired for museum collections? How does the trade in antiquities relate to looting at archaeological sites? What are some of the challenges facing museums who seek to collect antiquities legally and ethically? Case study: the Getty Villa Guest speaker: Judith Barr (Curatorial Assistant, Getty Villa) will speak to us about her work   doing provenance research on objects in the Villa’s collections. One of your assignments for this week is to come prepared with questions for our visitor. Watson, P. and C. Todeschini. 2006. “The Getty – the ‘Museum of the Tombaroli’” in The Medici Conspiracy: the Illicit Journey of Looted Antiquities from Italy’s Tombs Raiders to the World’s Greatest Museums, Public Affairs, pp. 80-99. Renfrew, C. 2000. Loot, Legitimacy and Ownership: The Ethical Crisis in Archaeology. Duckworth, pp. 15-51, 65-80. Saunders, D., J. Barr, and N. Budrovich. 2021. “The Antiquities Provenance Project at the J. Paul Getty Museum” in J.N. Hopkins, S.K. Costello and P.R. Davis (Eds) Object Biographies:   Collaborative Approaches to Ancient Mediterranean Art, Yale University Press, 207-219. Additional reading for 296 students: Cuno, J. 2011. Museums Matter: in Praise of the Encyclopedic Museum. University of Chicago Press. Week 5 (February 4): Indigenous cultural heritage in the United States How have museums in the United States collected Indigenous cultural heritage? What is the current legislation that applies to these collections? What are some of the challenges and limitations that    come with restitution efforts? Case study: Ancient One/Kennewick Man Native American Graves Protection and Repatriation Act of 1990 Watkins, J. 2004. “Becoming American or becoming Indian? NAGPRA, Kennewick and cultural affiliation,” Journal of Social Archaeology 4(1): pp. 60-80. Rassmusen, M. et al. 2015. “The Ancestry and Affiliations of Kennewick Man,” Nature 523: pp. 455– 458. Minthorn, A. 1996. “Ancient One / Kennewick Man: Human Remains Should Be Reburied,” Confederated Tribes of the Umatilla Indian Reservation. Lonetree, A. 2012. “Introduction” and “Exhibiting Native America at the National Museum of the American Indian: Collaborations and Missed Opportunities” in Decolonizing Museums: Representing Native America in National and Tribal Museums. University of North Carolina Press, pp. 1-28, 73-122. Additional reading for 296 students: McGhee, R. 2008. “Aboriginalism and the Problems of Indigenous Archaeology,” American Antiquity 73(4): 579-597. AND Colwell-Chanthaphonh, C., T. J. Ferguson, D. Lippert, R.H. McGuire, G.P. Nicholas, J.E. Watkins, and L.J. Zimmerman, “The Premise and Promise of Indigenous Archaeology,” American Antiquity 75(2): 228-238. Week 6 (February 11): Art, ownership, and war What happens when art is stolen or destroyed in a time of war? What are some of the laws in place to return art to its rightful owner? What are some of the challenges that come with these restitution activities? Case study: Gustav Klimt’s Portrait of Adele Bloch-Bauer Simpson, E. (ed.) 1997. The Spoils of War, World War II and Its Aftermath: The Loss, Reappearance, and Recovery of Cultural Property. New York. – Parts 1, 3, and 4 Thérèse O'Donnell,T. 2011. “The Restitution of Holocaust Looted Art and Transitional Justice: The  Perfect Storm or the Raft of the Medusa?” European Journal of International Law 22(1): 49- 80. Nicholas, L. 1995. The Rape of Europa. The Fate of Europe’s Treasures in the Third Reich and the Second World War. Vintage. (excerpts). N8795.3.E85 O’Connor, A.-M. 2015. The Lady in Gold: The Extraordinary Tale of Gustav Klimt’s Masterpiece, Portrait of Adele Bloch-Bauer. Vintage. (excerpts). Additional reading for 296 students: Miles, M.M. 2008. Art as Plunder. The Ancient Origins of Debate about Cultural Property. Cambridge. Week 7 (February 18): The ethics of photography What are the ethical implications of displaying photographs of human suffering?Are there the same concerns when displaying photography that is meant to influence public opinion? Where is   the line between reporting and sensationalism? Case study: find a photo in the news or from social media that is relevant to our discussion Butler, J. 2005. “Photography, War, Outrage.” Publications of the Modern Language Association of America 120, 822-827. Azoulay, A. 2012. The Civil Contract of Photography. Zone Books. Sontag, S. 2004. Regarding the Pain of Others. Picador. Additional reading for 296 students: Sliwinski, S. 2011. Human Rights in Camera. University of Chicago Press. Week 8 (February 25): Whose work do we display? Should museums and galleries display controversial art or works of art by controversial artists? Is  there a difference between art created in the past and art created today? Who should decide what we put on display? Case study: Dana Schutz, “Open Casket” at the Whitney Biennial, 2016 McCartney, N. 2023. “In light of #MeToo: reconsidering the art/artist relationship for better futures,” Visual Studies 38(3-4), 557-570. Frank, P. 2017. “In the #metoo Era, Do These Paintings Still Belong in a Museum?” Huffington Post, December 14. Brown, M. 2018. “Gallery removes naked nymphs painting to 'prompt conversation'” Guardian, January 31. https://ial.uk.com/art-censorship-social-media/ D’Souza,A. 2018. “Who Speaks Freely?: Art, Race, and Protest,” The Paris Review, https://www.theparisreview.org/blog/2018/05/22/who-speaks-freely-art-race-and-protest/ Kennedy, R. 2017. "White Artist’s Painting of Emmett Till at Whitney Biennial Draws Protests". The New York Times. https://www.nytimes.com/2017/03/21/arts/design/painting-of-emmett till- at-whitney-biennial-draws-protests.html. Greenberger, A. 2017. "The Painting Must Go’: Hannah Black Pens Open Letter to the Whitney About Controversial Biennial Work". ARTnews. https://www.artnews.com/artnews/ news/the- painting-must-go-hannah-black-pens-open-letter-to-the-whitney-about-controversial- biennial work-7992/ For 296 students: find a recent example of an artwork that has been removed from public display for discussion Week 9 (March 4): Presentations and discussion Week 10 (March 11): Presentations and discussion Finals week: Research paper due (no final exam) Assessment and grading (196 – undergraduate students) Reading responses: 35% Participation in class discussion: 10% Discussion leader: 10% Case study paper presentation: 10% Case study paper: 35% Reading responses: this is a discussion-based seminar; it is therefore essential that you attend all classes, complete the readings, submit your reading responses, and come to seminar prepared with questions to ask your classmates. Any missed classes beyond one will result in a reduced participation grade. To facilitate discussion, you will submit a reading response before each class. These should include (1) a short summary of the readings, (2) questions or observations on these  readings, and (3) questions for group discussion. These are not graded but should demonstrate your engagement with the text. Discussion leader: each student will lead part of the discussion for one class based on either the  assigned case study OR a case study of choice. At least five key questions or discussion prompts must be submitted in advance. Please email me by the end of week 2 with your preferred topics in order and I will do my best to match you with something you are interested in. Case study paper presentation: includes (1) a ten-minute presentation outlining the case study  that you have chosen followed by (2) a question that your case study raises for a group discussion Case study research paper: final papers should be around 2,500 words. Each paper should (1) consider one specific case study (as presented in class), (2) discuss how the various legal and ethical concerns covered by the course apply, and (3) what questions may still be left open. Workload: approximately 12 hours/week: 3 hours in class, 4 hours reading and reading response (weekly); 1 hour discussion leader, 1 hour presentation, 3 hours case study paper (averaged over the quarter) Assessment and grading (296 – graduate students) Book reviews: 35% Participation in class discussion: 10% Book presentation: 10% Research paper presentation: 10% Research paper: 35% Reading responses and book reviews: the additional book readings assigned to graduate students are meant to provide broader theoretical perspectives on each topic. In addition to completing the readings assigned to the 196 students, you are required to submit a short book review (max 1000 words) on the book (or articles) of the week (in weeks 2-7). Book presentation: each 296 student will give a short (5 minute) presentation on their book reading for the 196 students during class. Research paper presentation: a ten-minute presentation outlining your research paper and time for questions Research paper: final papers should be around 3,500 words. The paper should apply one or more of the major theoretical topics discussed in this course to your own area of research. You may focus on one specific object, a museum, or collection of objects, but should focus on broader questions surrounding the acquisition and display of cultural heritage in your field rather than the describing an individual case study. Workload: approximately 12 hours/week: 3 hours in class, 4 hours reading and reading response (weekly); 1 hour book presentation, 1 hour research paper presentation, 3 hours research paper   (averaged over the quarter)

$25.00 View

[SOLVED] AG930 Advanced Theories in FinanceMatlab

Advanced Theories in Finance AG930 Course Pack Reading A useful textbook is by Wayne Ferson, 2019, Empirical asset pricing: Models and methods, MIT Press. Cliff Asness at AQR provides a blog discussion that covers issues in linear factor models.   Hall, A.R., 2005, Generalized method of moments, Oxford University Press. Hansen, B.E., 2021, Probability and statistics for economists, and Econometrics, Princeton University Press. https://www.ssc.wisc.edu/~bhansen/ Nagel, S., 2021, Machine learning in asset pricing, Princeton University Press.  Review Papers Fama, E.F., 2015, Cross-section versus time-series tests of asset pricing models, Working Paper, University of Chicago. Available at ssrn.com. Good introduction to testing linear factor models. Individual Papers Fama, E.F. and K.R. French, 2012, Size, value and momentum in international stock returns, Journal of Financial Economics, 105, 457-472. Fama, E.F. and K.R. French, 2015, A five-factor asset pricing model, Journal of Financial Economics, 116, 1-22. Fama, E.F. and K.R. French, 2016, Dissecting anomalies with a five-factor model, Review of Financial Studies, 29, 69-103. Fama, E.F. and K.R. French, 2018, Choosing factors, Journal of Financial Economics, 128, 234-252. All of the FF papers are available at ssrn.com. Kan, R. and G. Zhou, 2017, Modeling non-normality using multivariate t: Implications for asset pricing, China Finance Review International, 7, 2-32. Available of Raymond Kan’s web site. http://www-2.rotman.utoronto.ca/~kan/research.htm MacKinlay, A.C. and M.P. Richardson, 1991, Using generalized method of moments to test mean-variance efficiency, Journal of Finance, 46, 511-527. Available of JSTOR. Chou, P. and G. Zhou, 2006, Using bootstrap to test portfolio efficiency, Annals of Economics and Finance, 7, 217-249. Available at: http://apps.olin.wustl.edu/faculty/zhou/zpublications.html Barillas, F. and J. Shanken, 2018, Comparing asset pricing models, Journal of Finance, 73, 715-754. Available at: https://onlinelibrary.wiley.com/doi/pdf/10.1111/jofi.12607 Assessment  The assessment for this class is 100% coursework. The coursework is the completion of the problem set questions.  The coursework will be submitted online by Thurs 27th March. The aim of the problem set is to develop the following skills: Undertaking empirical research Evaluating and interpreting evidence The written part of the report should be a maximum of 6 pages (Times New Roman font size 12, double spaced) but can be shorter.  After the report should go all the tables and graphs.  All of the answers to calculations must go either in Tables or graphs.  Put each graph and table on a separate page.  The tables and graphs should be presented in a similar fashion to research papers i.e. have a number, a title, and short explanation of what is in the table.  The references go at the end of the report.  The references should be double spaced and presented in the same way as a research paper. When doing the problem sets, the material will be assessed on how well the questions have been addressed as well as the overall presentation.  Answer the questions specifically.  Do not include literature reviews or extensive discussion of research methods or Matlab code unless the question asks you for that.   Feedback will be provided through the use of an evaluation form. on how well these criteria have been met. You are welcome to come and see me if you want further feedback of your assessment. You are going to evaluate the performance of the Fama and French(2015) 5-factor model (FF5), and the alternative five-factor model of Hou, Mo, Xue and Zhang(2020) (HMXZ). You are to select one group of U.S. test assets (either the 25 or 32 portfolios) from Ken French’s Data Library but not the size/BM portfolios Problem Set Questions  Include a discussion of your results with respect to each question below. 1. Calculate summary statistics of the test assets and the factors in both the FF5 and HMXZ models. 2. Run the time-series regressions of the excess returns of the test assets on both factor models and report the results.    3. Use the Gibbons et al(1989) test to examine the mean-variance efficiency of both factor models. 4. Repeat the mean-variance efficiency tests using the Kan and Zhou(2017) approach, the GMM tests, and using the bootstrapping approach of Chou and Zhou(2006). How sensitive are the results to the choice of empirical method?

$25.00 View

[SOLVED] ICS 32 Project 2 Connect 4

Project 2: Connect 4 Due date and time: Wed, 2/19/25, 11:59 pm  Checkpoint: Wed, 2/12/24, 11:59 am iGPT AI Assistant: https://nextjs-chat-mu-olive.vercel.app/ Available for all students M-F before 8am & after 5pm, all day Sat/Sun Overview For this project, you will implement three versions of a Python console-based Connect Four game: 1. 2-player mode  2. 1 player vs. AI  3. 1 player vs. internet AI Project Goals 1. Implement each mode separately in its own Python file. 2. Reuse as much code as possible across the different versions. 3. Do not modify the provided connect4.py game logic. Game Details ● Traditional Connect Four Rules ○ Connect Four is a 2 player game where one is red and the other is yellow. ○ Players take turns to drop or pop a disc of their color. ○ Connect 4 discs of your color horizontally, vertically, or diagonally to win. ○ If you're not familiar with the rules of the game, you can review the rules on Wikipedia's Connect Four page. ● Variation ○ Implement both traditional rules and the "Pop Out" variation. ○ At each turn, you can pop out (remove) a disc of your color from the bottom row of the board instead of dropping another disc in.   ● Flexible Board Sizes ○ Support board sizes from 4x4 to 20x20. ● Red Moves First: ○ Red player always moves first. Getting Started ● From the project 2 folder, download the project2_starter.zip file containing  starter files shown below. Unzip the file and place all starter files into the same working directory.     ● A client_short.py file will be provided after lab 7’s due date. ○ This file is only required for the part 3 of this project. ● Read the provided code to understand how the game logic works Program 1: Local 2-player Game Functionality: ● Allow two players to play Connect Four using Python shell. ● To start, ask users to specify the board size before starting the game. ● At each turn, display the current state of the board and indicate whose turn it is. ● Clearly instruct users on how to specify the board size and make moves. ● Allow column selection using numbers (e.g., 1 for the far-left column). ● Validate moves and handle invalid inputs gracefully, providing error messages as needed. ● When the user is asked to specify a move but an invalid one is specified (such as dropping into a column that is full), an error message should be printed and the user should be asked again to specify a move. In general, erroneous input at the Python shell should not cause the program to crash; it should simply cause the user to be asked to specify his or her move again. ○ Ex: “Invalid Move” ● The game proceeds, one move at a time, until the game ends, at which point the program ends. Requirements: ● connect4.py, which contains the provided connect four game logic. ○ Note: You must not modify this module but build your game on top of it. ○ Recommendation: Read through the provided code, docstrings, and comments to understand how the game logic works. ○ Experimentation: Use the Python shell to experiment with the module and comprehend its functionalities. ● connect4_ui.py, which contains utility functions for the 2 player game. The  required functions are described below. You can create additional helper functions as appropriate: ○ make_new_game() ■ Asks the user for the number of rows and columns. ■ The number of rows and columns can be from 4 to 20. ■ Once the user provides valid rows and columns, create new game and return the connect4.Gamestate ○ print_board(state) ■ Returns a string holding the contents of a game board, given a GameState ■ The string should contain all lines of the appropriate display ■ An example board display is shown below ● Note the spacing difference when the column number requires 2 digits. ■ If it’s red’s turn, display “RED’s turn” after the board ■ If it’s yellow’s turn, display “YELLOW’s turn” after the board ■ If red wins, display “RED wins!” ■ If yellow wins, display “YELLOW wins!” ○ choose_move(state) ■ Asks the user to choose a move, returning a tuple whose first element is DROP or POP and whose second element is a valid column number. ■ Asks the user for a move, should only return a valid move ■ Keep asking user if wrong move type or column is detected ○ make_move(state, move) ■ Makes the given move against the given state, returning the new state. ■ For a valid move, return the new state. ■ Raise connect4.InvalidMoveError if invalid operation detected. ■ Implement exception handler to catch this exception. If connect4.InvalidMoveError exception is caught, return the original state. ● connect4_console.py, which implements the 2-player game. ○ All code should be implemented inside the provided run_console_ui() function. ○ Utilize functions defined in connect4 and connect4_ui modules. ○ If a move is illegal, such as dropping a disc into a full column or popping a column where the bottom disc is not the player’s color, the program should indicate “Invalid Move” and ask the same player for another move. This applies to both players. Here is an example of a game with 20 columns and 5 rows: Here is an example of how Pop works: Program 2: 1 Player game against AI Functionality: ● Allow a human player (red) to play against an AI player (yellow). ● AI is always the 2nd player in yellow. ● Maintain the same user interaction and board display rules as in Program 1. ● Implement a simple AI based on random selection. ● Extra credit: implement a more sophisticated AI for the Connect 4 AI Tournament. More details provided later in the document. Requirements: ● connect4_ui_ai.py, which implements the ai player functionality. ○ ai_move(state) ■ Takes connect4.GameState as input ■ Asks the AI to choose a move, and the AI will return a tuple with the following format (move, column number). ■ The move is either DROP or POP, which are constants defined as 1 for DROP and 2 for POP ■ The column number should be from 1 to the number of columns for the board. ■ For full credit, you can simply implement the AI with random numbers. ● For extra credit, you can implement a more complex AI for the ICS 32 Connect 4 AI Tournament. More details are presented at the end of this doc. ■ Note: the AI only needs to return a tuple consisting of a valid move and a column within the valid range of columns. The entire move may still be invalid due to certain circumstances. We will address this issue inside of connect4_console_ai.py. ■ Hint: helper functions would be useful here. ● connect4_console_ai.py, which implements the 1 player game against AI ○ All of the code needs to reside inside the run_console_ui() function. ○ Utilize functions defined in connect4, connect4_ui, and connect4_ui_ai.py modules. ○ If a move is illegal, such as dropping a disc into a full column or popping a column where the bottom disc is not the player’s color, the program should indicate “Invalid Move” and ask the same player for another move. This applies to both the human and AI players. Program 3: Networked Connect 4 vs Server AI Functionality: ● Play Connect Four against an AI server over the network, by connecting to a server that I will provide. ● Your program will act as a client that connects to a server. ● When this program starts, the user will need to specify the host (either an IP address, such as 192.168.1.101, or a hostname, such as www.ics.uci.edu) where a Connect Four server is running, along with the port on which that server is listening. ● Once the user has specified where to connect, the program should attempt to connect to the server. If the connection is unsuccessful, print an error message specifying why and end the program. If, on the other hand, the connection is successful, the game should proceed, with the client acting as the red player (and moving first) and the server AI acting as the yellow player. (Of course, the user will need to specify the size of the board before the game starts.) For red player moves, the user should specify the move at the Python shell, as in your first program; for yellow player moves, the program should instead communicate with the server and let the server determine what move should be made. ● As in the first program, the game proceeds, one move at a time, until the game ends, at which point the program ends. ● User Inputs: ○ Host (IP address or hostname) where the server is running. ○ Port number of the server. ● Connection Handling: ○ Attempt to connect to the server. ○ If the connection fails, print an error message and end the program. If successful, proceed with the game. ● Game Interaction: ○ The red player (user) specifies moves, while the server determines yellow player moves. ○ Follow the same move validation and error handling practices as in Program 1. ● Protocol ○ Need to follow the CFSP protocol to be described later in this document. Requirements: ● client_short.py, which implements the networking functions via sockets. ○ You should have implemented this during the lab. ○ We are providing fully functional networking code for you to utilize. ○ Do not change the code in this file. ● connect4_network_client.py, which implements the game vs the internet AI. ○ All of your  code needs to reside inside the run_console_network() function. ○ Utilize functions defined in connect4, connect4_ui, connect4_ui_ai.py, and client_short modules.

$25.00 View

[SOLVED] MECH215 Dynamic SystemsMatlab

SCHOOL OF ENGINEERING Year 2 Laboratories VI- Vibration MECH215: Dynamic Systems Notation Symbol Meaning Units m Suspended mass kg x(t) Deflection of the mass m y(t) End deflection of the spring m k Spring stiffness N/m c Damping coefficient Ns/m w Frequency rad/s wd Frequency of free-damped oscillation rad/s wn Natural frequency rad/s ξ Damping ratio - 1 Introduction The dynamical response of systems to various disturbances forms a major field of study in engineering. For example, the behaviour of suspension units, loudspeaker cones and more generally, structures, hydraulic systems and many others can be predicted using a system modelling approach. This approach will be used in the experiment to study the behaviour of a second-order mechanical system, and essentially the general procedure for all such problems is to: •     Build a mathematical model of the system •     Predict the behaviour of the system using this model •    Compare the predicted with the real behaviour and draw any relevant conclusions This exercise is related to the MECH215/ENGG301 notes on Free Vibrations and Forced Harmonic Vibrations. 1.1 Aims and Objectives The aims of this lab is to illustrate the concepts or free and forced vibrations through a real dynamic system and the objectives of this virtual lab are: •    To  understand the difference  between free  response  and harmonic forced response for an oscillating system. •    To understand the effects of different levels of damping on an oscillating. •    To understand how to use experimental results to identify the parameters of a dynamical system. 2 Background 2.1 The System Model Figure 1 Model of the oscillator The system consists of a mass-spring damper arrangement as shown is Fig. 1: •    mis the suspended mass (kg) •     k is the spring stiffness (N/m) •    c is the damping coefficient (Ns/m) •    y(t) is the end deflection of the spring (m) •    x(t) is the deflection of the mass (m) To obtain the equation of motion of the system, the forces that are associated with the mass are sum together. Then applying the Newton’s Second Law of motion yieldseq. 1. (eq.1) Equation 1 can then be compared to eq.2 below, which is the standard form of a second order dynamical system and which can be found in the lectures' slides. By comparing the coefficients from eq.1 and eq.2, the values for the damping ratio ξ, natural frequency ωn  and the input u(t) (which is equal toy(t) is this particular case) can be determined. (eq.2) 2.2 Predicted Responses The  response  x(t)  of  the  system  will  depend  on  the  input  y(t)  and  the  initial  conditions.  In addition,  x(t)  will  depend  on  ξ  and  ωn.  However  in  the  experiment  only  ξ  will  vary.  We  will examine two types of response: the free response (when y(t)=0, i.e. no input) and the sinusoidal forced response (when y(t) is a sinusoid). 2.2.1 Predicted Free Response The initial conditions and the input of the second order free response system are given as (there is only an initial displacement, the initial speed is zero): Applying these conditions to eq.2, giveseq.3 in the classical form. (eq.3) If ξ < 1 (underdamped case), then the standard solution can be written in the form. of eq. 4. (eq.4) Where the damped frequency can be calculated as (eq.5) where A(t) is the amplitude and is the phase shift, defined as Note:     If ξ > 0, then the frequency of the free response is not the natural frequency ωn   but the damped frequency ωd.  A sketch of x(t), which is modelled by eq.4, can be seen in fig.2. Figure 2: Time domain plot of response indicating the damped frequency and the amplitude decay The decay of the oscillatory response is often characterised by its logarithmic decrement defined in eq. 6: (eq.6) where Ai  is the amplitude of the ith  peak at any time axis and Ai+1  is the amplitude for the (i+1)th peak. Notice that the logarithm decrement is independent of the initial condition x0. 2.2.2 Predicted Sinusoidal Response The initial conditions and input of the second-order forced response system are now given as: Here ω0 is the input frequency and Y is the input amplitude of the imposed displacement. In this case the steady-state response can be written as shown by eq.7. (eq.7) The  forced  (steady-state)  response  is  another  sinusoid  of  the  same  frequency  as  y(t),  but  of amplitude Yβ(ω0) and a phase shift of ϕH (ω0) rad/s. A sketch of the response can be seen in fig.3. Figure 3: Phase and amplitude for a forced vibration system From eq.7, the amplification factor β and the phase shift ϕH  can be calculated using eq. 8 and eq.9. (eq.8) (eq.9) The phase shift is simply the lag of the response behind the input, multiplied by the input frequency. Sketching the values of the amplification factor and the phase against ω0 for different values of ξ yields a family of curves, fig.4. Figure 4: Amplification factor and phase shift example plots for a forced vibration system The negative angle indicates phase lag. The maximum amplitude is reached for ω0  = ωr  , where is the resonance frequency. The maximum amplitude is then given by the formula (eq.10) Concerning the phase plots, we have the property (eq.11) independently of the value of the damping ratio. For systems where a peak in the amplitude curve exists, the ‘strength’ of the peak is measured by the bandwidth, defined as the frequency range over which, eq.12: (eq.12) A sketch to illustrate the bandwidth is shown by fig.5: Figure 5: Definition of bandwidth It can be shown that for small values of ξ, (eq.12) 3 Health and Safety There are no significant hazards in this experiment. Students are reminded that they are required by law to comply with the Department’s basic rules of lab safety given to them at the start of the semester. 4 Experimental Procedure The necessary data for the experiments are: mass of each disc = 1kg; mass of frame + damper piston = 2.1kg. Thus the total mass is 4.1 kg. All tables require a title and all recordings require units This is a virtual lab. The response of the oscillator is then simulated and animated using a Matlab program. Friction forces and measurements errors are taken into account in this program. They are generated randomly based on the student number. As a consequence, each student will work with unique experimental measurements. 4.1 D1: Free Response Use the Matlab program “ Lab_VI_virtual_simulation.m” to simulate the oscillator. i. Undamped case: In the Matlab program, choose the option ‘no damping’ case, choose an initial position of the mass and a simulation duration. Repeat the procedure 5 times with the same configuration (but changing the run number). From the recorded results, find the period Tn  and determine the natural frequency ωn. Assume here that ξ is negligible. Determine also the stiffness of the spring. ii. Damped case: Now choose the low of damping, repeat 5 runs and for each run, report the amplitude value for the two first peaks. 4.2 D2: Sinusoidal Response The  amplification  factor  β(ω0)  is  equal  to  the  ratio  of  the  response  amplitude  to  the  input amplitude. i.    With the  damper  at  its  low  level  of  damping,  determine  the  amplification  factor  and phase for increasing frequency and use this data to construct amplification and phase curves. Use frequency values of 0.4 – 4 Hz and take at least 10 recordings. ii.   Now  for  the critically  damped  case,  i.e.  so that there  is just no  overshoot  in  the free response, repeat the procedure for measuring amplification and phase and plot the new curves on your original graph. iii.  Now for the intermediate value of damping between, repeat the procedure for measuring amplification and phase, and again plot the new curves on your original graph. 5 Tables Table 1: Free response for natural frequency Run Number T1 (s) T2 (s) Tn (s) ωn (rad/s) k (N/m) Average ωn and k Table 2: Free response for lowest damping ratio Run Number A0 (mm) A1 (mm) A0/A1 Average A0/A1 *Zero calibration must be done in this step Table 3: Sinusoidal response of the lowest damping ratio Run Number Input Frequency ω0 (Hz) Input Frequency ω0 (rad/s) Amplification, β(ω0) Phase (rad), ϕH(ω0) Table 4: Sinusoidal response of critical damping ratio ξ=1 Run Number Input Frequency ω0 (Hz) Input Frequency ω0 (rad/s) Amplification, β(ω0) Phase (rad), ϕH(ω0) Table 5: Sinusoidal response of intermediate damping ratio Run Number Input Frequency ω0 (Hz) Input Frequency ω0 (rad/s) Amplification, β(ω0) Phase (rad), ϕH(ω0) 6 Technical Note Submission 6.1 Assessment Criteria • Technical Writing 5% Correct spelling, grammar, formatting and concise. • Introduction 10% Roughly 500 words. This should include a brief context/why this lab is important, what you did, how you did it and a brief summary of the results. • Results, calculations and graphs 60 % PartI: Free Response 1.    Show the two tables of results for the free response ( i.e. table 1 and 2) 2.    Calculate the average natural frequency (ωn), the average stiffness (k) and for the low damping case, the average amplitude ratio (A0/A1). 3.    Calculate the low damping ratio () using the logarithmic decrement formula. Part II: Forced Response 1.    Show the three tables of results for the forced response (i.e. table 3, 4 and 5) 2.    Plot graphs for amplification factor vs input frequency (amplification factor plot) and phase shift vs input frequency (phase plot) considering the three levels of damping. (Refer figure 4) 3.    Estimate the natural frequency using the phase plot for the low value of damping. (This is where the phase = -π/2 rad/s) 4.    Compare the natural frequency obtained from II-3 and I-2. 5.    Estimate the damping ratio via the amplification factor plot for the low value of damping using: a.    The value of the maximum amplitude. b.   The value of the resonance frequency. c.    The bandwidth approximation. 6.    Calculate the average of the damping ratio for the low value of damping i.e. 5a, 5b, 5cand I-3. 7.    Estimate the damping ratio via the amplification plot for the intermediate value of damping using: a.    The value of the maximum amplitude. b.   The value of the resonance frequency. c.    The bandwidth approximation. 8.    Calculate the average of the damping ratio for the intermediate value of damping i.e. 7a, 7band 7c. • Discussion 20% Draw meaning from each plot. Match results to theory. Did what happen match what should have happened? Comment upon the shapes of your amplitude and phase curves. Give an example of a real mechanical system that can be represented by a similar oscillating system, as has been seen in the lab exercise. • Conclusion 5% Draw numerical conclusions from each plot. Summarise findings of numerical experiments 6.2 Submission Instructions Download the Technical Note Template for the Lab VI available on Canvas. Rename the document to include your  name  before submitting  it – for example “VI Technical Note John Smith.docx” . Complete the technical note and upload it on Canvas with the  link available in the Virtual  Lab section.

$25.00 View

[SOLVED] Power Engineering Electromagnetics EEE350 20242025SPSS

Power Engineering Electromagnetics ‐ EEE350   (2024‐2025) EEE350 – Sem1 ‐ Assignment Introduction ‐     This assignment depends on Sem 1 material. ‐ The assessment will be based on FEMM4.2 software ‐    The assignment might contain elements that have not been covered in the lectures.   ‐ You should provide all workings and explanations in your solutions. Also, justify your design selection, if any. These will variously count towards achieving full marks in this assessment. Submission Details You can complete your answers as a word‐processed document or as handwritten sheets (The word document is preferred). Please save or scan these respectively into a pdf file. Copy any graphs into a word document, then save them into a pdf file. Also, copy any figures or graphs from FEMM4.2 into a word document. As this submission is considered a formal report, The first‐page template is added to the same folder. Convert the first page into pdf format and merge your documents into one pdf file. This assignment has two questions. Question 1 is an electrostatic problem,  while question 2 is an electromagnetic problem. It is recommended to add a summary page for your answer. Upload and submit your work as one pdf file via MOLE (BlackBoard) under the content area' Sem1‐Assignment 2024‐2025'; Please do not zip your pdf. The deadline for submission is 23:59 on Sunday, February 23rd 2025. Grades and feedback will be released after the Easter break. The report will be marked out of 100 Question 1 is out of 55 marks Question 2 is out of 35 marks Ten marks for organisation and presentation (5 marks for each question) This assignment is a MUST‐PASS ELEMENT. The minimum grade to pass is 40 %. Question 1 [60 marks] A single core lead sheathed cable with voltage (60+m)  kV shown  in figure 1 has a conductor radius of R = (15 + m/2) mm and two layers of insulating material with relative permittivity r1 and r2, respectively. The radii of layers 1 and 2 are r1 = (30 + m/2) mm and r2 = (35 + m/2) mm respectively. Choose the material of layer 1 as Polypropylene (you can modify the property to match your design). Choose the material of layer 2 as PVC (you can change the property to match your design). The conductor is copper (You can add a new property as a copper conductor and select a valid value for the permittivity of the copper conductor). Figure 1: Cross section of the underground cable Hints: Design requirements: •    Choose a planar solution •    Use length units in millimetres •    Depth 1000 mm. •    Add a boundary layer filled with air. •    Choose your mesh not higher than 0.5 mm to improve the solution's accuracy. In your report, a‐] Calculate the voltage for each layer                                    [5 marks] b‐] The maximum and minimum electric field for each layer. [5 marks] c‐] The capacitance of each layer and the total capacitance               [5 marks] d‐] Using FEMM4.2, Draw the cable including the contour line. Add a picture to your report. [ 5 marks] e‐] Show voltage distribution on the cable cross‐section, plot the voltage against the contour line, and then measure layers one and two voltages to confirm the analytical results of part [a]. [5 marks] f‐] Show the electric field distribution and electric field tensor on the cable cross‐section. Plot the electric field against the contour line, then measure the maximum and minimum values of the electric field to confirm the analytical results of part [b]. [5 marks] g‐] Measure using the FEMM4.02 software the total charge and calculate cable capacitance. Comment on the results with respect to part [c]. [5 marks] h‐] Repeat parts [d] to [g] for the Square cable shown in figure 2, but plot for both contour line 1 and contour line 2     [10 marks] i‐] comment between the results of the square cable and cyclindrical one             [10 marks] Figure 2: Cross section of the square cable Note: Five marks are allocated for report organisation/presentation. Question 2 [40 marks] Figure 2 shows a solenoid system. The coil has a resistance of 2     and the number of turns N =  (500+2*m) turns. the  air‐gap  length  has the  boundaries  (0  < x < 20 mm). The iron material is Mild‐steel M‐50. (Note: The figure is not drawn to scale) The problem conditions: ‐      Electromagnetic problem ‐     Choose a planar solution, ‐     Length units in millimetres, and ‐ Choose your mesh for not higher than 0.5 mm to improve the accuracy of the solution. ‐     Add boundary to your solution ‐     Consider nonmagnetic sleeve as air In your report: a‐] Calculate the coil inductance function of x (Where L and   ℜ   is the reluctance). ℜ              Calculate the value of the inductance atx = 0‐, 10‐, and 20 mm                  [10 marks] b‐] Calculate the coil current if the current density is (3.8+0.05m) A/mm2. The filling factor is 55 %.         [5 marks] c‐] Attach a schematic diagram using FEMM4.2 software with the required contour.                  [5 marks] d‐] For the solenoid system shown in figure 2, show the flux density and flux tensor for x = 0‐, 10‐, and 20 mm. Plot on the same graph the flux density against the contour line for x = 0‐, 10‐, and 20‐mm. Record the flux density value at the points P and Q for each x value (Note: atx = 0 mm, the point P and point Q are the same point). Comment on the results [15 marks] Note: Five marks are allocated for question organisation/presentation

$25.00 View

[SOLVED] 156757 Marketing Chinese manufactured products in a developed market

156.757 Marketing Chinese manufactured products in a developed market The information here is fictional and it is only for academic analysis purpose.   Please do not contact any firms in the case study. It is postulated as a result of a recent research output. This case is about marketing Chinese trucks in a developed market (New Zealand). China is New Zealand’s largest trading partner, with two-way goods and services trade at around NZ$40 billion (2022-2023). FT is a multinational truck manufacturer based in  China, a joint venture of Germany (e.g., Daimler truck), USA (e.g., Cummins) and China. FT is  a leading truck brand in China . Its products include light (6 to 8 tones) and heavy truck ( >  12 tones) . It is also one of many truck players in New Zealand. FT products have been marketed in New Zealand since 2016 by a company called ATA International Ltd (a fictional name). ATA is a mid-size New Zealand import and export company (employee is around 200). It started manufacturing and exporting electronic and electrical products in 1983. When ATA started to manufacture these products, it targeted the US, Japan, Europe, Taiwan and Hong Kong as their main export areas. At that time, these markets contributed more than 60% of the company's total sales revenue. The CEO and founder of the company decided to enter the importing and trading business about 20 years ago. The firm’s trading businesses include machinery and automobile products and parts. Within the truck sector, the company has been a sole distributor of a number of international brands such as LDV of UK, Mahindra  of India as well as FT from China. FT brandis just one of several brands in ATA's  importing businesses and it is the latest importing business. It is in the middle level of the New Zealand truck market. Truck industry is a big business in New Zealand. According to NZ Transport Agency, around 6,183 units of new trucks were sold in New Zealand in 2023. There are many multinational players in the market such as Isuzu, Hino (Toyota), Fuso (Mitsubishi), Mercedes Benz, Scania, Volvo and so on.  FT is positioned as a mid- price among the automobile brands in New Zealand. Because of FT's international reputation and reasonable price, ATA believes that FT would stand well against major European/USA/Japanese/Korean brands. ATA has been importing FT’s products since 2016. According to the contract, which is renewed every five years, ATA is the sole distributor of FT’s products in the New Zealand market. Despite many years’ of operation in New Zealand, FT has felt that its truck businesses can be lifted up here much more. To evaluate its current situation in the New Zealand market, FT has hired an independent marketing research consultant to uncover the issues their brand has been facing in New Zealand. A number of issues regarding marketing FT’s products in New Zealand have been identified by the New Zealand customers. .           Though FT is a leading truck brand in China, it is a totally new brand to the New Zealand customers. New Zealand customers are not familiar with this  new brand at all. Customers’ confidence needs to be established. .            People in New Zealand still view truck products made in China as less technology advanced than their European/Japan/Korean/US counterparts, despite China has been promoted as a world manufacturing centre. This country of origin effect has some negative effects on marketing Chinese manufactured goods such as the view of low cost and inferior quality manufacturing products in New Zealand. As a result, there are some perception problems about FT’s products in New Zealand . When ATA's sales forces go out to promote FT’s products, they encounter many difficulties in persuading discerning New Zealand customers to try this new brand. .        A lot of feedback from ATA's customers has not been adopted by FT in China. For instance, one comment from the market is that the product choice   of FT is not wide enough in New Zealand. Customers in New Zealand always look for a wide range of truck choices. However due to its production facility  issues, FT does not offer as many product choices as their competitors in New Zealand (e.g., Hino, Hyundai, Kia). Currently the firm has only offered three product ranges in New Zealand whereas the leading player of Hino has offered about 30 choices in its popular 300 series alone (Hino.co.nz). .         Customers in New Zealand are now looking for more environmentally friendly vehicles due to the change of shopping and consumption behaviour. Most customers are now looking for pure electrical and/or hybrid vehicles. FT is very new to this clean vehicle segment. Its reputation on offering clean vehicles is still a long way to go when comparing to other key electrical vehicle players such as Hyundai, Volvo and Toyota. Most of these firms have now offered electric and environmentally friendly trucks with 8-10 years warranty on their electrical truck battery while FT is yet to enter this new innovative product range. .    ATA is just one of the many car importers in New Zealand and it has only been in the car market for 20 years. Other importers have been in this business much longer than ATA. ATA’s distribution system does not appear   to be as sophisticated as other importers. Currently its distribution system is    only available in major Metropolitan cities such as Auckland, Wellington and Christchurch (three dealership currently). In comparison, FT’s competitors have a presence in most of the New Zealand cities, for example Hino has distributors in Invercargill, Nelson, Palmerston North, Napier, Rotorua, Bay  of Plenty, Hamilton and Whangarei, in addition the three major metropolitan centres. .         Though ATA has also started its online business, the online business is not going too well for the firm and much more work needs to be done here. For example, the web-site of ATA is also not updated frequently so customers do not know their latest product and distribution information. Unlike other firms, the firm does not use WhatsApp/Facebook/Wechat to communicate directly with its customers. This is another major drawback of the firm’s online business. Technology such as virtual reality (VR) is completely new to the firm and the firm has not utilized this type of technology in their strategic distribution management at all. This project is completed individually. FT has employed you, as a recent graduate of Massey University, to bring some expertise to their distribution management related  strategies in New Zealand. To help with this task they need to prepare a case report relating to FT’s operation in New Zealand. You may conduct additional research while preparing your case report. Your assignment should be in report format with a Title Page, followed Market Stratgies Analysis, Recommendations and Summary, and finally references. Your report cannot not exceed 1000 words (absolutely restricted page length; main context only, references, tables and appendices excluded). 1.   Environmental Scan.  Write a section outline of the most important environmental issue facing FT’s operation in New Zealand . This can be in terms of competitive, customers and so on (just the most important one). Maximum 250 words – 7 Marks 2.   Market Strategies Analysis. Prepare an analysis of current channel and technology strategies used to market FT’s products in New Zealand. This needs be in terms of: (a) distribution management strategies, and (b) technology strategies that are related to marketing of FT’s products in New Zealand. Maximum 500 words - 16 Marks 3.   Summary and Recommendation.   Sum up what you have learnt from the environmental scan (most important environmental issue) and marketing strategy analysis (distribution and technology) sections and make recommendations for future development of FT’s operation in New Zealand. Maximum 250 words – 7 Marks

$25.00 View

[SOLVED] ECEN 2703 Solving Sloop and Slitherlink with Z3Python

Solving Sloop and Slitherlink with Z3 September 13, 2024 Abstract This document describes the programming project for the Fall 2024 edition of ECEN 2703. 1 Introduction In our treatment of logic, we have learned how to solve knights-and-knaves puzzles. We have also seen how to apply logic to the Minesweeper problem. The Z3 tutorial that you read shows how to solve Sudoku puzzles by encoding the constraints that every row, column, and 3 × 3 box of the grid must contain the digits 1 through 9. For our programming project, we take on two pencil puzzles, in which the solver has to trace paths that satisfy given constraints on a rectangular grid. Example 1. In a Sloop (simple loop) puzzle, we are given a rectangular grid. Some cells contain a square as in the 6 × 6 grid below. We need to trace a simple loop (a loop that does not cross itself) that visits all the cells without a square in them. The loop must go through the center of each cell it visits and must move either horizontally or vertically. It must not touch itself, which is to say that it can cross a cell at most once. The solution to the puzzle above is shown below. (We say “the solution” because in well-designed puzzles the solution is unique.) The inside and outside of the loop are shaded differently to make the graphics easier to read. For an experienced solver, this is an easy puzzle, but if this is the first sloop puzzle you’ve ever come across, you may want to cover the solution and see if you can re-discover it. Later, we’ll talk about “tricks of the trade” that help humans to tackle sloop puzzles. In any event, even if a puzzle baffles you, it is straightforward to check that a purported solution is indeed correct. (You should try it on the solution above.) Showing that a solution is unique is more involved. More on this in Section 6. Example 2. Slitherlink puzzles share the basic setup of Sloop puzzles—a grid in which we need to draw a simple loop that does not touch itself—but have different rules. The loop must be formed by the edges of the cells. A clue in a cell is the number of edges of that cell that participate in the loop. Here is an example: The (unique) solution is shown below. As in Example 1, colors are used to improve readability. Again, it is not difficult to verify that the solution is correct. For instance, it’s easy to check that the loop uses k edges of each cell that contains k. Slitherlink has more complex rules than Sloop. We’ll start from the latter so that we can “learn the ropes.” Solving Sloop will teach us how to deal with connectedness constraints. This ability will make the task of solving Slitherlink easier. It will also help with variants of Sloop and Slitherlink, as well as with other puzzles that deal with loops like Masyu and Yajilin. These notes aim to be self-contained. If you want to know more, though, there’s plenty available in print and on the Web. Among the books, it’s worth citing Knuth [6, pp. 177-178], and Hearn and Demaine [3, p. 177]. 2 Tricks of the Trade While in principle one could write a solver for one of our puzzles without having ever tackled one puzzle, some familiarity with the manual solution process will definitely help. Hence, in this section, we look at some of the basic techniques on which human solvers rely. 2.1 Solving Sloop Puzzles There are two observations whose application helps us solve an example of Sloop puzzle like the one of Example 1. Figure 1: Stages in a solution of the Sloop puzzle of Example 1. • If an empty cell has only two neighbors through which the loop may go, then the loop goes through those neighbors. For example, an empty cell in a corner of the grid, and an empty cell along the border and next to a black square, have two neighbors each. Moreover, if the loop already goes in and out of a cell, that cell is no longer available as neighbor of another cell (to which it is not already connected). • When extending the path to eventually form. a loop, one must carefully avoid entering cul-de-sacs and prematurely closing the loop. A cul-de-sac is a region of the grid where the path, once entered, does not have enough maneuvering space to get out again. The simplest example is a cell with only one available neighbor left. A loop is closed prematurely when it does not visit all empty cells. These observations often help a solver to make progress in the solution. For example, Figure 1 shows how the Sloop puzzle of Example 1 may be solved. The rule about cells with two neighbors takes us from the initial grid to its right neighbor. Then, we observe that, if the path were extended from r2c1 (Row 2, Column 1) to the right, a small loop—one that does not visit all the empty cells—would result. Therefore, the path must continue downward from r2c1 to r3c1. This gives the rightmost grid in the top row of Figure 1. We now observe that r3c2 has only two available neighbors left: r2c2 and r3c3. The path is extended accordingly. Now, the same observation applies to r2c3. After we have extended the path from it to r3c3 and r2c4, we can apply the same trick to r4c3 to obtain the left grid in the bottom row of Figure 1. We now turn our attention to r3c4, which has two available neighbors left: r3c5 and r4c4. We let the path through r3c4 connect those neighbors. We Figure 2: Stages in the solution of the Slitherlink puzzle of Example 2. also notice that r5c5 still has three neighbors available. However, if we ran the path through it from r5c3 to r5c6, we would close a small loop. This means that the path must go through the third neighbor, connecting r5c5 to r4c5. This gives the center grid of the bottom row. There, we observe that we cannot extend the path from r3c5 to r3c6, lest we should close the loop pre-maturely. The two free ends of the path in Row 3 must be extended downward. The only available moves then complete the solution. Note how the systematic application of rules and observations derived from them eliminated the guesswork: we never had to say, “let’s extend the path this way and see what happens.” Many puzzle enthusiasts subscribe to the idea that a good puzzle is one that can be solved by an experienced human solver without any bifurcation. In Computer Science, we’d say, “without backtracking.” 2.2 Solving Slitherlink Puzzles The most commonly used tricks to solve Slitherlink puzzles include those that we saw for Sloop. That is, one checks for locations in the grid where the loop can only be extended in one way. Moreover, when extending the path, choices that would create multiple loops, loops that cross themselves, paths that cannot be closed to form. loops, or branching paths can be safely discarded. In addition to these criteria, Slitherlink has a number of “tricks” that look for patterns in the clues. Let’s see some common techniques at work in the solution of the Slitherlink puzzle of Example 2. There are too many tricks to see them all at work in one example, but we’ll get the idea. First, we mark all the edges surrounding cells with a 0 in them because they cannot be part of the loop. It is customary to use small ×’s to mark unavailable edges, so that it’s easy for human solvers to see where they know that the path may not go.2 If we systematically marked all the edges that are not on the loop with an ×, at the end of the process every edge would be either part of the loop or marked. We won’t do that. Instead, we’ll only mark an edge if we deem that a reminder of its unavailability will help us. Next, we observe that, if two adjacent cells both have 3 in them, then, in a large enough grid, the loop must take the edge that separates them and the two edges parallel to it, as in r2c1 and r2c2 of our example. This is an example of a pattern in the clues that a solver looks for. To see why we are justified in selecting those three edges, let’s start from the edge between the two cells. If it weren’t part of the loop, then the loop would have to use the remaining six edges to satisfy the constraints. That would produce the following situation: If there are other clues different from 0 in the grid (this is what we meant by “large enough grid”) this loop cannot be the solution. Having established that, in our example, we need the loop to pass between r2c1 and r2c2, we now consider the edge to the left of r2c1. If it were not part of the loop, we’d have the following situation: The ×’s are there because a corner of a cell cannot have more than two edges incident on it that are part of the loop. If if did, the path would either branch (with three edges) or touch/intersect itself (with four edges). The two ×’s tell us that we cannot select three edges around the three on the right unless we have the edge to the left of the three on the left. The argument for needing the edge to the right of r2c2 is essentially the same. With similar reasoning we could prove that a 3 that shares a corner with another 3 makes the loop use the two sides that don’t touch that corner. (What would happen if the loop used both edges of one cell with a 3 incident on the shared corner?) The observations we’ve made so far give the middle grid of the top row in Figure 2. Let’s now focus on the top-left corner of r1c5. It has three incident edges, two of which are known not to be on the loop. (They are marked.) If the path used the remaining edge (the one above r1c4) it would reach a dead end. Hence, the edge above r1c4 is marked with an ×. With similar argument we mark the edges above r1c6 and to its right. Let’s now turn our attention to r5c5. If the edge above it were in the loop, the edge to its left would give the only possible extension of the path from the left endpoint. However, this would put two edges around a cell with a 1 in it, violating the clue constraint. By similar argument, we conclude that the edge to the left of r5c5 is also to be marked. Next, we look at r3c3 and notice that if the loop used its right edge, it would also have to use its bottom edge to “get out.” Since the cell contains a 1, we conclude that its right edge not on the loop and we mark it. Likewise, the bottom edge of r3c3 is not on the loop and we mark it. When this is done, we notice that there are only two edges left to satisfy the constraint on r3c4; hence, we add those edges to the path. Now, however, the bottom-left corner of r2c5 has two incident edges on the loop: we can mark the other two with ×’s. This means that the only edge left to satisfy the clue in r2c5 is the one to its right. The path must extend from both ends of this edge without closing prematurely. When this is done, we have the rightmost grid in the top row of Figure 2. Moving on, we now look at the bottom-right corner of r3c4. The path must extend from there and the only possible direction is to the right, by including the edge below r3c5. From the bottom-right corner of r3c6, the path can only extend downward to the bottom-right corner of r4c6. From there, it cannot go left, because, then, it would have to go down, taking two sides of a cell with a 1 in it (r5c5). Therefore, the path takes the right edge of r5c6, and then goes down again because it has already used the one allowed edge around r5c6. From the bottom-right corner of the grid, the path can only go left, passing below r6c6. At this point, we notice that the edge between r5c5 and r5c6 is not on the loop. If it were, it would be impossible to extend the path from its upper end. This means that the edge around r5c5 that is on the loop is the one below it. The only way to connect it to the free end in the bottom-left corner of r6c6 is via the edge to the left of that cell. We now turn our attention to r4c3 and notice that there are only two edges left to satisfy its constraint. Hence, we add the edges to the left and below r4c3 to the path. The top-right corner of r5c2 now has two incident edges on the loop; hence, we mark the other two. The interesting question to ask, at this point, is which of the two available edges around r3c3 is to be on the loop. Either way, the path extends around the 3’s in r2c2 and r2c1 until it reaches the top left corner of r2c1. Suppose it were the top edge of r3c3 that is selected. Then, the path would be trapped in a dead end and could not connect to the free end below r5c5. Hence, the loop must include the left edge of r3c3. Since the top-left corner of r3c3 now has two incident edges on the loop, we mark the other two. This gives us the first grid of the bottom row in Figure 2. As we remarked in the last paragraph, the path must now extend to the top-left corner of r2c1. From there, it can only go up and then right until it reaches the top-left corner of r1c4. It cannot take the edge below r1c4 because that would lead to a dead end. (So, we mark that edge.) Therefore, from the top-left corner of r1c4, the path must turn down until it connects to the free end at the top-left corner of r3c4. We have reached the situation described in the middle grid of the bottom row in Figure 2. The path now has two free ends that must be connected. Clearly, from the top-left corner of r5c4, the path can only go down. If it then went down again or turned right, the loop would be closed prematurely: it would not include edges of either r5c2 or r6c2. Hence, the path must go left. At the top-right corner of r6c2 it must go left again for similar reason. From the top-left corner of r6c2 it has to turn back to join the other free end. It cannot do so right away, though, because it would then use three edges around a cell that holds a 2. Hence, the path reaches the left edge of the grid, turns around, and crosses below r6c2, continuing until the bottom-left corner of r6c5. The last step is to close the loop by taking the left edge of r6c5. It should be clear that this is one of the possible sequences of steps that may be taken to solve the puzzle. It does illustrate, though, the type of (often subtle) reasoning that Slitherlink puzzles often require of human solvers. Mechanical solvers, like Z3, may not know all the tricks, but—fortunately for us—have brute force to spare. 3 Forcing a Single Loop In Sloop and Slitherlink, we need to make sure that there is a single loop. In our solvers, we need to specify appropriate constraints for Z3. We adopt an approach based on [1, 2], whose main ideas we summarize here. Let’s look at the two loops below and suppose that we go around them in clockwise fashion, as shown by the arrows. (We’ll stick to clockwise travel throughout.) The loop on the left contains four turns, while the loop on the right contains eight turns. We identify these turns by the directions before and after the turn. Let’s focus on two types of turns: up-then-right (marked by orange circles) and right-then-up (marked by green squares). Let’s call these turns notable. In the loop on the left, there is one up-then-right turn and no right-then-up turns. In the loop on the right, there are two turns of the first type and one turn of the second. A few more examples will convince you that in every (clockwise) loop there is always one more up-then-right turn than there are right-then-up turns. So, the number of notable turns is always odd. Intuitively, the turns of the second type counter the attempt of the turns of the first type to close the loop. Since the loop closes, the turns of the first type must have the last word. It is also not difficult to see that one cannot take two up-then-right turns without an intervening right-then up turn. Hence, the difference between the numbers of notable turns of the two types is always 0 or 1 along the loop and is 1 at the end. This suggests that we can track this difference with just one bit. (More details and actual proofs of all these claims are found in [1, 2].) Let’s see how to convert this idea into constraints for Z3. We associate one Boolean variable to each cell of the grid. We then impose constraints saying that, if the loop turns up-then-right or right-then-up in that cell, the turn-tracking variable of this cell must have opposite value to that of its predecessor along the path. In the remaining 10 ways in which the loop goes through a cell, the turn-tracking variable must have the same value as the variable from the predecessor cell. The turn-tracking variables of the cells not on the loop will take arbitrary values and will be of no concern to us. The chain of constraints around a loop forces the turn tracking bit to change an odd number of times: If there are n > 0 up-then-right turns, there are n − 1 right-then-up turns, and 2n − 1 is always odd. If nothing is done about it, this means that the constraints are unsatisfiable! This apparent problem turns out to be the key to guarantee that there exactly one loop. The clever idea is to allow exactly one exception to the constraint in the whole grid. Then, one loop satisfies the constraints, but zero or more than one loops do not. In Sections 4 and 5 we’ll see how to incorporate this technique in our encoding of the Sloop and Slitherlink puzzles. 4 Modeling Sloop Puzzles We now discuss how to model a Sloop puzzle for Z3. With minor adaptations, what we say applies to other SAT and SMT solvers, but we’ll focus on our favorite tool. For an n×m grid, with cell (0, 0) in the top-left corner, we have (n+1)(m+1) cell corners—from (0, 0) to (n, m). We assume that corner (0, 0) is the top-left corner of cell (0, 0) and corner (n, m) is the bottom-right corner of cell (n − 1, m − 1). (See Figure 3.) The four corners of cell (i, j) are (i, j), (i, j + 1), (i + 1, j), and (i + 1, j + 1). We’ll keep this convention for Slitherlink too. Recall that the loop in Sloop puzzles goes through the centers of the empty cells. We associate one variable, fi,j to each cell corner and one variable, pi,j , Figure 3: Cell and corner indexing conventions for n = 3 and m = 4. to each cell of the grid. If fi,j is true, then corner (i, j) is inside the loop; otherwise, it is outside the loop. The value of pi,j is the parity around the loop that was discussed in Section 3. Let’s start with the constraints on the f variables. • The corners along the perimeter of the grid are all outside the loop. That is, the f variables around the border of the grid are all made “false” by the constraint (¬fi,j ). So, there are only (n − 1)(m − 1) corners whose variables Z3 can play with to find a solution. While it is possible to avoid creating variables for the corners along the grid’s border, doing so complicates writing the constraints. Hence, we’ll define variables for all (n + 1)(m + 1) corners and then fix the values for the 2(n + m) corners around the border. • The cells with black squares are either entirely inside the loop, or entirely outside the loop. Hence, the f variables for their four corners are either all true, or all false. • Every empty cell is traversed by the path. This means that at least one of its corners is inside the loop and at least one of its corners is outside. • Every empty cell is traversed by the path once. This forbids checkerboard patterns in the four corner variables. It is not possible for the north-west and southeast corners to be inside while the northeast and southwest corners are outside, or vice versa. If these constraints on the f variables are satisfied, but the constraints on the p variables are ignored, we get a weak solution. In a weak solution, all empty cells are on a loop, and all cells with squares are either entirely contained in some loop, or entirely outside every loop, but there may be multiple loops. To avoid multiple loops is the purpose of the p variables. Figure 4: Possible values of the p variables for the puzzle of Example 1. The exception to the parity constraint occurs at cell (0, 0), where the value of the p variable does not change, even though the loop takes an up-then-right turn. As we said, we associate to each cell a Boolean variable pi,j , which switches value whenever the loop takes an up-then-right or right-then up turn. We do not insist on the particular values of the p variables: only on their relations to the neighboring variables if they are on the loop. In particular, if the values of all the p variables around the loop are flipped, from a valid solution we get another valid solution to the constraints (while the solution to the puzzle does not change). As discussed in Section 3, we must grant one exception to the parity con-straint at one location around the loop. In Sloop, we can fix where the exception is granted because we can identify in advance a cell through which the loop goes. Indeed, any empty cell can be chosen as the exceptional one. For the puzzle of Example 1 (n = m = 6), Figure 4 shows possible values: The f variables inside the loop are true; those outside are false. Each cell is annotated with the value of its p variable: red means true and light blue means false. To reduce clutter, the values of the p variables are only shown for the loop corners. Notice that the solver could have reversed the assignment of truth values to the p variables. For us, a puzzle with unique solution will be one for which the loop cannot be changed without violating the constraints. We will not insist on the uniqueness of the assignment to p variables. 4.1 Encoding the Rules of the Puzzle We now look at how to translate the given clues into constraints on the f variables. (The p variables are used to get the right shape of the loop, but do not appear in the constraints due to the clues.) The key observation is that, if the loop goes through a cell, then one or more corners are inside the loop, and one or more corners are outside. Specifically, if the loop goes straight through the cell, then two (adjacent) corners are inside and the other two are outside. If the loop turns in the cell, then three corners are inside and one is outside, or vice versa. If the loop does not go through a cell, the four corners will be either all inside or all outside. In the examples below, a filled square on a cell corner signifies that the corner is inside the loop, while an empty square signifies that the corner is outside the loop. The arrows indicating the direction of travel are based on our convention that we go around the loop clockwise, so that the outside region is always on our left. Of the 16 possible combinations of “inside/outside” for 4 corners, 4 correspond to straight paths through the cell; 8 correspond to turning paths; 2 correspond to the path not going through the cell; and 2 are impossible under the Sloop rules because they would require the path to cross the cell twice. (You should draw all 16 patterns to familiarize yourself with this idea. Your diagram will help you when you code the constraints.) The other mandatory part of the constraints has to do with guaranteeing a single, simple loop. We follow the approach outlined in Section 3. Recall that we can tell what the loop does in cell (i, j) if we know the values of the four corner variables fi,j , fi,j+1, fi+1,j , fi+1,j+1. In 12 of the 16 cases, the loop goes through the cell. In each of these cases, we know which cell it comes from and which cell it visits next. Hence, we know whether it takes an up-then-right turn, it takes a right-then-up turn, or does something else. In the first two cases, we impose the constraint that pi,j should have the value opposite to the p variable of the predecessor; in the last case, we impose the constraint that pi,j has the same value as the t variable of its predecessor. For the 4 combinations of the corner variables that do not correspond to cells on the loop, we specify no constraints on the p variables. As an example, consider this case: (i, j) (i, j + 1) For these values of the f variables, the constraint on the p variables should be, (pi,j ≠ pi+1,j ) ∧ (pi,j+1 = pi,j ) . Therefore, we need the constraints, (¬fi,j ∧ ¬fi,j+1 ∧ ¬fi+1,j ∧ fi+1,j+1) → pi,j ≠ pi+1,j (¬fi,j+1 ∧ ¬fi,j+2 ∧ fi+1,j+1 ∧ fi+1,j+2) → pi,j+1 = pi,j . We also need other constraints: for each cell, one constraint for each of the 12 combinations of corner values that are possible at that cell. In practice, we want to loop over all cells and add up to 12 constraints for each of them. Why do we say “up to?” Because, for example, in the top row of the grid, the loop cannot enter or leave a cell from above. Trying to refer to the cell above a cell in the top row would cause an out-of-range access, which is not nice. As discussed in Section 3, we need to allow one exception to the p constraints. That is, we need to let the constraints be ignored in exactly one cell. In general, we may want to let the solver pick the location by associating a Boolean variable, ei,j , to cell (i, j). (See [1] for the details.) In fact, for Slitherlink, we’ll do it. However, for Sloop we know that the loop has to traverse all the empty cells. Hence, we can pick any one empty cell and skip that cell when adding the single-loop constraints. We can also fix the value of the p variable for the exception cell. In Figure 4, we see that the p0,1 = p0,0, which is against the constraints. In fact, the first empty cell encountered when scanning the grid was chosen as the place where to make an exception. 4.2 Why Do We Get One Simple Loop? In this section we explain why the constraints we impose guarantee a single loop. We start by summarizing the constraints that we impose. For each cell in the grid, except for the exceptional one, the solver should be passed the up-to 12 constraints on the p variables corresponding to the possible configurations of the cell’s four corners. In addition, there is a constraint for each cell that forbids checkerboard patterns for the cell’s four corners. Moreover, all the corners along the edges of the grid must be false. Finally, we need to assert that at least one cell corner is inside the loop. We now prove that, for the constraints described above, a solution must consist of one simple loop. Consider an assignment of values to all f variables that satisfies all the constraints. This assignment fixes what the path does in each cell. Hence, it constrains the values of the p variables of the cells along the path. If no cell is on the path, then it is impossible to have one corner inside the loop and the grid border outside the loop. So, at least one cell is on the path. If a cell is on the path, its predecessor is also on the path because the two corners along the edge that connect the two cells have different values. The predecessor of the predecessor must also be on the path—for the same reason. Since the grid is finite, at some point, in going from one cell to its predecessor, we must come back to the cell we started from. Hence, we have a loop. Note that the no-checkerboard constraints prevent the path from branching or intersecting itself. Hence, as we walk from each cell on the path to its predecessor, we must reach the cell we started with before any other cell we subsequently visited. Hence, each loop we trace is simple. So far, we have shown that in any solution there must be a loop and that all loops are simple. However, there may be multiple loops. This is where the p variables come into play. The constraints on the p variables are such that, if all cells along a loop obey them, there’s an odd number of changes. That implies a contradiction because we assumed that the constraints were satisfied. However, Figure 5: Cuts are crossed an even number of times by the loop. with the one exception that we have, we can avoid the contradiction for one loop—and only for one. In conclusion, there must be at least one simple loop, but there cannot be more than one. Hence, there is exactly one simple loop. 4.3 Optional Constraints The optional constraints can be ignored in an initial implementation. If your solver is fast without additional constraints, you can ignore them altogether. For larger puzzles, however, they may make a difference. The optional constraints may guide Z3’s search for a solution by giving early warning that certain as-signments to part of the variables cannot be extended to full assignments that satisfy the constraints. If you need them, you may want to introduce them one at a time once your initial implementation works, so that you can verify that they speed up the solver without changing the solutions. A class of optional constraints deals with impossible patterns in the f vari-ables. Consider Figure 5. Note that the loop crosses the red vertical line and the green rectangle an even number of times. This observation is true in general of every line that runs on the grid lines and divides the grid into two regions. For the vertical line, there is a left region and a right region. For the rectangle, there is a region inside the rectangle and one outside. We can say even more. If we walk around the loop so that the outside of the loop is always on our left, then we cross the vertical line three times going from left to right and three times going from right to left. At the same time, we enter the green rectangle twice and also exit twice. Any valid solution to a Sloop puzzle satisfies these cut constraints. In the puzzle below, the red cut may be passed in three places: r2c1, r2c4, and r2c6. However, the loop must cross the red cut twice because 3 is, obviously, odd. We cannot avoid the two passages in Columns 1 and 6; otherwise, we would create dead ends. Hence, the loop cannot go from r2c4 to r3c4. This conclusion allows us to draw the loop segment shown on the right below. We can add cut constraints to the solver to let it stop working on a partial solution that is guaranteed to break them. Of course, there are many horizontal and vertical cuts, and even more closed lines in the grid. So, we will typically limit ourselves to a few, uniformly spaced, cuts. For a vertical cut like the red line of Figure 5, we ask whether the number of times ¬fi,5 ∧ fi+1,5 is satisfied equals the number of times fi,5 ∧ ¬fi+1,5 is satisfied, when i goes from 0 to 10. Another technique that is important for human solvers is based on even and odd cells. This technique is known as parity, but is a different application parity from the one we rely on to guarantee a single loop. Cell (i, j) is even if i + j is even, and is odd otherwise. An even cell has odd neighbors and vice versa. Hence, the loop visits even and odd cells in alternation. This means that a solvable puzzle must have the same number of even and odd empty cells. Take the puzzle of Example 1. There are 18 even cells and 18 odd cells in the 6 × 6 grid. Of the 4 black squares, two are on even cells (r1c3 and r4c2), while the other two are on odd cells (r2c5 and r6c3). This puzzle passes the parity check. A puzzle that fails this parity check is unsolvable. If is passes, it may or may not be solvable. In the grid below, even cells are shaded in green. The puzzle has 11 even empty cells and 11 odd empty cells: it passes the parity check. However, r1c1 has only one neighbor; hence, the puzzle has no solution. So far, we have considered cell parity as a way to detect some unsolvable puzzles, which may be useful to those who set puzzles. We can also use it to make inferences in solvable puzzles like the one below. The loop has to enter and exit the 3×3 region with the red border at least once because it has to visit all empty cells. There are only three cells in the region where the loop may cross in or out (r4c2, r4c3, and r6c3). Hence, the loop enters and exits exactly once. Moreover, there are equal numbers of even cells and odd cells in the 3 × 3 region. Hence, the loop’s entry and exit points have different parities (i.e., different colors). This means that one endpoint is r4c2, which is the only option for its color. The other endpoint must be r6c3 because the black square in r5c4 forces the path through r6c4. From this, we deduce the fragments of loop shown above on the right. (Note that there are only two neighbors left for r4c3 once it is ruled out as an endpoint.) Joining this path to the one derived with the cut constraint, we get the complete solution. The puzzle that we have used to illustrate the use of cuts and cell parity is an easy one. Using these advanced techniques on it may feel like taking a sledgehammer to a peanut. For difficult puzzles, though, the situation may be quite different. As far as mechanical solvers are concerned, cell parity suffers from the same drawback as cut constraints: there are many regions to which it may be applied and it’s not obvious which regions yield useful inferences. To illustrate, in the example above, we could also consider the last two rows of the grid and notice that they contain six white cell and five green cells that need to be on the path. Hence, the loop must enter and exist that region from white cells, namely, r5c3 and r5c5. We would get the same path segment we got with the region within the red contour above. However, if we looked at the two rightmost columns before we traced any path, we could not immediately say whether the loop enters and leaves the region once or twice; consequently, we wouldn’t make much progress. 5 Modeling Slitherlink Puzzles In Slitherlink, as in Sloop, we want to divide the grid into two regions: inside the loop and outside the loop. A lot of what we have said about Sloop applies to Slitherlink too. Hence, this section is much shorter than the previous one. The loop, however, uses the edges of the cells, instead of going through the cells’ centers. Therefore, we associate the f variables to the cells themselves instead of the cells’ corners: fi,j , is true if, and only if, cell (i, j) is inside the loop. Conversely, the p variables are associated with the cells corners because it is the cell corners, instead of the cell centers, that are found around the loop. 5.1 Encoding the Rules of the Puzzle We need to express the constraints on the number of loop edges around cell (i, j) in terms of the f variables. So, we need to understand whether an edge is part of the loop from the f variables of the cells that share that edge. Let’s denote the edges by the cardinal directions North, East, South, and West. Let’s take the North edge of Cell (i, j) as example; it is part of the loop if: • The cell is in the first row (i = 0) and it is inside the loop (fi,j is true), or • The cell is in any row except the first and fi,j ≠ fi−1,j . Similar observations apply to the remaining three edges. Hence, for each cell, we have four propositions, each for one edge. If the clue in the cell is k, we impose the (pseudo-Boolean) constraint that k of these propositions should be true. If there is no clue in the cell, no constraint is imposed. Note that, if we imagine that there is a border of cells around the actual grid, and we assume that the border cells are outside the loop, then, when in the first row of the actual grid, we can still write fi,j ≠ fi−1,j . Next, we need to impose constraints on the p variables. Conceptually, they are the same constraints as for Sloop. Specifically, we still have to consider up to 16 cases, two of which must be forbidden. In practice, there’s a couple of points to be noted. • The roles of corners and cells are swapped. • We lack the easy rule to fix where the exception to the parity constraints should be granted. A general solution to the latter problem is to introduce one Boolean variable for each corner, ei,j which is true if, and only if, that corner is the exceptional one. We then impose the constraint that at most one of these variables is true. We can also impose the constraint that pi,j must be true if ei,j is true. For the puzzle of Example 2 (n = m = 6), Figure 6 shows possible values of the p variables. Considerations similar to those made for Sloop apply here. We do not insist on the values of the p variables: only on whether they change or stay the same as we go around the loop. Figure 6: Possible values of the p variables for the puzzle of Example 2. The exception to the parity constraint occurs at corner (1, 0) , where the values of the p variables change, even though the loop does not take either an up-then-right or a right-then-up turn. 6 How Hard Are these Puzzles? This section will make more sense once we have covered Section 3.3 of our textbook. On first reading, you may skim it, or even skip it. We have discussed complexity classes for decision problems: those that have yes/no answers. We can derive decision problems from our puzzles by asking, “Does this puzzle have at least one solution?” Notice that we ask for “at least one” instead of “exactly one.” These decision problems are the ones whose hardness we briefly discuss in Section 6.1. The uniqueness question, which is an important one for puzzle setters, is then the subject of Section 6.2. 6.1 Existence of a Solution If we are given a purported solution to either a Sloop puzzle or a Slitherlink puzzle, we can easily check whether it is indeed a solution. Verifying that no black square is traversed by the loop and every empty cell is, for example, can be done in time linear in the size of the grid. For the connectedness checks, we can build a spanning tree of the inside of the loop in linear time. (The code described in Section 7 already does that.) All this means that both Sloop and Slitherlink are in NP: a “yes” answer comes with a witness (namely, the solution to the puzzle) that can be checked in polynomial time. Both problems have been shown to be NP-complete. Sloop is nothing but the Hamiltonian circuit problem for grid graphs, which was proved NP-complete in [4]. T. Yato demonstrated a polynomial-time reduction from the Hamiltonian circuit problem for a restricted class of graphs (known to be NP-complete) to Slitherlink [13, 14]. The proofs of NP-hardness can be found in the references. (See also [9, 10].) Figure 8 shows the puzzle that results from asking whether the graph of Figure 7 has a Hamiltonian circuit. (The example comes from [13].) Note that it is not enough to say, “Sloop asks the solver to find a Hamiltonian circuit in a graph. The Hamiltonian circuit problem is NP-complete [5]; hence, Sloop is NP-complete.” We actually need the result of [4] because, in principle, Figure 7: A planar graph with degree at most 3 (left) and its embedding in a grid (right). The graph on the left is planar because it can be drawn without edge crossings. Its degree is at most 3 because every vertex is connected to at most three other vertices. A Hamiltonian circuit is a closed path in the graph that visits each vertex exactly once. One such path is highlighted. Note that the grid on the right does not have a Hamiltonian circuit. Instead, the highlighted path is a closed path that visits each black vertex exactly once. Figure 8: Reduction from Hamiltonian Circuit to Slitherlink applied to the planar graph of Figure 7. The 6×6 squares delimit the gadgets that are stitched together to encode the grid. Each gadget corresponds to one vertex of the grid. The Hamiltonian circuit found in this solution of the Slitherlink puzzle (one of three solutions) is the one highlighted in Figure 7. restricting the graphs to grids may exclude the hard cases that make the problem NP-complete. For example, if we further restricted the possible grids so that there are no black squares, the problem would be in P. (See [4, 12] for the details.) What does the NP-completeness of our puzzles mean for our project? Since no known algorithm for an NP-complete problem runs in polynomial time in the worst case, we should expect to come across puzzles that take an inordinate amount of time to solve. We should expect the transition from easy to very difficult to be abrupt, and we’ll encounter puzzles of the same size that take very different amounts of time to solve. It is quite possible for a minor change in the way we write the constraints to make a large difference in the solution times of some puzzles. All this notwithstanding, most puzzles that are doable by humans are within the (easy) grasp of even a simple solver. Be prepared, but don’t lose heart. Most people will agree that it is much easier to find a Hamiltonian circuit directly on the graph of Figure 7 than to solve the Slitherlink puzzle of Fig-ure 8. In fact, anyone who is familiar with the definition of Hamiltonian circuit is likely to find one for the graph of Figure 7 in a matter of seconds. The greater difficulty of solving the puzzle is due, at least in part, to the fact that the reduc-tion of Figure 8 produces, for a graph with n vertices (and no more than 3n/2 edges), a grid with O(n 2 ) cells. In proving NP-hardness, we only need to come up with a polynomial reduction scheme. We don’t need a linear reduction. If, hypothetically, we devised a quadratic algorithm to find a solution of a Slith-erlink puzzle, the reduction of Figure 8 would give us a quartic algorithm for Hamiltonian circuit of planar graphs of degree at most 3. Quartic (O(n4)) is much worse than quadratic ((O(n 2 )), but is still polynomial. Recall that reduc-tions like this are not meant to provide practical ways to solve problems: they are only meant to prove that a polynomial algorithm for the candidate problem would yield polynomial algorithms for all problems in NP. 6.2 Uniqueness of the Solution For most puzzles, including Sloop and Slitherlink, the solution should be unique. We need to extend the basic framework of computational complexity, which talks about decision problems, if we want to talk about how hard it is to check whether a solution is unique. Unsurprisingly, this extension has been done. The starting point is the definition of function problems, in which the result is a string instead of a yes/no answer. The function problem analog to SAT asks for a satisfying assignment to a propositional formula to be returned, instead of “yes.” Among function problems, we are particularly interested in counting problems, in which the answer is the number of solutions to a function problem. The counting analog of SAT is #SAT, which asks the number of satisfying assignments of a propositional formula. Function problems have their complexity classes. A function problem is in FNP if there is a polynomial-time, deterministic algorithm that, given x and y, checks whether y is a possible output for x. For counting problems, the analog of FNP is the #P class. If a decision problem is hard, the corresponding counting problem is also hard—because knowing the number of solutions means also knowing whether there are solutions. The converse is not true. There are easy decision problems that give rise to hard counting problems. For example, 2SAT is in P, but #2SAT is #P-complete. Fix a decision problem, say, SAT. Checking whether a SAT instance has a unique solution is at least as hard as checking whether it has at least one solution: if we know that the instance has exactly one solution, we also know that it has at least one. Checking whether a SAT instance has exactly one solution is no harder than counting its solutions: if we have counted the solutions, we know whether their number is 1. To make things more “interesting,” though, the problem we are concerned with—whether a puzzle has a unique solution—is not exactly any of the prob-lems discussed so far. Why? Because the question we want to answer is whether, given that a puzzle has a solution, it also has another one. Why does the knowledge that there is a solution affect the difficulty of check-ing whether there is another solution? Consider graph coloring, which is NP-complete when the number of colors is at least 3. Suppose, however, that we have computed one k-coloring of a graph. Then, we can cheaply obtain k! − 1 other k-colorings by permuting the colors. So, a way to put the question of uniqueness is this: For puzzle type X, given a solution to a specific puzzle, is there a cheap way to determine whether there is another solution for the same puzzle that is applicable to all puzzles of type X? (X could be Slitherlink, for example.) Since our preferred method of checking for additional solutions involves calling the SAT solver again, it doesn’t seem that we believe that such a cheap way exists for our two puzzle types. In fact, we don’t (unless P = NP). In the remainder of this section, we provide justification for our belief. First, let’s give a name to the problem we want to discuss. For a puzzle type P (e.g., Slitherlink) we denote by ASP P the problem of deciding whether, given an instance of P (e.g., a Slitherlink puzzle) and a solution to that instance, there exists another solution.11 (ASP stands for Another Solution Problem [11]). ASP P, as we defined it, is a decision problem, which, for both Sloop and Slitherlink, has been proved NP-complete. For some problems P, there are direct proofs that ASP P is NP-complete. As in the practice of NP-completeness, though, once a problem ASP P' is known to be NP-complete, we can try to reduce it to another problem ASP P to prove the latter is NP-complete. The key ingredient of such an approach is a parsimonious reduction, that is, a reduction that provides a bijection between the solutions to the two problems. This way, if we have an instance of P' and a solution to it, we can map those to an instance of P and one of its solutions. If we find that the instance of P has no other solution, since the solutions of the two problems are in one-to-one correspondence, we know that the instance of P' does not have another solution either. We need both the reduction from P' to P and the mapping from the solutions of P' to the solutions of P to be computable in polynomial time. Then, we can argue that, if we had a polynomial algorithm to solve ASP P, we would have a polynomial algorithm to solve ASP P'. Parsimonious reductions have been used to prove that counting problems are #P-complete. Their role in the ASP context underlies the connection be-tween these problems. The good news for those who work with another-solution problems is that many reductions used to prove NP-completeness results are parsimonious. Based on parsimonious reductions, Yato [13] has introduced the notion of ASP-complete problem and proved that Slitherlink is ASP-complete. If P is ASP-complete, counting its solutions is #P-complete and its decision version is NP-complete. Problems related to Slitherlink that have been proved ASP-complete include the Hamiltonian circuit problem for undirected graphs with maximum degree 3 [8] and for grid graphs with maximum degree 3 [7]. 7 The Project The goal of this project is to implement two Z3-based solvers: one for Sloop and one for Slitherlink. The experience you gain with the Sloop solver will help you tackle the Slitherlink solver. Each solver consists of five files. A “starter kit” is available on Canvas. It contains, for each puzzle type: • A file (sloopinputs.py for Sloop and slilininputs.py for Slitherlink) containing a function called get_grid that takes an integer i as input and returns the i-th puzzle from a predefined collection. A Sloop puzzle is just a sequence of sequences of integers, where 1 represents a black square, and 0 represents an empty cell. In a Slitherlink puzzle, each entry of the sequence of sequences is either None (no clue) or an integer between 0 and 4 (a clue). This file also contains a function called check_grid to check the integrity of a puzzle grid. Finally, it contains a function called parse_command, which reads the command line. • A file (sloopdisplay.py for Sloop and slilindisplay.py for Slitherlink) containing implementations of the Unicode and matplotlib-based display functions. The implementations are complete except for the Slitherlink matplotlib-based function. • A file (sloopverify.py for Sloop and slilinverify.py for Slitherlink) that contains a function called verify that takes a grid and a purported solution and checks whether the latter is indeed a solution to the puzzle de-scribed by the former. Your code must call this function for each solution it finds. The function has an optional Boolean parameter (allow_weak) that makes it skip the check for a single loop. • A file (sloop.py for Sloop and slilin.py for Slitherlink) containing a skeleton of the solver. This file is where most of your implementation work will take place. In particular, you will have to define variables, add constraints to the solver, and implement the solve_and_print function. • A file (slooprun.py for Sloop and slilinrun.py for Slitherlink) to run your solver on all provided puzzles in one batch and collect the results in one file. The file has various options to control the experiment. Use the -h option to find out. The two solvers should take arguments from the command line that specify the following: • -p n to request solution of the n-th puzzle (from the collection in the “inputs” file). The first puzzle is number 0. • -m to request matplotlib output instead of Unicode. • -d to request that the solver draw the unsolved puzzle (in the format determined by the -m switch) and quit. • -a to request that the displayed solution include also the values of the p variables. (See Figure 4.) This option is only required to take effect when the -m option is also specified. • -s n to request that at most n solutions be computed. By default, the solver should find all solutions and report their count. • -v to control the amount of output produced by the solver. This option may be repeated (-v -v or -vv) to increase the verbosity of your program. It is up to you to decide what gets printed at each verbosity level. You should use to make the debugging of your programs more convenient. • -h to cause the solver to print a short help message. The parsing of the options and the (automated) generation of the help message is already available through parse_command. The functionality requested with those switches, of course, needs to be implemented. 8 Implementation Issues Throughout this section, we assume that the solver object is referenced through a Python variable named slv. 8.1 Interacting with the Z3 Solver Object Since all Z3 variables are Boolean in both our puzzle types, slv = SolverFor (’QF_FD’) is the recommended choice. When the solver has determined that the constraints are satisfiable, we can access the satisfying assignment by the model() method of the Solver class. We have to be careful, though, because Z3 may assign no value to certain variables. The event is pretty rare because, for a variable not to receive a value, there must be two equally valid solutions that only differ in the value of that variable. We still need to do something about it. Fortunately, Z3 can be asked to do model completion. Suppose you inquire the value of the Boolean variable x that did not get a value during the satisfiability check. Then slv.model()[x] returns None. Calling slv.model().eval(x), however, returns x. Finally, slv . model () . eval (x , model_completion = True ) will cause Z3 to add an arbitrary value for x to the model and return it. This is exactly what we want. It also leaves the model in the right state for when we later add a blocking clause to count the number of solutions. This approach is al ready implemented (for both puzzles) in the provided function evaluate_model. If, for whatever reason, slv.check() returns unknown, a call to slv . reason_unknown () will return an explanation string, which can be printed. It may be a little cryptic, but it’s usually better than nothing. Finally, it may be convenient to call simplify on constraints before adding them to the solver. The simplification only applies simple rules. (See Figure 9 for a sample of what it can and cannot do.) However, if you call print(slv), perhaps to check whether the constraints you’ve added are the ones you meant, the simplified forms may be easier to read. 8.2 Visualizing the Solution The ability to visualize the solutions to the puzzles is important, not only for the finished program, but also for the early “drafts.” Images like the ones of Figure 6 are reasonably easy to understand. Good luck, however, interpreting the output of print(slv.model()) without significant extra work. It’s safe to say that carefully planning the visualization of the puzzle solutions is key to the success of your project. Python has a powerful visualization library that some of you may have al-ready used: matplotlib. Matplotlib does not ship with the standard Python distribution, but it can be installed easily. With its help one can draw the puzzle as given, the solved puzzle, or the puzzle with the values of the p variables. The code for the first two tasks is provided to you. It is also possible to print a solution to the terminal window in which the program is running. In this case, you may want to use Unicode box-drawing And (True , a) -> a And (False , a) -> False And ( And (a , b) , c) -> And (a , b , c) Or (a ) -> a And () -> True Or () -> False Not ( Not ( a)) -> a Or (a , a ) -> a And (a , Not ( a)) -> False If (a , b , b ) -> b If (a , True , False ) -> a If (a , False , True ) -> Not ( a) Implies (a , a) -> True Implies ( Not (a) , a) -> a Xor (a , Not ( a)) -> True a == True -> a (a == a ) == b -> b And ( Or (a ,b) , Not ( Or (b ,a))) -> False PbEq ((( a ,1) ,(b ,1) ,(c ,1) ) ,0) -> Not ( Or (a , b , c)) AtLeast (a , b , c , 1) -> Or (a , b , c ) AtLeast (a , b , c , 3) -> And (a , b , c) AtMost ((a , b , c) , 1) -> AtLeast ( Not (a) , Not (b ) , Not (c) ,2) PbEq ((( a ,1) ,(b ,1) ,(c ,1) ) ,1) -> PbEq ((( a ,1) ,(b ,1) ,(c ,1) ) ,1) a == (a == b) -> a == (a == b ) And (a , Or (a , b) ) -> And (a , Or (a , b) ) And (a , Or ( Not (a) , b) ) -> And (a , Or (b , Not (a ))) And ( Or (a ,b) , Or (a , Not (b))) -> And ( Or (a ,b ) , Or (a , Not (b ))) Figure 9: Examples of results produced by simplify. Z3 applies a combination of constant propagation, rewriting in standard form, and simple heuristics. The last few lines of the table above show that simplify does not really do Boolean reasoning. Hence, it does not realize that And(a,Or(a,b)) is equivalent to a. Of course, these limitations only apply to simplify. If we ask Z3 whether the constraint And(a,Or(a,b))!= a is satisfiable, the answer is “no.” characters to produce output that is easier to read than plain “ASCII art.” This “low-budget” solution makes it easy to run a batch of puzzles, while saving the solutions in one file. In other respects, the Unicode solution is less satisfactory. On the one hand, a path traced with box-drawing characters is usually more difficult to follow than one traced with real graphics. On the other hand, adding the values of the p variables to a diagram made with box-drawing characters turns it into a mess. In case you are wondering, the puzzle figures in this document were generated by the solvers in LATEX format, using the TikZ package. This type of output is not required in your project: while the quality is the highest, you would need to install LATEX and learn how to use it. Feel free to inquire if you are interested. 8.3 Debugging Your Project Even before you run your program, you should consider using Python’s typing hints in your code so that a type checker for Python like mypy may detect some problems. Programs annotated with type hints are easier to read, especially when you return to them after a hiatus. The annotations take some time to enter, but they also help you to answer the question, “What did I have in mind when I wrote this?” Most Python programming environments provide a symbolic debugger—for example, an interface to pbd, the Python debugger— which allows you to step through the execution of your program, set breakpoints, and inspect variables. You may want to know how to run that debugger, even though you may not use it often. Finally, for any program of reasonable complexity, the author(s) should plan how to make debugging easier from the beginning. We already discussed the importance of good visualization of the solution in Section 8.2. It is also a good idea to have an easy way (e.g., from the command line) to control the amount of detail printed by your program. In standard mode, your program should only print the solution and the time taken, but when requested to be more verbose, it should report on whatever else you think may help you with the debugging. This is what the -v option of parse_command is for. When debugging small examples, it may make sense to print the constraints added to the solver. This can be done in two ways. The simpler is print ( slv ) The limitation of this approach is that, if there are many constraints—or asser-tions, as they are called in Z3—it will not print all of them: at some point, it will print three dots (i.e., an ellipsis) and give up. So, if you want to see all the contents of the solver, you need to iterate through the assertions yourself. For example: for assertion in slv . assertions () : print ( assertion ) 8.4 Gathering Statistics The Solver class has a statistics() member function that will report various quantities describing the behavior. of the solver. Not all those quantities are meaningful to someone without detailed knowledge of Z3’s functioning. How-ever, you will quickly realize that a long run involves many decisions and back-jumps, among other things. The CPU time reported by print(slv.statistics()) is the time taken by the last call to the check() method, not the cumulative CPU time spent by the solver. Besides, a significant fraction of the CPU time is spent in communicating the constraints to the solver. Therefore, it is a good idea to measure the CPU time spent by your program from start to finish. Python’s time package supplies all the necessary functions. Their use is illustrated by the skeleton solvers that you download as part of the Starter Kit.

$25.00 View

[SOLVED] SCOT 500M Spring 2025 Operations Analytics Simulation Decision Two Guidelines

Operations Analytics: Simulation Decision Two Guidelines SCOT 500M, Spring 2025 As you read the case, consider how you would utilize Discrete Event Simulation to model services provided by the  company’s tech teams. There are several challenges and issues one has to consider in analyzing the case. The following  guidelines should help in developing key assumptions of the modeling process. The first task is to model the current state. The case provides some information to assist in making  assumptions, although the data is  incomplete. The key results are that technicians dedicated to traditional servers are utilized more than 90% of the  time  and  customers  of traditional severs wait over 2.5 hours, on average, for a technician. Mainframe. customers wait one hour, on average, while these technicians face much lower utilization. 1.   One important issue to address is the length of each replication in Arena (under Run, Setup). I assumed that each replication is 240 hours. Reflecting a schedule of about 1.5 weeks. 2.   Service times for technicians follow an exponential distribution with a mean of 0.8 hours for service (including travel time), for both types of servers.  In the current state there are 4 technicians dedicated to traditional servers, and one technician dedicated to mainframes. 3.   Instead of analyzing the individual machine, you may assume that service requests are distributed over the course of the simulation trial. In other words, machines are the customers. Arrival times for service follow an exponential distribution. a.    For traditional servers: In a 24 hour period there should be about 114 arrivals. Choose the mean inter-arrival time accordingly (= 0.21 hours). There are 4 technicians. b.   For mainframes: In a 24 hour period there should be about 17 arrivals. Choose the mean inter-arrival time accordingly (= 1.4 hours), with one technician. c.    Growth  over  the  next  few  years.  The  increase  in  mainframes  and   reduction  in traditional servers will impact the inter-arrival times each year.  Use the following inter-arrival times to evaluate technician utilization and the waiting time for each time of server:   Current Year Year + 1 Year +2 Year +3 Traditional servers 0.21 0.22 0.23 0.24 Mainframes 1.4 1.15 0.9 0.8 4.    Analyze a single region. From there, you can extrapolate to the entire company. 5.   Approach Suggested by Paul Phixitt: implies that there may be a need to increase  the number of dedicated technicians for both traditional and mainframe. servers in each shift. Find the number of these technicians required to meet the objectives laid out by the committee. Then calculate the implications for increasing technicians in each region  and extrapolate to the entire company. Also verify that in the current format, waiting time for mainframes is about 1 hour. Evaluate the number of technicians of each type needed each year. If needed, increase the number of technicians, of either type, to meet the objectives. Once a technician is added, they should not be reduced in future years. 6.   Approach Suggested  by the Vice President for Engineering: This implies changing the distribution of service time. Assume a Triangular Distribution for service times. Focus only on the traditional servers. For the base case, assume parameters (0, 0.4,  2.05). This  should generate results similar to the base case (with the exponential distribution). Verify this. To model  the  approach suggested by Engineering, lower only the maximum value of the distribution to achieve the target. What implications are there for the new technology? Don’t worry about mainframes in this alternative. 7.   Approach Suggested by the Chief Financial Officer: In this scenario all technicians are the same and repair both types of servers. There are 5 technicians available to repair traditional and mainframe. servers. Evaluate if you need to add technicians in each of the following years, to meet the objectives. Is it true that in the first year, wait time for mainframes increase, because the mainframe. technicians also repair traditional servers (as stated by the marketing department)? 8.   Approach Suggested by the Vice President for Marketing: At the current staffing levels wait times for mainframes will exceed the target soon. To resolve this problem, they recommend adding a mainframe. technician. This is similar to the recommendation by Mr.  Phixxit, although less expensive, since only one type of technician is being added. Your answer here can be based on your previous analysis. Is it true that the reduction in traditional servers will shorten wait times sufficiently to meet the targets?

$25.00 View

[SOLVED] AFIN2070 Stochastic Methods in Applied Finance Session 2 2024

AFIN2070 Stochastic Methods in Applied Finance, Session 2, 2024 Quantitative analysis task ASSESSMENT DESCRIPTION The assignment will cover quantitative analysis of the materials taught in the class. The assignment will cover the topics from week 1-9. Information for Assignment: On 2 October at 6 pm, the following three (3) items will become available on iLearn: - A pdf titled "Assignment Questions" containing a list of assignment questions, - An Excel spreadsheet titled "Assignment Data", and - A link titled "Submit Assignment to Turnitin". The assignment is worth a total of 30 marks. The submission due date is Sunday 13 October 11:59 pm. Answer the questions to the best of your ability. There are two types of questions, CALCULATION (C) and WRITTEN RESPONSE (W). Where applicable, responses that do not show sufficient working steps will not receive full marks. Unless otherwise specified, give your answers to 4 decimal places. You are required to submit your assignment to Turnitin. For Turnitin to scan your answers properly, your WRITTEN RESPONSE (W) answers must be typed and then converted into PDF format. Any other format will not be accepted. For CALCULATION (C) questions, you may insert pictures of graphs or handwritten equations in your document to show working, but handwritten or otherwise scanned/photographed submissions will not be graded if Turnitin cannot scan your WRITTEN RESPONSE (W) answers. You will only be able to submit your assignment ONCE. Make sure you submit the final version of your assignment. A penalty of 5% of the total possible mark (of the task) will be applied each day (24-hour period) a written assessment is not submitted, until the 7th day. The 7 days includes weekends. After the 7th day, a grade of ‘0’ (zero) will be awarded even if the student submits the assessment (for example, an assignment that is 25 hours late will incur a 3- mark penalty - 10% of the total 30 marks). This penalty will not apply to cases in which an application for special consideration is made and approved. Skills in focus for this assessment The assignment will develop your critical thinking, problem-solving and technical skills, as well as your discipline knowledge. ASSESSMENT INSTRUCTIONS None specified beyond the above description TIPS & FAQs USE OF RESOURCES AND TECHNOLOGIES INCLUDING GENERATIVE ARTIFICIAL INTELLIGENCE Students are not permitted to use GAITs to generate writing used in their final submission or produce counter-arguments on their final submission. Any of these actions will constitute and be treated as a breach of academic integrity. Note, too, that this is an individual assignment. General discussion of the topic is allowed but analysis, conclusions and written submission must be your own work. LATE SUBMISSION A maximum penalty of five percentage points of the total possible marks will be applied per day to late submissions, for up to a maximum of seven calendar days. Tasks that have not been submitted within the maximum number of additional late days will receive a mark of zero, unless otherwise specified in the late penalties section of the Unit Guide. Late submission for a task will only be permitted when specified in the unit guide. This provision does not apply to online exams or other assessment with a time-limit of less than 24 hours. Where an application for Special Consideration is approved and the outcome is an extension to the due date of a task, submissions that are received after the new due date will be subject to late penalties that are calculated from the new due date. This only applies where the outcome is an extension to the due date – see the Special Consideration Policy for a schedule of all possible outcomes.

$25.00 View

[SOLVED] Cross correlation and Fourier transform of signal Coursework 1R

Coursework 1 (50% of final mark) Draft code due 21st September Report due 15th/October *Cross correlation and Fourier transform. of signal *Curve fitting The original signals show below (as attached in email) shows surface waves propagating in material A. The signals are 1 mm, 2 mm, 3 mm, 4 mm, 5 mm and 6mm from the wave resource. The sample frequency is 100 MHz and 1000 points are collected for each signal.   Please try the following: 1) FFT power spectrum for each of the signal. What is the frequency resolution? 2) Tell what is the frequency bandwidth for each signal if the stop band is -20 dB? 3) What is the time gap between each surface wave signal (use cross correlation to find it out)? 4) What is the average velocity of surface wave? 5) Based on the Equation  if we assume density is 1100 kg/m3 and Poisson’s ratio is 0.45, what is the Young’s modulus of this material? 6) Use the similar method to calculate the SAW velocity of Material B (data 2). The signals are 4 mm, 6 mm, 8 mm, 10 mm, 12 mm and 14 mm away from the wave resource. The sample frequency is 91.2 kHz and 256 points are collected for each signal. 7) One of the materials is agar and one is Aluminium. From the analysis you did before, identify the correct material to Material A (data 1) and material B (data 2) and explain. 8) Each signal has some longitudinal components (see figure below the blue arrows), how this longitudinal wave component attenuated with the distance it travelled? Find the attenuation curve and using fitting technique to find out the physics it follows? Data 2

$25.00 View

[SOLVED] CCS302 China Social Policy

CCS302 China: Social Policy Department of China Studies Stage 4 | Level 3 SECTION A: Basic Information Brief Introduction to the Module The aim ofthis module is to provide students with an understanding ofthe evolution of socialpolicy in China through an examination oftheori es and ideologies influencing it, to then carryout an analysis of suchpolicies. Key Module Information uleissharedBAChina Studies

$25.00 View

[SOLVED] CIV2235STRUCTURAL MATERIALS Week 11 Practice Class Statistical Testing

CIV2235—STRUCTURAL MATERIALS Week 11 Practice Class Statistical Testing Question 1 [40 marks]. The average adult male height in a certain country is 170 cm. We suspect that the men in a certain city in that country might have a different average height due to some environmental factors. We pick a random sample of size 9 from the adult males in the city and obtain the following values for their heights (in cm): 176.2 157.9 160.1 180.9 165.1 167.2 162.9 155.7 166.2 Assume that the height distribution in this population is normally distributed. Here, we need to decide between H0: μ = 170,  H1: μ ≠ 170. Based on the observed data, is there enough evidence to reject H0 at significance level α=0.05? Question 2 [30 marks]. A survey in a specific suburb leads to the conclusion that the residents drive their cars, on average, 256 kilometres per week. One resident wants to find out if this average is also valid for himself. For 21 weeks he keeps track of the number of kilometres he drives. The average and standard deviation turn out to be 302.4 and 38.0 km, respectively. With a confidence of 0.8, can the resident claim that he drives a different amount of kilometres per week than the average driver in his suburb? Question 3 [30 marks]. A shop in a shopping mall has been receiving on average 102 clients per day for the last few years. A new employee claims that she can increase this average by using a new advertising strategy. The shop owners allow her to test this. After 24 days with the new strategy, the number of customers served per day is 103.0, with a calculated standard deviation of 7.0. With a confidence of 0.85, can the employee claim that she increased the amount of customers? Practice (no mark).  As a part of her evaluation of municipal employees, the city manager audits the parking tickets issued by city parking officers to determine the number of tickets that were contested by the car owner and found to be improperly issued. In past years, the number of improperly issued tickets per officer had a normal distribution with mean of 380 and standard deviation of 35.2. Because there has recently been a change in the city’s parking regulations, the city manager suspects that the mean number of improperly issued tickets has increased. An audit of 50 randomly selected officers is conducted to test whether there has been an increase in improper tickets. Use the sample data (n = 50 and the mean number of improperly issued tickets is 390) and α = 0.01 to test the research hypothesis that the mean number of improperly issued tickets is greater than 380.

$25.00 View

[SOLVED] CCS306 Theories of Chinas Change Semester 2 2024-2025

CCS306 Theories of China’s Change Semester 2 2024-2025 SECTION A: Basic Information o Brief Introduction to the Module This  module  aims  to  engage  students  in  understanding  the  important  theoretical discussions in the field of China Studies. The module will first introduce the main conceptual components of major social theories. Subsequently, it will present how some of these have been adapted by scholars in academic research about the society and development of contemporary  China.  Finally, students will take  part  in these conceptual discussions through a  multidisciplinary, comparative, and theoretically- informed approach to area studies. o  Key Module Information Module name: Theories of China’s Change Module code: CCS306 Credit value: 5 Semester in which the module is taught: 2 Pre-requisites needed for the module: N/A Programmes on which the module is shared: BA China Studies; Diploma in China Studies SECTION B: What you can expect from the module o Educational Aims of the Module This module aims to engage students in understanding the most important theoretical discussions  in  the  field  of  China  Studies.  Students  will  learn  the  conceptual components and construction of major social theories. Subsequently, students will learn how some of these have been adapted by scholars in academic research about the society and development of contemporary China. Finally, students will take part in these conceptual discussions  by adopting one  major theory to analyze a case of China’s socioeconomic change. o  Learning Outcomes Students completing the module successfully should: A.  Identify the main concepts and ideas of major social theories related to social change. B.  Structure a clear understanding of the conceptual links between social theory, comparative assessments, and area studies. C.  Demonstrate an understanding of the ways in which scholars have adapted and applied social theories to the empirics of contemporary China. D.  Produce a theoretically informed assessment of current debates in China studies. o Assessment Details The lecturer will discuss with and explain to students the assessment system in classes during the first week of teaching. Method % of Final Mark Deadline Participation And In-Class Performance 15 Weekly In-Class Presentation 15 Weekly Research Essay (including two components) 70 7 April 2025, 11:59 pm 19 May 2025, 11:59 pm Assessment item 1: In-Class Participation (15%) You are expected to  read the “ Required  Reading”  prescribed for each topic BEFORE attending the lectures. All students are expected to participate actively in seminar discussions by demonstrating that they have read the readings required for each  lecture  and  seminar,  offering  an  analysis  of  the  readings,  and  presenting questions to the class. Students’ analytical thinking ability and willingness to develop their knowledge and debating skills will be assessed. Attendance to the classes alone does not count towards your in-class performance mark. The lecturer will evaluate students’ performance. Students will be given relevant marks according to their participation and in-class performance: 0 –  39:  The  student  remains  a  passive  observer  and  does  not  display  signs  of engagement with the topic, such as participation in discussion and debates or asking questions. 40 – 49: The  student  answers  questions when  asked  and  occasionally joins the discussion. Student participation is characterized by descriptive responses rather than critical analysis. Student’s performance is more of a passive response than active participation. 50 – 69: The student regularly participates in discussion and debate and is familiar with the material/topics discussed. He/she displays an ability for critical analysis and adequate debating skills. However, his/her discussion of themes tends to be more descriptive or only reiterates ideas from the prescribed readings. 70 – 100: student shows consistent and active participation that significantly enriches in-class  discussions  and  debates.   He/she  often  takes  the   lead   in  discussions, presenting a critical analysis of the materials/topics discussed while also presenting his/her own ideas with cogent arguments to support his/her views. Assessment item 2: In-Class Presentation (15%) During the first week of teaching, students will choose one of the topics from weeks 3 to 13 as the base for their in-class presentation. Presentations should be given by a two-student group. This is not a traditional in-class presentation; you are not expected to lecture the class. The main goal of this assessment is to create an engaging and informative presentation that can lead to further discussion and debate with the rest of the class. Presentations by each group should last no more than 20 minutes. Do NOT simply summarize the readings. The criteria for assessing your presentation is to elucidate and critically assess the analytical usefulness of the concepts and theories used in the readings each week and, through raising insightful questions, stimulate discussion among other students after the presentation has finished. Discussion with the group will take place after the presentation has finished. Presentations by each group should contain at least four parts: (1) Summarize the major theory and key authors’ contribution; (2) provide a detailed example to show how the major theory was used to study empirical cases; (3) analyze a Chinese case to show how the theory could be adapted to study China; if the theory is developed in China, analyze a none-Chinese case to show a Chinese theory could be extended to analyze other countries; your analysis should identify a clear issue and provide a meaningful argument; (4) reflect on the strength and weakness of the theory.  Presentation assessment criteria Assessment item Excellent Good Adequate Needs Improvement Theoretical analysis (25%)         Identification of key arguments and relevant issues (25%)         Promotes     questioning     and discussion (25%)         Effective communication (25%)         Assessment item 3: Research Essay (70%) Component 1: Essay Outline (25%) 800 words (excluding references); any essay plan that is >10% below or above the word length requirement will be liable to a mark penalty. The essay outline constitutes the scaffolding on which you will build your research essay. In it you are meant to identify a topic or issue that you want to research for your essay and formulate the research questions and hypotheses that will constitute the argument  of your  research  essay. Your  essay  outline  must  include  the  following elements: 1.   What is the core topic or issue that you will be examining in your research essay? Provide a suggested title for your essay and introduce the topic/issue. 2.   What question do you want to address in relation to that topic/issue? 3.   What theory will you use to explore the research question? 4.   Include a minimum of 10 academic sources that you will use when writing your essay (other than the essential readings) 5.   Include any other sources (e.g. online sources) that will also be helpful when writing your research essay Marking    criteria:    The    same    marking    criteria    around    analysis,    research, structure/expression, and  presentation/documentation will apply to  both the essay outline  and  the  research  essay.  These  criteria  will  be  applied  according  to  the parameters outlined in each assessment requirement description. Component 2: Research Essay (45%) 3000 words (excluding references); any essay that is >10% below or above the word length requirement will be liable to a mark penalty. A research essay is a particular kind of academic writing in which the writer builds an argument about a topic (or in answer to a question) using evidence to support their views. Evidence is mostly drawn from academic sources. This essay is usually made up of an introduction, a literature review, a theoretical framework, a methodology, a main body, and a conclusion. 1.   The   introduction   should    include   your    research   background,    research question(s), a summary of the thesis or main argument of the essay, and a statement about the contents of the essay. 2.   The literature review should include the minimum 5 most influential empirical studies on your concerned question; their academic influence/impact may be measured by the number of citations on Google Scholar. The literature review needs  to  show  a  gap  between  the  reviewed  studies  and  your  potential theoretical argument. 3.   The theoretical framework should introduce the theory you choose to analyze the empirical data. You need to summarize the theory, its development, and how it was used to study economy, society, politics, organizations, or culture in the past, including the minimum 5 influential theoretical or empirical studies that (re)constructed the theory or apply the theory to analyze empirical cases. Then, you need to lay out why and how you apply this theory to analyze your data. 4.   Methodology should explain the thought process through which you designed this essay research, including how you came up with this research, how you identified relevant literature, how you collected secondary data for analysis, what  practical  problems  you  have,  and  how  they  were  resolved  (or  not resolved, in this case, how it will impact your analysis and conclusion). 5.   The main body is made up of a series of paragraphs that build the argument, using  theory  to  analyze  the  facts/data  (the  facts  and  the  theory  are from sources in your reference list). Each paragraph contains a sub-argument (or one aspect of the argument/theory) and flows logically from one paragraph to the next. The crucial point is connecting the theory to empirical data in your analysis. 6.   The conclusion restates the main findings and central argument of the essay in summary  form  to   remind  the   reader.   It  may  conclude  with   some  brief statements about the (potential) implications of the study. The main aim of this essay is to exercise your theoretical skills to build a convincing argument. It is best to start off with the relevant assigned essential reading in order for you to be well-familiarized with the main ideas and theories and be able to put forward a clear and cohesive argument.  However, you will also be expected to use other sources  (peer-reviewed  academic  journal   articles,  academic   books,  and   book chapters),  including  those  from  the  suggested  reading  lists  in  the  week-by-week reading guide and from your own independent research. A minimum of 10 academic sources (other than the assigned essential reading) should be included in the analysis and the references list. Use of online sources: While you can also reference online resources (such as government statistics, opinion pieces, news articles, etc.), these should only be used to back an argument or to provide examples to illustrate the ideas and arguments discussed in your academic sources. - The analysis should be relevant to your chosen essay topic; it should show a critical engagement with the  literature; and express arguments with clarity. Avoid jargon, particularly when unfamiliar with its definitions and uses. - Avoid over-relying on direct quotations. If you cannot summarize the author’s ideas in your own words, you have not yet fully grasped their meaning. Use direct quotes ONLY when the author's exact words are crucial to the argument you are making. - However, you should still make sure to acknowledge authors’ ideas and specific data (e.g. statistical figures) by referencing sources appropriately, even when you have summarized or paraphrased their ideas. - The essay must have a title page. Your student number MUST be at the top of the title page, followed by the essay's title, and the essay's total word length (excluding all references). Pages should be numbered. The text must be in 12-point font and have 1.5 spacing.

$25.00 View

[SOLVED] AFIN2070 Assignment

AFIN2070 Assignment INSTRUCTIONS FOR ASSIGNMENT The assignment is an individual task. You are not to discuss or share your work with any other student. The release date for the assignment is Wednesday 2nd  October 6PM, the due date is Sunday 13th October 11:59PM. Answer the questions below to the best of your ability. There are two types of questions, CALCULATION (C) and WRITTEN RESPONSE (W). Where applicable, responses that do not show sufficient working steps will not receive full marks. Unless otherwise specified, give your answers to 4 decimal places. You are required to submit your assignment to Turnitin. For Turnitinto scan your answers properly, your WRITTEN RESPONSE  (W)  answers  must  be  typed  and  then  converted  into  PDF  format.  Any  other  format will  not  be accepted. For CALCULATION (C) questions, you may insert pictures of graphs or handwritten equations in your document to show working, but handwritten or otherwise scanned/photographed submissions will not be graded if Turnitin cannot scan your WRITTEN RESPONSE (W) answers. Submit your PDF under the section “Assignment Submission Link” on iLearn. This assignment is worth 30 marks in total. The marks for each question and sub-component have been clearly indicated. A penalty of 5% of the total possible marks (of the task) will be applied each day (24-hour period) the written assessment is not submitted, until the 7th day. The 7 days includes weekends. After the 7th day, a grade of ‘0’ (zero) will be awarded even if the student submits the assessment (for example, an assignment that is 25 hours late will incur a 3-mark penalty -  10% of the total 30 marks). This penalty will not apply to cases in which an application for special consideration is made and approved. Question 1 (4 marks) COPYCON wants to see if their weekly sales values have any impact on their weekly share returns (with a one-week delay). The relevant values over a two-month period are shown below (data are also available in the Assignment Data spreadsheet under “Q1” . Week Sales revenue in week ($millions) Share return for (week + 1) 1 18.8 5.4% 2 41.4 31.7% 3 40.5 40.3% 4 19.7 5.9% 5 49.2 17.6% 6 15.4 11.7% 7 45.2 24.6% 8 31.7 24.9% 9 43.4 34.7% 10 42.7 14.4% a)    (C) Calculate Spearman’s rho for this data. Show full working.        [2 marks] b)   (C) Calculate Kendall’s tau for this data. Show full working.          [2 marks] (HINT: The use of Excel may help you here. If you do choose to use Excel, include any relevant explanation of the calculation used as part of your submission) Question 2 (6 marks) The daily returns over a selected period for share A and B have been recorded and provided to you in the Assignment Data spreadsheet under “Q2” . Use this data to answer the following questions. a)    (C) Make an appropriate graph of the pairs of daily returns to depict the relationship. Include all relevant labels to make your graph clear.          [2 marks] b)   (C) State the Pearson’s correlation coefficient for these daily returns. You do not need to show any working for this part.     [2 marks] c)    (W) Explain what your result in part b) means with reference to your graph in part a).          [2 marks] Question 3 (8 marks) Jimmy has collected annual advertising spending and sales data from 100 different businesses in Metropolis. This data has been recorded and provided to you in the Assignment Data spreadsheet under “Q3” . All amounts are measured in thousands of dollars. Use this data to answer the following questions. a)    (C) Jimmy would  like to use this data to build a model to estimate the annual sales based on advertising spending. Plot an appropriate graph based on the data provided.           [2 marks] b)   (C) Jimmy now has to fit the models i  = α + βA i  + εi; where si   is the annual sales for business i, Ai   is the annual advertising spending for business i, and εi~N(0, σε(2)) is the i.i.d. error term for business i. State the values of α and β from this fitted model. You do not need to show any working for this part.       [2 marks] c)    (W) Explain what α and β in part b) represent.          [2 marks] d)   (W) Under Jimmy’s model, state explicitly the assumptions for the error term εi. From the graph in part a), does the data seem to match the assumptions required? Explain your answer.          [2 marks] Question 4 (4 marks) Roy is modelling the maximum daily loss in any month for shares in Emblem Industries. He believes this maximum loss L follows a GEV(0.03,0.02,0.01) distribution. a)    (C) Write down the CDF for this distribution and clearly state what this function represents. Also, calculate the mean and variance of L under Roy’s model. Clearly state any values of the Gamma function that are used in your model.     [2 marks] b)   (C) Using part a) or otherwise, find the value x in the distribution so that P(L  > x) = 1%. Show all relevant calculation steps.   [2 marks] Question 5 (4 marks) Michael works for an insurance company that currently has a portfolio of 200 home insurance contracts in the region of Lloyd. Michael has been asked to undertake a risk analysis of the home insurance portfolio. By looking at home insurance portfolios from other regions, he assumes that the number of claims follows a Poisson process with an average of 8 claims per year. a)    (C) What is the probability that the first claim from this portfolio does not happen within three months? Clearly state what distribution(s) you are using and show all relevant calculation steps.          [2 marks] b)   (C) Michael’s boss is worried about the company going bankrupt. He says that if the company receives 30 or more claims from this portfolio within the next 4 years they won’t be able to afford it. Under Michael’smodel, what is the probability that this occurs? Clearly state what distribution(s) you are using and show all relevant calculation steps. (Hint: the use of Excel may help you. If you do choose to use Excel, include any relevant explanation of the calculation used as part of your submission.)         [2 marks] Question 6 (4 marks) The monthly return of a portfolio of shares is distributed as in the table below: Outcome Probability -40% 0.001 -35% 0.004 -20% 0.005 -15% 0.04 -10% 0.05 -5% 0.1 0% 0.3 2% 0.22 5% 0.15 10% 0.1 15% 0.03 a)    (C) Calculate the expected return on the portfolio in the worst 1% of all cases         [2 marks] b)   (C) Calculate the expected return on the portfolio in the worst 10% of all cases          [2 marks]

$25.00 View

[SOLVED] ESS 101 B Sp 23 Introduction To Geology And Societal Impacts

ESS 101 B Sp 23: Introduction To Geology And Societal Impacts Examination 1 Question 1 Which of statements below are correct regarding scientific observations of the solar system, which support the contention that the sun and planets formed from a rotating, disk-shaped, nebular dust cloud? (There are 2 correct answers) The planets are aligned with the Sun's equatorial plane The planets are not aligned with the Sun's equatorial plane The planets revolve in a counter-clockwise direction around the sun The planets revolve in a clockwise direction around the sun Most of the planets and their moons rotate on their axes in a clockwise direction Question 2 Meteorites that strike the earth may be composed of ____________? (Select the 3 correct answers) Iron-Nickel Oxide minerals Chondritic (silicate minerals) Sulfide minerals carbon Question 3 Which of the following statements are not true regarding S-waves as they propagate through the earth. (Select the 2 correct answers below) S waves are completely absorbed in the asthenosphere S waves are faster than P waves S waves refract as they propagate through different density materials S waves are also described as shear waves S waves are absorbed in the liquid outer core Question 4 Which of the sources of heat listed below were not important to the differentiation of the earth into compositional zones? (2 answers are correct) background thermal heating from residual "Big Bang" energy kinetic energy of impacting planetesimals radioactive decay of natural radioactive elements compressional heating as earth gained mass solar heating Question 5 Transform. plate boundaries are typically associated with ___________. convergent margins where the descending plates speeds up during subduction convergent margins where the descending plates slows down during subduction divergent margins where the rate of spreading is different along segments of the spreading ridge divergent margins where the rate of spreading is the same along segments of the spreading ridge collisional margins where plates are being thrust over one another Question 6 Which of the following statements are not correct related to the compositional zonation of the earth? (There are 2 correct answers) the earth became compositionally zoned when the sun first formed the earth is not compositionally zoned the densest compositional zones are in the earth's interior the earth became compositionally zoned after the melting temperature of iron was reached the earth's atmosphere and oceans formed during differentiation and degassing Question 7 Match the magma/lava type with the appropriate geographic/tectonic setting where it is found. ocean-ocean convergence             andesite Mid-Atlantic Ridge                        basalt ocean-continent convergence        granite Question 8 Special Reading 1 Most of what is known about the Earth’s early planetary history comes from _____________. More than one answer may be correct. (Three answers are correct). comparing Earth to its planetary neighbors, Venus and Mars Studying other planetary systems using the Hubble telescope Directly drilling through the Earth's crust to its core the sparse geologic record from 3.5 billion years ago computer models of atmospheres changing with time Question 9 Which of the following plate motions would not likely occur in the future? East Africa will diverge from Central Africa forming a small ocean basin The Juan de Fuca plate will become smaller as the rate of seafloor spreading is less than the rate of its consumption at the subduction zone The Isthmus of Panama will open and North America will separate from South America western California will be displaced southward towards Mexico along a transform. fault The Mediterranean Sea will close as the African Plate converges with the Eurasian Plate Question 10 Match the structure within the subduction zone with the appropriate geographic feature in Washington State (shown on the figure below). Olympic Mountains              Accretionary Wedge Puget Lowland                    Forearc Basin Columbia Plateau                Backarc Basin Question 11 Which of the following statements are correct regarding preservation of the earth's magnetic field signature within magnetite crystals contained in a basalt flow erupted and solidified at the earth's North Pole today? (there are 2 correct answers) the magnetite crystals will have a steep inclination the magnetite crystals will have a low inclination the magnetite crystals will possess a normal (north) polarity magnetite crystals will be arranged haphazardly within the crystallized basalt flow the magnetite crystals will possess a reversed (south) polarity Question 12 Refer to the image below to answer the following question. Which seismic wave(s) is recorded by seismograph located a 155° angular distance from the epicenter of the above earthquake? surface waves S waves only No seismic waves are recorded P and S waves P waves only Question 13 Where are minerals naturally produced on earth? (choose the 2 correct answers) crystallization of magma from wood fiber in a tree in a scientific laboratory in a clam shell precipitation from and aqueous solution Question 14 The diagram below shows the evolution of the San Andreas Fault system that first formed along the western margin of North America shortly after 30 million years ago when the leading edge of the spreading ridge was subducted under North American plate at the latitude of California. Which of the following statements are true regarding the evolution of the San Andreas Fault system and subduction of the spreading ridge? 3 answers are correct. the asthenosphere convection cell now lies west of California in the Pacific Ocean basin Broad uplift of the Colorado Plateau and downcutting by the Colorado River (creation of the Grand Canyon) is related to heating of the North American plate Basin and range extension tectonics is related to the underlying upwelling of the asthenosphere the asthenosphere convection cell now lies under Nevada and Utah (east of California. Cascade volcanism in Oregon and Washington is related to subduction of the spreading ridge under California Question 15 The cause of volcanism observed in the Cascades is most similar to that of ________. the European Alps Iceland Andes Mountains the Ural Mountains Hawaii Question 16 Which of the following cannot be explained by plate tectonics? The presence of volcanic mid ocean ridges Volcanic mountain chains around the Pacific Ocean basin The inclination of the earth's magnetic field The matching coastlines of Europe and Africa and North America and South America Spatial distribution of most earthquakes Question 17 Which of the following statements are not true regarding continental collision tectonic margins? (select the 2 correct answers) basaltic volcanism will be common andesitic volcanism will be common marine sedimentary (ocean floor) rocks will be uplifted granitic plutons will form. at depth high mountain ranges will form. in the center of continents Question 18 Match the traits that are characteristic of the magma compositions shown below: High Viscosity                         Felsic Form. shield volcanoes              Mafic Explosive eruptions                  Felsic Low melting temperatures        Mafic High Mg/Fe content                 Mafic Produced at mid-ocean ridges   Mafic Question 19 What evidence have geophysicists used to indicate that the core is metallic and has a liquid component? (There are two correct answers) the presence of the earth’s magnetic field seismic wave studies, specifically the S-wave shadow zone the presence of iridium in the outer core convection in the outer core drives plate tectonics a segment of the metallic core has been brought to the surface along deep kimberlite dikes Question 20 What gases escaped from the Earth’s atmosphere into space during the early differentiation of the Earth? (There are 2 correct answers) helium carbon dioxide hydrogen nitrogen water vapor Question 21 Metals generally have _________ melting and boiling points are _________ conductors of heat and electricity? low, poor none of the other answers are correct low, good high, good high, poor Question 22 In the 2nd special reading it was proposed that the 20,000 year climate cycle in East Africa that ranges from extreme aridity to very wet conditions is driven by _________. Sunspot cycles None of the other answers are correct Changes in the Earth’s orbit around the sun El Nino upwelling cycles in the west Pacific Ocean Cyclical magma upwelling along the East African rift zone Question 23 Water (H2O) melts at a very low temperature because the water molecules are held together within the crystal structure by ____________ bonds. strong covalent bonds strong metallic strong ionic weak Van der Waal weak ionic Question 24 Why does quartz not exhibit a well-defined 6-sided crystal structure in the rock granite? it has lowest melting/freezing temperature and is last mineral to crystallize it has the lowest melting/freezing temperature and is the first to crystallize it has the highest melting/freezing temperature and is the last mineral to crystallize it has the highest melting/freezing temperature and is the first to crystallize none of the other answers are corrects, as quartz form. 6-sided crystals in the rock granite Question 25 What mineral group is most important for the production of drywall used in residential home construction? sulfides sulfates oxides carbonates halides Question 26 Look at the image below of the mineral amphibole. Note that 2 of the oxygen atoms are shared between 50% adjacent tetrahedra and 3 oxygen atoms are shared for the other 50% of the tetrahedra with covalent bonds. What is the ratio of Si:O in the double chain amphibole mineral structure? 1:2.75 1:3 1:2.5 1:2 1:4 Question 27 Which mineral group provides most of the world's economic lead (Pb) for battery production? oxide silicate halide sulfide carbonate Question 28 Why does Ca-rich plagioclase develop cleavage planes yet it is a framework silicate mineral with all its oxygen atoms shared between tetrahedra? this mineral is not a silicate mineral and consists of weak ionic bonds between the oxygen atoms this mineral may have an Al atom in its tetrahedra which requires additional ionic bonds with Ca atoms none of the other answers are correct this mineral does not cleave the mineral cleaves between covalent bonds separating sheet pairs Question 29 Which of the following statements are correct regarding silicate tetrahedron? (Choose the 3 correct answers). it has a net charge of -4 it is the least common mineral group comprising the crust and mantle it is bonded with covalent bonds within the tetrahedron 1 silicon atom is bonded with 4 oxygen atoms it is bonded with van der waal bonds within the tetrahedron Question 30 How do scientists explain the presence of heavy elements, such as iron and nickel comprising planets in our solar system? the heavy elements are remnants from the original Big Bang formation event of our Universe none of the other answers are correct heavy elements were produced within the planets during differentiation the heavy elements formed during a super nova event during the death of a pre-existing star heavy metal were produced in our sun and expelled by the solar wind Question 31 Match the source rock with the magma type produced from partial melting of that source rock. partial melt of asthenosphere                                                     basaltic magma partial melt of subducting ocean crust and marine sediments         andesitic magma partial melt of continental crust                                                   granitic magma Question 32 Answer the question below based on the diagram showing partial melting in the earth mantle (asthenosphere). Which of the following statements are correct based on the information shown in the above diagram. (3 answers are correct) the rising magma will solidify before it reaches the surface the rising magma will have temperature of about 1400°C when it reaches the surface the rising magma's actual temperature was same as its melting temperature where it first started melting the rising magma will have a temperature of less than 1100° C when it reaches the surface the rising magma will become more liquid as it rises towards the surface Question 33 A porphyritic (volcanic) rock has 0% quartz, 60% plagioclase, 40% amphibole and 10% pyroxene. What would the rock be called according to the chart? Diorite Basalt Rhyolite Andesite Granite Question 34 What criteria are most conducive for a volcanic eruption to cause climatic cooling? (2 answers are correct) ejecta erupted into the stratosphere volcanic eruptions near equatorial latitudes volcanic eruptions near the polar latitudes ejecta erupted into the troposphere volcanic eruption that occur under water Question 35 The attached image is an obsidian sample. Why does obsidian appear dark when it is largely comprised of amorphous silica glass the silica glass has trace magnetite crystals present the silica glass has entrained burned iron deposits obsidian is composed of pure amphibole that gives it its dark color obsidian is actually basalt that cooled quickly in water obsidian is actually iron-magnesium rich composition Question 36 Which two igneous rocks listed below are classified based on their porous textures? (multiple answer question) tuff scoria volcanic breccia tough pumice Question 37 Use this photo to answer questions. There are three minerals shown in this porphyritic andesite: a) small black minerals, b) larger white minerals, c) smaller minerals in the gray matrix. Of the following options, which lists the minerals in order of which crystallized FIRST to which crystallized LAST? B, A, C A, B, C C, B, A B, C, A C, A, B A, C, B Question 38 Match the mineral with the diagnostic property that is most useful for its identification. biotite                 breaks into black flexib hematite              leaves a reddish-brown quartz                 glassy luster, breaks al amphibole           dark green prismatic cr Question 39 Which of the following statements are correct regarding shield volcanoes? (There are 3 correct answers) Magma is typically basaltic compostion. Magma is typically andesitic composition. Their slope angle ranges between 7-10°. Their slope angle ranges between 25-35°.°. They form. above mantle hotspots below the ocean floor The form. above subduction zones. Question 40 Which of the following arrangements of minerals are compatible? In other words, which of the below arrangements would you expect to see in an igneous rock? (there are 2 correct answers). Potassium Feldspar, Pyroxene, Biotite Olivine, Biotite, Plagioclase Amphibole, Pyroxene, Quartz Potassium Feldspar, Muscovite, Amphibole Quartz, Olivine, Amphibole

$25.00 View