Assignment Chef icon Assignment Chef

Browse assignments

Assignment catalog

33,401 assignments available

[SOLVED] CHEM0012 Polymers Coursework Statistics

CHEM0012 – Polymers Coursework Format and Rules All three questions should be answered in prose (continuous sentences). Students are limited to 600 words per question. Words beyond the limit for each question will not be marked. Submit as doc/docx/odf format only. Do not submit as PDF. You must answer all questions. Marking is anonymous - PLEASE DO NOT PUT YOUR NAME OR STUDENT NUMBER ANYWHERE ON THE COURSEWORK (including in the file name) 50 marks are available overall. •    45 marks are available for the three questions (15/20/10, respectively), •    4 marks available for quality of writing •    1 mark for providing an AI statement (see below) Use of AI This assessment is classified as Section 2- use in an assistive role for AI usage. You can use AI for this coursework, but it is not encouraged. Please note that preliminary testing of these questions using ChatGPT gave incomplete/incorrect answers. Firstly, you must read UCLs policy on the use of AI here: https://www.ucl.ac.uk/teaching-learning/generative-ai-hub/three-categories-genai-use-assessment In your coursework, you must supply an AI statement, beginning with “ I have read and understand the UCL policy on Three categories of GenAI use in assessment.” If you do not understand the policy, please let me  know in advance of the deadline. For the rest of your AI statement: •    If you don't use AI you must add the statement " AI was not used in the production of this coursework" •    If you do use AI then you need to give a further 300 word commentary of how you used AI including o The type of AI used o How you have amended the AI results o How you have integrated AI results into your answers Deadline Your answers must be submitted by 6th  December 2024 at 17:00 GMT via Moodle Assignment. Follow-up A breakdown of your marks will be provided to you as an annotated version of your submission. When scores are released and after all extended submission deadlines have elapsed (likely in the new year), I will upload a document on Moodle in the Polymer section containing  model answers, a summary of common mistakes with corrections, and information on marking for transparency. Questions 1.    Given a powder of pre-synthesised poly(vinyl acetate), how can you make a bulk solid with high tensile strength? For each step, explain how it will influence mechanical properties. [15] 2.    A sample of isotactic polypropylene is heated above its melting temperature (170 °C) and very slowly cooled to below its glass transition temperature (-15 °C) down to -50 °C, before being measured by DSC using 3 cycles (named a-c), one after another: a.    The sample is heated quickly (50 °C min-1) from -40 °C to 250 °C before cooling quickly (50 °C min-1) back to -40 °C b.   The sample is then heated slowly (1 °C min-1) from -40 °C to 250 °C before cooling slowly (1 °C min-1) back to -40 °C c.    The sample is finally heated quickly (50 °C min-1) from -40 °C to 700 °C before cooling quickly (50 °C min-1) back to -40 °C Schematically draw the DSC curves for the three cycles (a-c) each on a separate set of axes. For each, give a brief description of the thermogram features and an explanation of what is happening at a molecular level, comparing to previous cycle(s) where appropriate. [20] N.B., The graphs maybe created digitally or drawn by hand and scanned. Please ensure the graphs are embedded in the submitted doc/docx/odf file, and not submitted as a separate file. DSC (Mettler Toledo DSC 3) at UCL 3.    Poly(ethylene glycol) is said to be “more soluble” in water than cellulose acetate. Why is this true (or not), and how might you be able to tell? [10]

$25.00 View

[SOLVED] CCC 8011 Critical Thinking Analysis and Argumentation Python

CCC 8011 Critical Thinking: Analysis and Argumentation Guidelines for Argumentative Essay and Debates Argumentative essay Hand-in via Moodle. Due date: Dec 13. For your argumentative essay, choose one of the issue topics below: 1. Can women have penises? 2. Is it morally permissible to take photographs of sleeping, unaware or even dead people and display the photographs as art? . 3. Is it morally permissible to eat meat? On your chosen topic, you have to read the required reading and engage with it in your essay. The structure of your argumentative essay should be as follows: Part I: Overview In this part, you should construct an argument in an argument map. The conclusion should be the claim that you are arguing for in your essay (this claim is called your essay thesis). Part II: Essay In the essay part, you need to write a 500-600 word essay on the basis of the argument in the argument map that you gave in the overview. Your essay should have the following form. i) You should have a short first paragraph which states your essay thesis (=the claim you will argue for). You can also describe the structure of the rest of your essay in this paragraph. ii) The next 1-2 paragraphs should convert the numbered argument given in the overview into prose. You can also cite something in support of one or more of your premises. iii) The next 1-2 paragraphs should develop an objection to either one of the premises of your argument, or to the conclusion. The objection should refer to the readings or to the materials used in class to introduce the topic. Please be specific. iv) The final 1-2 paragraphs should give a response to this objection. In general, you must refer to the readings whenever it is appropriate. For example, if you found a similar argument/objection/response there, then you need to mention this.

$25.00 View

[SOLVED] CSC 110 Y1F EXAMINATION 2023 Python

CSC 110 Y1F FINAL EXAMINATION December 2023 Question 1. Short answer [9 marks] Assume each of the pieces of code below is being typed into the Python console.  Each subquestion (Part (a), Part (b), etc.)  is independent of the others, but within each part, each line of code is affected by all the code that is executed before it. In each space below, write what would be displayed, if anything. If there is any part of the code that would cause an error, write ERROR underneath that piece and briefly explain why that error would happen. Part (a) [3 marks] >>>  class_list  =  [[ ' Simran ' ,  ' A+ '],  [ ' Bob ' ,  ' B- '],  [ ' James ' ,  ' A+ '],  [ ' Sadia ' ,  ' C ']] >>>  len(class_list) >>>  len(class_list[0][0]) >>>  class_list.pop() >>>  class_list[len(class_list)  -  1] Part (b) [3 marks] >>>  class_dict  =  { ' A+ ' :  [ ' Mia ' ,  ' Bumbly '],  ' B- ' :  [' Bob '],  ' C ' :  [' Sadia ']} >>>  class_dict[' Mia '] >>>  class_dict[' A+ ']  +=  class_dict[' C '] >>>  class_dict[' C ']  =  [' Tom '] >>>  class_dict[' A+ '] >>>  class_dict[' C '] Part (c) [3 marks] >>>  fave_colours  =  [( ' Bob ' ,  ' Yellow ' ),  ( ' Tom ' ,  ' Green ' ),   . . .                               ( ' Sadia ' ,  ' Pink ' ),  ( ' Mia ' ,   ' Sparkly ' )] >>>  fave_colours[0][0] >>>  fave_colours.append(( ' Ali ' ,  ' Red ' )) >>>  len(fave_colours) >>>  fave_colours[2][1]  =  ' Rainbow ' >>>  fave_colours[2][1] Question 2. Memory Model [4 marks] Below is an object-based memory model diagram showing the state of the memory model at the moment immediately before a program ends. Part (a) [1 mark] If the last thing the program did was print(things), what would be the output? Part (b) [3 marks] Complete the following code so it will generate the memory model diagram shown above by putting an expression or statement in each of the three boxes. Do not add in any extra lines or change anything else. def  binoo(stuff:  list,  i:  int)  ->  None: stuff[i]  = def  toopy(lst:  list,  add:  str)  ->  None: binoo(lst[0],  1) if  __name__  ==   ' __main__ ' : nums  =  [26,  17,  39] word  =  ' hi ' things  = toopy(things,  ' ! ' ) Question 3. Tabular data [19 marks] Consider the tabular data below. It provides information on all of Sadia’s pets. Each sublist has information about a single pet, with the information given in the order:  [name, species, age]. pet_data  =  [ . . .          [ ' Kyoko ' ,  ' cat ' ,  14], . . .          [' Chirly ' ,  ' bird ' ,  4], . . .          [' Bumbly ' ,  ' dog ' ,  5], . . .          [ ' Pocoyo ' ,  ' cat ' ,  3], . . .          [ ' Tomoyo ' ,  ' cat ' ,  3], . . .          [ ' Mia ' ,  ' dog ' ,  2] . . .  ] Complete each of the following questions. They all involve data about pets stored using the format described above. Part (a) [3 marks] Complete the following function according to its docstring.  In your solution, you may not use loops.  Use a comprehension. def  is_senior(cur_pets:  list[list],  pet_name:  str)  ->  bool: """Return  whether  the  pet  with  the  given  pet_name  is  a  senior  pet (at  least  8  years  old) . The  list  cur_pets  is  structured  in  the  same  way  as  in  the  example pet_data  provided  at  the  start  of  this  question . Preconditions: -  All  pet  names  in  cur_pets  are  unique -  pet_name  exists  as  a  pet ' s  name  in  cur_pets >>>  is_senior(pet_data,  ' Kyoko ' ) True >>>  is_senior([[ ' Luna ' ,  ' cat ' ,  9],  [ ' Belgirl ' ,  ' cat ' ,  3]],  ' Belgirl ' ) False """ #  Note:  You must  use  comprehensions  below .  Loops  are  not  allowed . Part (b) [2 marks] Complete the following function according to its docstring.  In your solution, you may not use loops.  Use a comprehension. def  get_species(cur_pets:  list[list])  ->  set[str]: """Return  a  set  of  all  the  species  in  the  given  cur_pets  list  of  lists . The  list  cur_pets  is  structured  in  the  same  way  as  in  the  example  pet_data provided  at  the  start  of  this  question . >>>  get_species(pet_data)  ==  { ' cat ' ,  ' dog ' ,  ' bird '} True >>>  one_pet  =  [[' Bonny ' ,  ' dog ' ,  3]] >>>  get_species(one_pet) {' dog '} """ #  Note:  You must  use  comprehensions  below .  Loops  are  not  allowed . #  Complete  the  function  body  below  according  to  the  docstring . Part (c) [4 marks] Complete the following function according to its docstring. In your solution, you may not use loops. You should use either any and/or all, and use one or more of the functions from the previous parts as a helper. You may assume the functions from Parts (a) and (b) are available to use and are implemented correctly. def  all_dogs_and_some_senior(cur_pets:  list[list])  ->  bool: """Return  whether  all  pets  in  cur_pets  are  of  the  species  ' dog '  and  at  least one  of  them  is  a  senior  pet  (at  least  8  years  old) . >>>  some_pets  =  [[ ' Aisha ' ,  ' dog ' ,  16],   [ ' Murphy ' ,  ' dog ' ,  4]] >>>  all_dogs_and_some_senior(some_pets) True """ #  Note:  You must  use  any()  and/or  all(),  and  one  or more  of  the  functions  from  Part  (a) #  and/or  Part  (b)  as  a  helper .  Loops  are  not  allowed . Part (d) [6 marks] Sadia recently got a raise!  So, naturally it might be time to get another pet. Help her figure out what type of pet to get next by completing the function below. The function takes in a list of current pets and also a dictionary that maps various species to an ideal number of that species to have.  The function returns a new dictionary that maps each species given in the ideal number dictionary to how many more of that species Sadia needs to reach her ideal number. def  new_pets_needed(cur_pets:  list[list],  ideal_pet_counts:  dict[str,  int])  ->  dict[str,  int]: """Return  a  new  dictionary  that maps  each  species  from  ideal_pet_counts  to  the  number  of new  pets  of  that  species  that  are  needed  to  reach  the  ideal  count .  If  the  current  number  of  that species  owned  is  already  greater  than  or  equal  to  the  ideal  number,  the  number  of  new pets  of  that  species  that  are  needed  should  be  0 . The  list  cur_pets  is  structured  in  the  same  way  as  in  the  example  pet_data, and  includes  information  about  each  pet  a  person  already  has . The  dict  ideal_pet_counts  is  a  dictionary  that maps  species  to  the  ideal  number of  pets  of  that  species  that  the  person  wants  to  have . Preconditions: -  all([ideal_pet_counts[species]  >=  0  for  species  in  ideal_pet_counts]) >>>  res  =  new_pets_needed(pet_data,  { ' cat ' :  10,  ' tarantula ' :  0,  ' dog ' :  1}) >>>  res  ==  { ' cat ' :  7,  ' tarantula ' :  0,  ' dog ' :  0} True """ Part (e) [2 marks] Sadia realized it’s almost 2024, and she forgot to update all her pets’ ages this year! Complete the function below to help her add one to each pet’s age in a given pet data list of lists. def  increment_ages(cur_pets:  list[list])  ->  None: """Increment  the  age  of  all  pets  in  cur_pets  list  of  lists  by  one . The  list  cur_pets  is  structured  in  the  same  way  as  in  the  example  pet_data provided  at  the  start  of  this  question . >>>  two_pets  =  [[ ' Luna ' ,  ' cat ' ,  1],  [ ' Lulu ' ,  ' cat ' ,  3]] >>>  increment_ages(two_pets) >>>  two_pets [[ ' Luna ' ,  ' cat ' ,  2],  [ ' Lulu ' ,  ' cat ' ,  4]] """ Part (f) [2 marks] Sadia wants to write a bunch of pytest functions to make sure increment_ages is working correctly and she asked her student Bob to help. Bob wrote the pytest method below but it seems to fail even when the increment_ages function appears to be correct. def  test_increment_ages()  ->  None: """Test  that  increment_ages mutates  the  list  it  is  given  correctly . """ lst  =  [[ ' Luna ' ,  ' cat ' ,  1]] result  =    increment_ages(lst) assert  result  ==  [[ ' Luna ' ,  ' cat ' ,  2]] What programming error has Bob made when writing his pytest function? Explain clearly below. Fix Bob’s programming error by writing a correct pytest method for the increment_ages function below: def  test_increment_ages()  ->  None: """Test  that  increment_ages mutates  the  list  it  is  given  correctly . """ Question 4. Dataclasses [6 marks] Sadia decided to represent her pet data using the below dataclass instead of a list of sublists: @dataclass class  Pet: name:  str species:  str birthdate:  date       #  date  is  imported  from  the  datetime module Notice that she decided to use an attribute for the pet’s birthday instead of keeping track of it’s age, just in case she forgets to update the age again. Sadia will instead use the function get_age that takes in an instance of the Pet dataclass and returns the age of the described pet based on today’s date (provided as a date object). The use of the date object is demonstrated in the following Python console log: >>>  from  datetime  import  date >>>  d  =  date(2008,  7,  23)      #  Example  date  object >>>  d.year 2008 >>>  d.month 7 >>>  d.day 23 Part (a) [2 marks] Complete the doctest examples below to create an instance of a cat named Pudding born on date(2020,  11,  2) for the first test, and an instance of a dog named Miracle born on date(2022,  12,  25) for the second test. def  get_age(p:  Pet,  today:  date)  ->  int: """Return  how  old  p  is  in  years,  based  on  today ' s  date .   #  Test  for  cat  whose  birthday  already  happened  this  year >>>  cat  = >>>  get_age(cat,  date(2023,  12,  15)) 3 #  Test  for  dog  whose  birthday  has  not  yet  happened  this  year >>>  dog  = >>>  get_age(dog,  date(2023,  12,  15)) 0 """ #  Note:  the  function  body  will  be  completed  in  the  next  part  of  this  question Part (b) [4 marks] Bob wrote some code that correctly completes the function body for get_age so that it returns a given pet’s age in years. A pet is considered to be 0 years old until they reach their first birthday. Bob used the following algorithm for his code: Subtract the birthday year from today’s year. But, if the birthday has not been celebrated yet this year, subtract one from the difference. Also, if the pet hasn’t even been born yet, simply return 0. However, Bob somehow corrupted his file and now all his lines of code are out of order!  Unscramble the code below by rewriting each line in the right order. Be sure to include proper indentation within your code. Do NOT add in any additional lines. Use only the lines exactly as provided in the list below. 1.  if  d.month  >  today.month  or  (d.month  ==  today.month  and  d.day  >  today.day): 2.  years  =  today.year  -  d.year 3.  d  =  p.birthdate 4.  return  0 5.  if  d.year  < today.year: 6.  years  -=  1 7.  return  years 8.  else: def  get_age(p:  Pet,  today:  date)  ->  int: """Return  how  old  p  is  in  years,  based  on  today ' s  date . """ #  Write  a  correct  implementation  of  Bob ' s  algorithm  below  by  unscrambling  his  lines  of  code . # Use  ONLY  and  EXACTLY  the  lines  of  code  provided  above,  do  not  add  in  any  new  lines . #  Add  in  proper  indentation  as  needed . Question 5. Number theory and logic [4 marks] Disprove the following statement: ∀a,b, n ∈ Z+ , (a b    (mod n)) ⇒ (a % n = b) Write your formal disproof of the statement below: Question 6. Runtime analysis [4 marks] For both of the functions below, analyze the running time of the function in terms of n (the given value or the length of the given set). Provide an exact step count (no need to simplify mathematical expressions – e.g.  leaving something as 2 * 3 instead of writing 6 is fine). Also provide the associated Θ expression for the running time.  (No further explanation for the Θ expression step is required.) Part (a) [2 marks] def  f1(n:  int)  ->  int: """Docstring  omitted . """ i  =  0 j  =  0 while  i    None: """ Preconditions: -  all(numbers[i]  >=  0  for  i  in  range(0,  len(numbers))) """ for  i  in  range(0,  len(numbers)):                                     #  Loop  1 if  numbers[i]  %  2  ==  0: for  j  in  range(numbers[i],  len(numbers)):   #  Loop  2 numbers[j]  =  1 Note: There are no items in range(a,  b) when b    None: """Initialize  a  new  stack  with  no  items . """ self ._items  =  Queue1() def  is_empty(self)  ->  bool: """Return  whether  this  stack  contains  no  items . """ return  self ._items .is_empty() def  pop(self)  ->  Any: """Remove  and  return  the  item  at  the  top  of  this  stack . Preconditions:  not  self .is_empty() """ def  push(self,  item:  Any)  ->  None: """Add  the  given  item  to  the  top  of  this  stack . """

$25.00 View

[SOLVED] CS 577 Sample Final Exam Questions

CS 577 Sample Final Exam Questions Sample Graph / Greedy Exam Questions 1    Wisconsin Jones (10 points) 1.1.  (5 points)  As the intrepid computer scientist/archaeologist adventurer Wisconsin Jones, you have dis- covered the earliest know Bucky Badger icon buried deep beneath Lake Mendota by a long forgotten student society OΩΘ in an elaborate labyrinth.  The labyrinth is a grid, where each edge is either a wall or a door, and you must move from square to square by passing through the doors.  Due to the instability of this ancient site, you want to recover the icon as fast as possible before it collapses and the waters of Lake Mendota rush in.  Moreover, you know that the OΩΘ society have multiple different labyrinths and treasures buried under Lake Mendota so you want to come up with an algorithm that can work for any n × m labyrinth. An example of a labyrinth, where dashed lines are doors, solid lines are walls, and × is the Bucky icon: (a)  (3 points)  Give an efficient O(nm) algorithm that finds the fastest route to the treasure given the input of the labyrinth as described.  You can assume that the labyrinth data structure allows you to find the entrance cells in constant time, and, for some cell x, you can find cells accessible from x in constant time. (b)  (2 points)  Justify the time complexity of your algorithm from Part a. 1.2.  (5 points)  The labyrinth has m doors, labelled 1 to m, which are connected to one or more of n levers, labelled 1 to n.  All the doors are closed and need to be opened by pulling all of the levers one-by-one. Your goal is to figure out the order of lever pulls to ensure that all doors are open at the end. The behaviour of the levers is described by an n × m matrix M. When lever i is pulled, door j behaves as follows: • If Mi,j  = 1, then door j opens. • If Mi,j  = −1, then door j closes. • If Mi,j  = 0, then door j remains at its previous state (open or closed). Since the OΩΘ society was able to place Bucky in the labyrinth, there is guaranteed to be a sequence of lever pulls to open all the doors. We will construct an order σ in which we pull the levers, i.e.  σ[i] is the ith lever you pull. Suppose that there are m = 5 doors, and n = 3 levers with matrix The optimal order to pull the levers is σ = ⟨2, 3, 1⟩ . We will fill in σ in reverse order.  That is, we first determine σ[n] (the final lever to be pulled), then σ[n − 1], and so on.  Let σ[i + 1, n] = ⟨σ[i + 1], ·,σ[n]⟩  be the last n − i lever pulls.  In other words, the i + 1 to nth lever pulls. Two of your computer scientist/archaeologist assistants proposed two possible heuristics for choosing the ith level to pull,i.e. how to determine σ[i] given σ[i + 1, n].  For each door j = 1, . . . ,m, let fj(i)+1  be the last nonzero value in the sequence ⟨M[σ[i + 1], j],..., M[σ[n], j]⟩, or fj(i)+1  = 0 if no such nonzero value exists. Let Di+1  ⊆ {1,..., m} be the set of doors where fj(i)+1  = 1. Let Ci+1  = {1,..., m}  Di+1 . The two proposed heuristics are: 1.  Choose the ith lever, i.e.  set σ[i], to be a lever whose row in M  contains no −1s in the columns indexed in Ci+1 . 2.  Choose the ith lever, i.e.  set σ[i], to be a lever whose row in M contains the most 1s in the columns indexed in Ci+1 . Neither assistant completed CS577 so it is up to you figure out which heuristic to use. You’ll only have one chance to open the doors so it is critical that the proposed algorithm works. (a)  (1 point)  Which heuristic is correct? (b)  (1 point)  Give a counter-example for the other heuristic than indicated in Part a. (c)  (3 points)  Prove that the heuristic indicated in Part a is correct. 2 The TP Standard, Part 1 (10 points) It is the year 2220 and the most valuable commodity in the known universe is a roll of 2-ply toilet paper. It is lost to history exactly why Humanity moved to the TP standard...  Only that it has been this way for 100s of years. You are working in logistics for Royale Bank – a joint Irving-RBC company. You are asked to design an order processing algorithm.  Given the value of a single roll of toilet paper, shipping costs are negligible compared to a roll. You must ship rolls in bundles of fixed quantities. The goal of your algorithm is to ship the exact quantity ordered using the least number of bundles per order. 2.1.  (10 points)  Consider the case where Royale Bank ships n bundles sizes b1  < b2 < ··· < bn , where b1 = 1 and bi+1 = c · bi for some integer c > 1.  That is bi+1  is a multiple of bi. (a)  (1 point)  Consider the bundle sizes:  1, 3, 6, 12.  What is the optimal number of bundles sent for an order of 42 rolls of toilet paper?  Describe how many of each bundle size. (b)  (3 points)  Provide a greedy  algorithm to determine the optimal number of bundles and how many of each size to ship. (c)  (2 points)  Prove that your algorithm terminates. (d)  (3 points)  Prove that your algorithm is optimal.  Clearly state your approach:  stay ahead vs ex- change argument. (e)  (1 point)  Prove the running time complexity of your algorithm. Sample Divide and Conquer Questions 3 Political Divide (10 points) 3.1.  (10 points)  You are in a room with n politicians p1 , p2 , . . . , pn , where nisa power of 2.  Each politician belongs to one of k parties, where k > 1. You want to know which politicians are in which party, but it is impolite to directly ask.  However, you notice that whenever two politicians that belong to the same party are introduced to one another, they shake hands.  When two politicians that belong to different parties are introduced, they stareat each other angrily. (a)  (6 points)  Using divide and conquer and the  O(1) method  introduce(pi , pj ) to introduce two politicians pi  and pj  to each other, design an algorithm to group the politicians into their k parties. (b)  (3 points)  Give the recurrence relation for your algorithm in Part a. (c)  (1 point)  Give the asymptotic runtime based on the recurrence given in Part b. 4 Wordplay (10 points) 4.1.  (10 points)  The English word “below”  has a curious property.  Its letters are all arranged in ascending alphabetical order. We will call this an alphabetical word. (a)  (2 points)  How quickly can you check whether a given n-letter word is alphabetical? Briefly describe an algorithm for doing so, and state its asymptotic run-time. (b)  (2 points)  Since there are very few alphabetical words in the English language, we are also interested in words that are almost alphabetical. A word is called k-alphabetical if removing k (or fewer) letters would make it an alphabetical word. A friend of yours proposes the following algorithm to determine whether a word is k-alphabetical.  In the following algorithms, for a string w , w[0] is the first letter, w[−1] is the last letter: Algorithm 1: calcAlpha Input : A word w. Output: k, where w is k-alphabetical, and w ′ an ordered string. if w has length 1 then return (0, w) end (k1, w1) := calcAlpha(Front-half of w) (k2, w2) := calcAlpha(Back-half of w) k3 := k1 + k2 Initialize w3 to an empty string while w1 or w2 is not empty do if w1 is empty then foreach letter ℓ ∈ w2 do Append to w3 if ℓ ≥ w3[−1]; otherwise discard and add 1 to k3 end else if w2 is empty then Append w1 to w3 else if w1[0] ≤ w2[0] then Remove first character from w1 and append to w3. else Discard first character from w2 and add 1 to k3. end end end return (k3, w3) Algorithm 2: isAlpha Input : A word w and a integer k. Output: true if w is k-alphabetical, false otherwise. (k ′ , w′ ) := calcAlpha(w) return k ′ ≤ k Write a recurrence relation describing the run-time of this algorithm and state the resulting asymp- totic run-time. (c)  (3 points)  Unfortunately, your friend’s algorithm does not always work.   Provide an example of a word and a number k such that the isAlpha reports the word is NOT k-alphabetical when it actually is.   (Your  word does not need to be a real English word.)   Draw the recursion tree to demonstrate your example. (d)  (3 points)  In the previous section, you showed that your friend’s algorithm does not always return the optimal answer. Prove that it only errs in one direction. It never reportsawordisk-alphabetical when that word in fact is not k-alphabetical. Sample Dynamic Programming Questions 5 World Traveller (10 points) You’re planning on flying around the world. Your plane has a fuel tank of capacity T and can fly 1 kilometre per litre of fuel. You’ve mapped out your flight plan and it consists of n cities where you can stop to refuel. For each city i, you have two values fi , the price per litre of fuel in city i, and ci  the cost to stop and refuel. That is, the cost to refuel in city i is fi · ℓ + ci , where ℓ is the number of litres purchased. For any two sequential cities, i and i + 1, you know the distance di,i+1  in kilometres which is no more than T by design and, as chance would have it, all di,i+1  are integral. Before heading out, you decide to calculate the optimal refuelling schedule.  That is, calculate how much fuel to purchase at each city given that you start at city 1, have no gas in the tank, and will visit all the cities in order from 1 to n. 5.1.  (2 points)  Assume that ci  = 0 for all cities.  Give an optimal greedy algorithm that runs in O(nlog n) time. Note: you do not have to prove that the algorithm is optimal. 5.2.  (8 points)  Assume that ci  ≥ 0 for all cities, design a dynamic program to calculate the optimal refuelling with a worst-case runtime of O(nT2 ). (a)  (2 points)  Describe the array/matrix M used in your dynamic program.  Be sure to give the di- mensions and any cells that can be immediately initialized. (b)  (1 point)  In which cell of M will the optimal fuel cost located? (c)  (2 points)  Give the Bellman equation for your dynamic program. (d)  (2 points)  Give an efficient algorithm to recover the amount of fuel purchased in each city from the array/matrix M populated based on your dynamic program. (e)  (1 point)  We would say that this dynamic program is: A. pseudo-polynomial B. polynomial 6 The TP Standard, Part 2 (10 points) 6.1.  (10 points)  Consider the more general case where Royale Bank ships n bundles sizes b1  < b2 < ··· < bn , where b1 = 1. (a)  (1 point)  Consider the bundle sizes:  1, 2, 6, 9.  What is the optimal number of bundles sent for an order of 12 rolls of toilet paper? Describe how many of each bundle size. (b)  (1 point)  Again, consider the bundle sizes:  1, 2, 6, 9.  What is the greedy solution for an order of 12 rolls of toilet paper? Describe how many of each bundle size.  (Note it should not be optimal!) (c)  (8 points)  Let T ≥ 1 be the total number of rolls of toilet paper ordered. Design a dynamic program to calculate the optimal number of bundles to send with a run-time complexity of O(nT). i.  (2 points)  Describe  the  array/matrix used in your dynamic program.   Be  sure  to  give  the dimensions and any cells that can be immediately initialized. ii.  (1 point)  In which cell will the optimal solution be located? iii.  (2 points)  Give the Bellman equation for your dynamic program. iv.  (2 points)  Describe  how to recover the number of each bundle size to send for the optimal solution. v.  (1 point)  We would say that this dynamic program is: A. pseudo-polynomial B. polynomial Sample Network Flow Questions 7 Garden Addition (10 points) 7.1.  (10 points)  The University of Wisconsin Botanical Garden is hiring you to help plan their new addition. It will contain n2  individual garden tiles, arranged in a square. Each of these gardens will be connected to the horizontally and vertically adjacent gardens, so that visitors can easily traverse them.  However, the ground that they want to build on has many hills, so some gardens are at low height and some are at high height. The heights are provided in an array H[i,j], where H[i,j] = 1 if garden (i,j) is at high height, and 0 if it is at low height. If a garden is at a different height than an adjacent garden, they will need to add a ramp between those two gardens to ensure that they are connected.  Each ramp costs R dollars. They are also capable of raising or lowering individual gardens (changing the height from low to high or from high to low), at a cost of W dollars each, in order to reduce the number of ramps needed. Your job is to decide which gardens to raise/lower (if any) in order to minimize the cost of building the new addition. In the following example: If we do not change the heights of any gardens, then we will need to build one ramp from garden  (1, 1) to garden (1, 2) and another ramp from garden (2, 2) to garden (1, 2), costing 2R = 4.  Otherwise, if we lower garden (1, 2), as shown on the right, then we will not need to build any ramps, so the total cost will be W = 3, which is the optimal cost for this instance. (a)  (3 points)  We will solve this problem using network flow.  For this part, you only need to describe a graph that has a maximum flow value equal to the optimal cost. Give a precise description of all nodes, edges, and capacities. Do not use lower bounds or node demands. (b)  (4 points)  Justify why the maximum flow in the graph you created has value equal to the minimum cost. (c)  (3 points)  Give an algorithm  (using the graph you constructed in part (a)) which returns which gardens should have their heights changed in order to minimize the total construction cost.  You should return an n × n array A where A[i,j] = 1 if garden  (i,j) needs to have its height changed and 0 otherwise. 8 The Grocery Store (10 points) 8.1.  (10 points)  With the social distancing guidelines, some grocery stores arelabelling aisle with a direction only allowing shoppers to “flow” down the aisle one way.  Signs throughout the store also remind shoppers to stay 6 feet apart at all times. A grocery chain would like your help figuring out their stores’ capacities during the crisis.  For each store, aisles end at an entrance, an exit, or an intersection (with other aisles). The chain can provide you with an estimate of how many people can pass down each aisle while observing social distancing, but they’re not sure how to calculate the overall store capacity from this data. (a)  (4 points)  Describe a flow network that can be solved using the Ford-Fulkerson method to determine how many shoppers can pass through the store with a single entrance, and a single exit in one hour (while observing social distancing requirements). (b)  (3 points)  Of course, it is not enough for shoppers to simply pass from the entrance to the exit.  At least one unique shopper must pass through each aisle intersection during an hour.  Otherwise, the featured products can’t be sold. How would you alter the graph from Part 8.1ato calculate whether the suggested number of shoppers is feasible given these additional requirements? (c)  (3 points)  The store manager thinks they understand the Ford-Fulkerson method, but only in a graph with a single source, single sink, capacity values for edges, and no node properties at all. Describe how to modify your solution from Part 8.1b so that an instance can be solved using only the basic Ford-Fulkerson method. Sample Intractability Questions 9    Speed Cams  (10 points) In your city, there has been a rash of traffic accidents due to speeding. You have been tasked by the city to help distribute speed cameras. The city would like to purchase high-tech speed cameras that, when place at an intersection, can monitor all the incident roads.  The city council would like to know what is the minimum number of cameras needed to monitor all the roads, where the city has q intersections and r distinct road segments,a portion of a road between two intersections. 9.1.  (1 point)  Give a brute-force algorithm to determine the minimum number of cameras? 9.2.  (1 point)  What is the worst-case runtime of your brute-force algorithm? 9.3.  (1 point)  Re-state the camera placement optimization problem as a decision problem. 9.4.  (7 points)  Prove that the decision version of the camera placement problem is in NP-Complete. 10 Office Hour Assignment Problem (10 points) As you are passing by the room CS 1304, you may have noticed that sometimes, there are too many TAs in the room.  To make sure that there are not too many TAs in the room at each time, but also that there is always someone, we want to divide the TAs into two groups:  ones that hold office hours and ones that do not.  But not everyone is available at every moment, so each TAs get to sign up on a timeslot, to indicate that they are available to hold office hour during that time. Formally, we define the problem OfficeHourAssignmentProblem (OHAP):  Suppose we are given n TAs and m timeslots, in which each timeslot has a list of TAs that can hold office hour during that time.  Can we choose a subset of TAs to assign to office hour duty, such that there is exactly one TA per timeslot? Example input: TAs: t1 , t2 , t3 , t4 , t5 Timeslot 1:  (t1 , t2 , t4 ) Timeslot 2:  (t2 , t3 ) Timeslot 3:  (t1 , t2 , t4 , t5 ) 10.1.  (2 points)  Provide a valid solution for the above example. 10.2.  (8 points)  After reflecting on the problem, Marc thinks that OHAP is NP-complete.  Show that OHAP is NP-complete. (a)  (2 points)  Show that OHAP isin NP. (b)  (6 points)  Show that OHAP is NP-Hard. 10.3.  (3 points (bonus))  After reflecting more, Marc has an idea that maybe there is a way to make this problem tractable. What can you say if there is a restriction that all timeslots have exactly 2 TAs signed up? What about 3?

$25.00 View

[SOLVED] Economics 142 Practice Questions II Python

Practice Questions II Economics 142 December 5, 2024 1. Choose the correct letter for each question. (a) When one good is sold to one of the N buyers with value v1 > v2 > ... > vN > 0... A. The buyer-optimal market clearing price is vN . B. The buyer-optimal market-clearing price is v2. C. The buyer-optimal market-clearing price is v1. D. The buyer-optimal market-clearing price and the seller-optimal market-clearing price is the same. (b) Consider an arbitrary bipartite network with N unit-sellers and N unit-buyers with heterogeneous values. They can trade only when they are connected. If we add one more buyer who is connected to every seller with value viN+1 > 0 for i = 1, ..., N, then.... A. All original N buyers must be weakly better off given the new buyer-optimal market clearing prices. B. Some buyer must be strictly worse off given the new buyer-optimal market clearing prices. C. The total values at the efficient assignment must increase weakly. D. The total values at the efficient assignment must decrease weakly. (c) Suppose that θ is either 1 and −1 with equal probability and let s ∈ {s1, ..., sm} be a signal about θ, which follows some conditional distribution Pr[s = si |θ = z], z = 1, −1. A. It is possible that the posterior belief Pr[θ = 1|s = si ] for θ = 1 is strictly larger than 0.5 for every i = 1, ..., m. B. It is possible that the posterior belief Pr[θ = 1|s = si ] is strictly strictly smaller than 0.5 for every i = 1, ..., m. C. If the posterior belief Pr[θ = 1|s = si ] is strictly larger than 0.5 for some si , then it must be strictly smaller than 0.5 given some other sj ≠ si . D. The expected posterior belief E[Pr[θ = 1|s = si ]] = P m i=1 Pr[θ = 1|s = si ] Pr[s = si ] can be be different from 0.5. (d) Consider a star network with n + 1 nodes. Assume that each node i observes a noisy signal xi(0) = θ + ϵi of some hidden state θ ∈ R, where ϵi is i.i.d. noise with mean 0. Let 0 be the center node. Assume that every node updates its x by taking the averages of x of its own and its neightbors (x0(t + 1) = n+1/Pni=0xi(t) for the center node and xi(t + 1) = 2/x0(t)+xi(t) for other i = 0). Let xn(∞) be the consensus that is reached as t → ∞. A. Given each θ, xn(∞) converges to some number as n → ∞ and may be biased (i.e. limn→∞ xn(∞) ≠ θ). B. Given each θ, xn(∞) converges to θ. C. Given each θ, xn(∞) is random even as n → ∞ and may be biased (i.e. E[limn→∞ xn(∞)] ≠ θ). D. Given each θ, xn(∞) is random even as n → ∞ and is unbiased (i.e. E[limn→∞ xn(∞)] = θ). 2. Various types of memberships for some subscription service are on sale. Suppose that currently there is only one available slot of a special mem-bership with service level xs, then there are two slots for regular member-ships of service level xr ∈ (0, xs). Suppose that three people j = 1, 2, 3 are interested in these three memberships. Assume that j values service x by θjx, where θ1 > θ2 > θ3 > 0. Answer the following questions. (a) What is the most efficient assignment/allocation of the three mem-berships to these three people? (b) Find the smallest (i.e. buyer-optimal) market-clearing prices. (c) Find the largest (i.e. seller-optimal) market-clearing prices. (d) Suppose that one regular membership is replaced with a upgraded membership“regular+”. The service xr+ for a regular+ member-ship is between xr and xs. Find the buyer-optimal market-clearing prices and the seller-optimal market clearing prices and compare them to your answer for (c). (We assume that one regular mem-bership is withdrawn so that there are three slots of memberships. As an exercise, do the same question assuming that two regular memberships are still available (so there are four membership slots available)). 3. Consider the model of observational learning where people decide whether to adopt a new technology or not sequentially. Each person decides to adopt a new strategy or stick to the old technology one by one after observing some information about the new technology and ob-serving the actions of the preceding people. There are two possible states: the new technology is pathbreaking (θ = P) with probability p or a failure (θ = F) with probability 1 − p. Each person’s pay-off from adopting a new technology is v + 80 if the state is P and v − 120 if the state is F, where v is the payoff from sticking to the old technology. Each person i observes a (independent and identically distributed) signal si ∈ {pb, f}, which is correct with probability 2/3 (i.e. Pr[si = p|θ = P] = Pr[si = f|θ = F] = 2/3). (a) If the first person observes s1 = f, what is her posterior belief for θ = P and θ = F? (b) For some range of initial belief p, everyone ignores her own signal and chooses the same action. Characterize such range of p. (c) Suppose that p = 1/2. What is the probability that the tth person for every t ≥ 3 choose the same action independent of their own information? (d) When p = 1/2, what is the probability that a sequence of people converge to choose the same bu a wrong choice?

$25.00 View

[SOLVED] ACF301 Coursework 2024-25 Matlab

ACF301 – Coursework 2024-25 Advance information Please read this document carefully. The coursework forms 25% of the marks for the assessment of this module and comprises of an individual test based on the case study set out in this document. This test takes place starting at 9am (UK time) Wednesday 11th December 2024 (Week 10). Coursework instructions · The test will take place online through Moodle. · You can access the test at any time on Wednesday 11th December 2024 from 9am onwards and the submission folder will remain open until 5pm (UK time). · You are recommended to spend no more than 60-90 minutes completing this test. There is no time limit on the test. · The coursework test is based on the accounting issues which arise from the scenario set out in the advance information in this document. You will be provided further impact information and the requirements on Wednesday 11th December 2024 time of this test. · You may prepare for the test in study groups or on your own, however you must complete the test itself on your own. · The test is open book. · You should prepare your answer to this test using Microsoft Word and upload to Moodle. Answers to numerical questions may be handwritten however you may only upload one document to moodle. Please note: you will not be required to produce a full set of consolidated financial statements. Background Elektrik plc Elektrik plc (Elektrik) is a manufacturer of vehicle batteries used in the production of electric cars and vans. All transactions are in £ sterling. Historically Elektrik had taken a cautious approach to growth. A new CEO was appointed on 1 January 2023. The new CEO implemented a more aggressive growth strategy which is being delivered through the acquisition of shares in companies. Elektrik has a year end of 30 June. Your role You are a recent graduate of Lancaster University, employed as the Financial Accountant at Elektrik. You have received the following e-mail from the Finance Director: To: Financial Accountant From: Finance Director When the new CEO joined Elektric in January 2023, she was keen that Elektric start to grow more aggressively to take advantage of the increasingly profitable market for vehicle batteries. On 1 October 2023, Elektric bought 3 million ordinary shares of Sparks Ltd (Sparks), a supplier. Due to the strategic fit with our company, Elektric paid a substantial premium to gain control over Sparks. A small number of other investors continue to hold shares in Sparks. The acquisition of Sparks means that Elektrik will prepare consolidated financial statements for the first time. I am not sure how to calculate some of the figures for inclusion in the consolidated statement of financial position. I am also unsure about some of the requirements of IFRS3 and IFRS10 and would like your help. Elektrik is also considering a further investment opportunity in Wiring Ltd (Wiring) . I have provided some information about the investment in Sparks and the further investment opportunity in Wiring in Exhibit 1. An extract from the draft consolidated financial statements for the Elektrik group at 30 June 2024, along with an extract of the accounting policy note are provided in Exhibit 2. The directors receive a bonus based on the performance. Details of the bonus arrangements are provided in Exhibit 3. Further information will be available on Wednesday 11th December together with the tasks you must perform. Exhibit 1: Investment in Sparks and potential investment in Wiring Investment in Sparks On 1 October 2023, Elektrik bought 3 million ordinary shares in Sparks. The acquisition resulted in Elektrik having control over Sparks. The acquisition of shares was paid for as follows: Ø An immediate cash payment of £3.20 per share acquired. Ø A 1 for 6 share exchange. Ø A future cash payment, payable on 30 September 2028. Ø A future cash payment, payable only if an application for a patent of Sparks is successful. The financial statements of Sparks also show the following information relevant to the purchase: Ø Sparks has a number of intangible assets. Ø The notes to the financial statements show a contingent liability. Elektrik chose to account for the non-controlling interest in Sparks using the fair value method. Management judgement was applied to calculate a control premium and determine the fair value per share held by the non-controlling interest. Potential investment opportunity in Wiring during the year ending 30 June 2025 (the next financial year) Elektrik is currently in negotiations to buy 40% of the ordinary share capital of Wiring from an existing shareholder. Wiring is a major supplier of raw materials used by Elektrik in the manufacture of batteries. The other 60% of the share capital of Wiring is currently owned by a single investor, Abacus plc (Abacus). Abacus would like Elektrik’s input into key decisions made to improve the profits of the company. As part of the investment, Elektrik would therefore be able to appoint a number of directors. Elektrik is also in negotiations to acquire some convertible debt securities which would be converted into new ordinary shares. Exhibit 2: Draft consolidated financial statements extract and policy note extract Draft consolidated financial statements (extract) Consolidated statement of profit or loss for the year ended 30 June (extract) 2024 £’000 Profit before tax 86,200 Profit attributable to: Equity holders of the parent 80,200 Non-controlling interest 6,000 Consolidated statement of financial position at 30 June 2024 (extract) 2024 £’000 Equity share capital (25p ordinary shares) 9,000 Accounting policy note (Extract) Basis of consolidation The consolidated financial statements incorporate the financial statements of Elektrik plc and subsidiaries controlled by Elektrik plc (the “Group”). Elektrik plc has arrangements over which it has control and which qualify as subsidiary companies. Acquisitions of subsidiaries are accounted for using the acquisition method. When the Group completes a business combination, the fair values of the identifiable assets acquired and liabilities assumed are measured at fair value. The consideration transferred is measured at fair value and includes the fair value of any contingent consideration. Any non-controlling interest in an acquisition is initially measured either at fair value or at the non-controlling shareholders’ proportion of net assets. The choice of measurement basis is made on an acquisition-by-acquisition basis. Transactions and balances between subsidiaries are eliminated. Unrealised profits on transactions between group companies are eliminated. Joint ventures and associates Where the Group has the ability to exercise joint control over entities, they are accounted for as joint ventures. Where the Group has the ability to exercise significant influence over entities, they are accounted for as associates. For joint ventures and associates, the Group recognises its interest in the joint venture or associate as an investment in joint ventures or associates. The group uses the equity method of accounting. Exhibit 3: Bonus arrangements The directors receive a bonus based on consolidated profit before tax attributable to the equity holders of the parent. The bonus target is set using earnings per share based on amounts attributable to the equity holders of the parent. Earnings per share attributable to equity holders of the parent Bonus >£2.22 per share 1.5% of profit before tax attributable to the equity holders of the parent £2.12 - £2.22 per share 0.7% of profit before tax attributable to the equity holders of the parent

$25.00 View

[SOLVED] FBE 506 Quantitative Methods in Finance Assignment 1

FBE 506 Quantitative Methods in Finance Assignment # 1 1. Solve the following equations: a. x2 + 2x - 8 = 0. b. x2 – 9 = 0 c. x3 - x2 + 4x - 4 = 0. d. x5 + 3x2 – 8 = 0. 2. Future Value Problem: Find the compounded value of $100 deposited at a rate of 6% for 5 years, if the interest is compounded annually, quarterly, monthly, daily and continuously. Note: For a discrete compounding, the formula is S = A(1 + r/n )nt, where S is the compounded value, A is the initial investment, r is the interest rate, n is the number of time the interest is compounded a year, and t is the number of years. If the interest is compounded continuously, the compounding formula is S = Aert. 3. Present Value Problem: An investment is expected to have a return of $22000 at the end of the first year, $28500 at the end of the second year, $32000, at the end of the third year, $18000 at the end of the fourth year, and $12000 at the end of the fifth year. At the end of the fifth year the business is expected to have a market value of $52000. What is the present value of the future returns if the interest rate is 6%? What is the present value of the investment? Note: The present value of the expected future returns for the next n years is PV = R1/(1+ r)1+ R2/(1+r)2+ R3/(1+r)3 + ...... +Rn/(1+r)n, where PV is the present value, Ri is the return in the ith year, r is the rate of return or interest rate, and n is the number of years. 4. Net Present Value Problem: Net present value, NPV is the difference between the value of the initial investment, Io and the present value of investment, PVI. If NPV > 0, the investment is profitable. If NPV < 0, the investment will have a loss. Suppose an investment is expected to have returns of $22000, $28500, $32000, $18000, and $12000 at the end of each year for the next five years. At the end of the fifth year, the business is expected to have a market value of MV = $52000. Given that the initial investment is $120000, what is the net present value of the investment if the discount rate is 6%? 5. Perpetuity: A Perpetuity is a security that yields a stream of annual payments at an annual rate of r forever. The value of the perpetuities is decided by the sum of the present value of the stream of payments for infinite number of years. That is, PV = sum(R/(1+r)t) when t =∞. Here, R is the annual payments and r is the discount factor. Suppose a perpetuity yields an annual payments of $1 forever. What is the present value of the perpetuity if discount rate is 5%? 6. Internal Rate of Return: Internal rate of return is the interest rate at which NPV = 0 or PVI = Io. a. For the present value problem in question 4 find the internal rate of return. b. Find the rate of return on a $24,000 investment with an annual return of $4,500 for five years and a scrap value of $2,500 at the end of the fifth year.      

$25.00 View

[SOLVED] UFMF4X-15-M Robotic Fundamentals Matlab

UFMF4X-15-M Robotic Fundamentals Coursework: Serial and Parallel Robot  Kinematics This  document  explains   requirements  for  the  assessed  coursework  for  the   UFMF4X-15-M   Robotic Fundamentals module. The module is assessed in one report that is worth 50% of your overall mark. The assessment will be based on a series of simulated experiments using a series and a parallel manipulator. The coursework also includes suggestions of topics you may want to work on in order to demonstrate a fuller  understanding  of  the  more  advanced  parts  and  attain  a  higher  mark.  This  additional  work  is expressed here in an open-ended way, as appropriate for Masters level  study. The deadline for submission is 16th of January 2025,Thursday, 2pm on UWE Blackboard. Both members of each/every group needs to make a submission (same coppy). Dont forget to include UWE student number of each member. Robotics Toolbox of MATLAB is NOT allowed. PART I: A. From material covered during lectures, lab exercises and examples, complete the following tasks: 1)   Derive a DH representation of forward kinematics for the Lynxmotion arm. Use MATLAB, lecture material and further reading. Include all your investigations and report this. 2)   Analyse the workspace of the centre of the wrist (5th joint) when each preceding joint moves through its range of motion and plot the 2D and 3D views of the  workspace. 3)   Derive the inverse kinematics model for the manipulator (analytical solution). B.  Complete the following: 1)   Plan a task in MATLAB with at least 5 positions. This process should give you at least 5 sets of Cartesian coordinates specifying the end-effector position and orientation in 3D  space. 2)   Solve the Inverse Kinematics for these positions in 3D space and obtain sets of Joint Coordinates. Create an appropriate plot/animation in MATLAB for the motion of the  robot. 3)   Implement 3 different trajectories between the Cartesian Points identified above and create an appropriate plot to demonstrate them): a.    Implement a free motion between the points b.   Implement a straight line trajectory between the points c.    Set an obstacle between any two points (e.g. a cylinder between point 3 and 4) and implement an object avoidance trajectory. PART II: consider a planar parallel robot used in a surgical procedure to position a needle above the patient, see Figure 1 . Figure 1 . Needle positioning parallel Robot. The parallel robot consists of a fixed Base plate, a Moving platform , six passive revolute joints (Mi and ppi where i=1:3) and three active revolute joints (PBi where i=1:3) . The ith strut of the robot consists therefore of three joints that are subdivided in the upper section SA, and the lower section L. For further information to the robot see its kinematic model in Figure 2 . Develop a kinematic simulation of the parallel robot in MATLAB to: 1)   solve and implement parallel robot Inverse kinematics. calculate the joint coordinates i where i=1:3 from the cartesian parameters of the platform ' S Centre {c} (where the needle is based) . These parameters are the (xcs Yc) coordinates and the orientation of the platform (a) . plot the kinematic model  in two different positions. changing the cartesian  input parameters should adapt each leg to the new cartesian position. An example plot is shown in Figure 3 . 2)   plot the  parallel robots workspace for a given orientation a. This is crucial for the mechanism synthesis analysis. Figure 2: planar parallel Robot kinematic Model Figure 3: simulated robot motion PART III: TO ATTAIN A HIGHER MARK CARRY OUT THE FOLLOWING: choose a relevant topic that is not mentioned here, but relevant to the coursework subject domain, and carry out theoretical or experimental work on that topic. For example, this work could be analysing alternative  methods  of inverse  kinematics  calculation  such  as  motor  babbling,  optimisation,  screw theory, etc. , investigating methods and algorithms that can be used to avoid problems when operating close to a singularity in the robot's workspace etc. or something else. Discuss your chosen topic with the module tutors before you start. Reporting Details You have to write a report, using not more than 3000 words to describe your investigations and results. You need to: 1)   Demonstrate that you understand the theory behind the approaches you use to solve a problem. 2)   critical assessment and analysis of the relative merits of the approaches you have used 3)   show  that  you  have  appreciation  of  issues  and  principles  used  to  establish  safe  operation  of manipulators in the human environment 4)   present your conclusions. 5)   provide any references using the Harvard system 6)   provide any code you have written in an appendix AND the actual . m files (Matlab) as attachments.

$25.00 View

[SOLVED] ECON3102 Tutorial 04 - Week 5 Prolog

ECON3102 Tutorial 04 - Week 5 Question 1 Suppose households solve the following two-period consumption-saving problem with taxes: maxc1,c2 u(c1) + βu(c2) Subject to: a1 = a0 + y1 − τ1 − c1 c2 = y2 − τ2 + (1 + r)a1 with u(c) = 1 − σ/c1 − σ . Notice that a0 is the initial wealth and τ represents the lump sum taxes. (a) Calculate the optimal values of the c1, c2, a. (b) How does y1/c1 depend on y2? What would happen if households become optimistic about the future? (c) How does y1/c1 depend on a0? Interpret. (d) How does y1/c1 depend on β? Interpret. (e)Suppose y2 = τ1 = τ2 = 0. Compute ∂r/∂c1. How does the answer depend on σ? Interpret. Question 2 Suppose households solve the following two-period consumption-saving problem with taxes: maxc1,c2 u(c1) + βu(c2) Subject to: a1 = a0 + y1 − τ1 − c1 c2 = y2 − τ2 + (1 + r)a1 with u(c) = 1 − σ/c1 − σ . Notice that a0 is the initial wealth and τ represents the lump sum taxes. Assume that τ1 = τ2 = a0 = 0, β = 1, r = 0. (a) Solve for c1 as function of y1 and y2. (b) Suppose the incomes of each households are given as follows:                                y1                 y2 Household A              2                   4 Household B              6                   4 Compute c1 and c2 for each of the households. (c) Suppose that we are are trying yo decide what is a reasonable model for consumption behavior. and only has data for period 1. Is the data supportive of the Keynesian view of consumption function? Explain. (d) Now we can access the data for period 2. Is the data supportive of the Keynesian view of consumption function? Explain. Question 3 Suppose households solve the following two-period consumption-saving problem with taxes: maxc1,c2 u(c1) + βu(c2) Subject to: a1 = a0 + y1 − τ1 − c1 c2 = y2 − τ2 + (1 + r)a1 a1 ≥ −b with u(c) = 1 − σ/c1 − σ . Notice that a0 is the initial wealth and τ represents the lump sum taxes. (a) What does a1 ≥ −b mean? What does b represent? Assume that a0 = 0. (b) Plot the budget constraint along with the constraint a1 ≥ −b. (c) Solve for c1, c2, a. (d) Show that constraint a1 ≥ −b is more likely to be binding if y2 - τ2 is high, y1 - τ1 is low, and b is low. Interpret each of these conditions. (e) Suppose that the government decides lowering τ1 by ∆ and increasing τ2 by (1 + r)∆. How does c1 respond to this change if we start from a situation where constraint a1 ≥ −b is not binding. (f) How does c1 respond to this change if we start from a situation where constraint a1 ≥ −b is binding.

$25.00 View

[SOLVED] CS152 Lab 4 The Random Package and matplotlib Python

CS152 Lab 4: The Random Package and matplotlib The goal of this week's project is to get further experience with modules and hierarchical design. In the lab, we'll work with the Python random package and some basic capabilities of the plotting package matplotlib. And then for the project … .Penguins!!! Lab Tasks If you have not already done so, create a new Lab04 folder. L1. Creating Random Numbers In Python, we create random numbers using the random package. Start a new file, rand.py, and put your standard file header at the top. Then write: import random A. Write a function that generates N random numbers between 0 and 1 Define a function  gen_random()that has one argument N which is the number of random numbers to create. The first step is to assign to a variable (e.g. numbers = []) an empty list. The second step is to start a counted-for loop that executes N times. Each time through the loop, append to your numbers list the result of calling the function random.random(). The function random.random() returns a randomly generated floating-point number between 0 and 1. It is one of the useful functions in the random package. Finally, the function should return the list of random numbers. B. Test the function Define a test function. The test function should assign to a variable the result of calling gen_random()with an argument of 10. It should then use a loop to print out the 10 numbers. Run your code and make sure it works properly. L2. Write a function that generates N random integers between a lower bound and an upper bound Define a function  genNintegers () that has three arguments: the number of points to create, a lower bound, and an upper bound. All three arguments should be integers. In the function, assign to a variable (e.g. numbers = []) an empty list. Loop N times and each time through the loop append the result of calling random.randint(lowerBound,upperBound)to your numbers list. The function random.randint(L,B) returns a randomly generated number between L, B, inclusive. Return the number list. Add code to your test function to call and then print out the result of calling genN integers () with arguments of 10, -10, and 10. Make sure it produces expected values. L3. Write a function that generates N random values drawn from a normal/Gaussian distribution Define a function genNnormal () that has three arguments: the number of points to create, a mean, and a standard deviation. The second and third arguments can be integers or floating   point values. In the function, assign to a variable (e.g. numbers) an empty list. Loop by the number of points to create, and each time through the loop append the result of calling random.gauss ( mean, std ) to your numbers list. The function random.gauss ( mean, std ) returns a randomly generated number drawn from a normal or Gaussian distribution with the given mean and standard deviation. Return the number list. Add code to your test function to call and then print out the result of calling genNnormal () with arguments of 10, 0, and 0.2. Make sure it produces expected values. L4. Installing and Creating plots with matplotlib NOTE: Navigate to the install instructions matplotlib installation page. You will need to open up a regular terminal (NOT a Python interactive shell) for installing matplotlib package for Python. For guidance on installing on other platforms, see the matplotlib installation page. As well as a GeeksforGeeks tutorial: Pyplot in Matplotlib Continuing with the same file, add a new import statement at the top. import matplotlib.pyplot as plt Now plot some of the numbers you created in the prior exercise. In the test function, you should have three variables that all contain random numbers. One holds values between 0 and 1 (call it x), one holds values between -10 and 10 (call it y), and one holds values distributed around zero (call it z). The following walks through the process of plotting x versus z. 1.  At the end of the test function, call the function plt.plot() with the arguments x, z, and the string 'o' (‘o’ means the points will be represented as circles). The lists x and z must have the same number of elements. 2.  After the call to plot, call the function plt.show (). Then run your code. It should create a simple plot. 3.  After the call to plot and before the call to show, you can modify aspects of the plot. For example, plt.title () sets the title to whatever string you pass in as an argument. 4.   Set the X axis label using plt.xlabel () with "X" as the argument. 5.   Set the Y axis label using plt.ylabel () with "Y" as the argument. Now you know how to generate simple plots with an x-label, a y-label, and a title. Look at the matplotlib documentation for PyPlot for more information on how to create more complex graphs and charts. When you are done with the lab exercises, please begin the project.

$25.00 View

[SOLVED] COMP213 Final Project Python

COMP213 Final Project In this project, you will implement a command-line interpreter or shell. The shell should operate in this basic way: when you type in a command (in response to its prompt), the shell creates a child process that executes the command you entered and then prompts for more user input when it has finished. The shells you implement will be similar to, but much simpler than, the one you run every day in Unix. You can  find  out which  shell you  are running by typing  echo $SHELL at a prompt. You may then wish to look at the man pages for sh or the shell you  are  running   (more  likely  tcsh or  bash)  to   learn  more   about  all  of  the functionality that can be present. For this project, you do not need to implement much functionality;  but  you  will  need  to  be  able  to  handle  running  multiple  commands simultaneously. Your shell can be run in two ways: interactive and batch. In interactive mode, you will display a prompt (any string of your choosing), and the user of the shell will type in a command at the prompt. In batch mode, your shell is started by specifying a batch file on its command line; the batch file contains the list of commands that should be executed. In batch mode, you should not display a prompt. In batch mode, you should echo each line you read from the batch file back to the user before executing it; this will help you when you debug your shell (and us when we test your programs). In both interactive and batch mode, your shell stops accepting new commands when it sees the quit command on a line or reaches the end of the input stream (i.e., the end of the batch file or the user types 'Ctrl-D'). The shell should then exit after all running processes have terminated. Each line (of the batch file or typed at the prompt) may contain multiple commands separated with the  ; character. Each of the commands separated by a  ; should be run simultaneously, or concurrently. (Note that this is different behavior. than standard Linux shells which run these commands one at a time, in order.) The shell should not print the next prompt or take more input until all of these commands have finished executing (the wait() and/or waitpid() system  calls may be useful here). For example, the following lines are all valid and have reasonable commands specified: prompt> prompt> ls prompt> /bin/ls prompt> ls -l prompt> ls -l ; cat file prompt> ls -l ; cat file ; grep foo file2 For example, on the last line, the commands ls -l, cat file and grep foo file2 should all be running at the same time; as a result, you may see that their output is intermixed. To exit the shell, the user can type quit. This should just exit the shell and be done with it (the exit() system call will be useful here). Note that quit is a built-in shell command; it is not to be executed like other programs the user types in. If the "quit" command is on the same line with other commands, you should ensure that the other commands execute (and finish) before you exit your shell. These are all valid examples for quitting the shell. prompt> quit prompt> quit ; cat file prompt> cat file ; quit This project is not as hard as it may seem at first reading (or perhaps it doesn't seem that hard at all, which is good!); in fact, the code you write will be much smaller than this specification. Writing your shell in a simple manner is a matter of finding the relevant library routines  and  calling them properly. Your  finished programs will probably be under 200 lines, including comments. If you find that you are writing a lot of code, it probably means that you  are  doing  something wrong  and  should  take  a break  from hacking and instead think about what you are trying to do. Program Specifications Your program must be invoked exactly as follows: shell [batchFile] The command line arguments to your shell are to be interpreted as follows. batchFile:  an  optional  argument  (often  indicated  by  square  brackets  as above). If present, your shell will read each line of the batchFile for commands to be executed. If not present, your shell will run in interactive mode by printing a prompt to the user at stdout and reading the command from stdin. For example, if you run your program as shell /u/j/v/batchfile then your program will read commands from  /u/j/v/batchfile until it sees the quit command. Defensive programming is  an  important  concept  in  operating  systems:  an  OS  can't simply fail when it encounters an error; it must check all parameters before it trusts them. In general, there should be no circumstances in which your C program will core dump,  hang  indefinitely,   or  prematurely  terminate.  Therefore,  your  program  must respond  to  all  input  in  a  reasonable  manner;  by   "reasonable",  we  mean  print  an understandable error message and either continue processing or exit, depending upon the situation. You should consider the following situations as errors; in each case, your shell should print a message (to stderr) and exit gracefully: 1. An incorrect number of command line arguments to your shell program. 2. The batch file does not exist or cannot be opened. For the following situation, you should print a message to the user (stderr) and continue processing: A command does not exist or cannot be executed. Optionally,  to  make  coding  your  shell  easier,  you  may  print  an  error  message  and continue processing in the following situation: A very long command line (for this project, over 512 characters including the ‘ '). Your shell should also be able to handle the following scenarios, which are not errors (i.e., your shell should not print an error message): An empty command line. Extra white spaces within a command line. Batch file ends without quit command or user types 'Ctrl-D' as a command in interactive mode. In no case should any input or any command-line format cause your shell program to crash or to exit prematurely. You should think carefully about how you want to handle oddly formatted command lines (e.g., lines with no commands between a  ;). In these cases, you may choose to print a warning message and/or execute some subset of the commands. However, in all cases, your shell should continue to execute! Example problematic input lines that your shell should handle gracefully: prompt> ; cat file ; grep foo file2 prompt> cat file ; ; grep foo file2 prompt> cat file ; ls -l ;  prompt> cat file ;;;; ls -l prompt> ;; ls -l prompt> ;

$25.00 View

[SOLVED] MU5022 Research Practices

MU5022 Research Practices Research Project (50%) Initial proposal due (via email) Friday week 14 (Nov 1 @ 23:59) Final work due Friday week 20 (13 December 2023 @ 23:59) Assessment Instructions This assessment invites you to undertake an independent research project on a topic from the field/s of community music, composition, music education, musicology, performance, and sonic arts. This project can take one of the following formats: •    3,000-word essay (submitted via Turnitin) •    15-minute lecture recital (recording and slides submitted via MyAberdeen) •    7-minute composition (score and, if feasible, audio, submitted via MyAberdeen) or •    A combination/adaptation agreed with the course coordinator. You may have +/- 10% either way in the word count/ duration of the work. Your project will be marked in accordance with the assessment criteria in the MMus Programme Handbook. Regardless of the format you choose, the purpose of this assessment is to demonstrate your ability to engage in critical and reflective thinking on your chosen topic. To this end, you are required to consider the ways in which your project can contribute to further understanding of existing ideas, debates and/ or approaches in your chosen field. To this end: o For creative projects: You will need to provide (of approximately 300 words) a rationale and reflection (i.e., what, why, how, and what did you learn?) on the cre5ation and execution of your creative work. This will include demonstrating whose ideas and techniques you are drawing on/ exploring in your project. Please also note, for such projects, you will also be required to provide a written introduction/ overview of the creative pieces you submit for final assessment. o For written based projects: Your essay should engage in ‘ big picture’ critical reflection and the consideration of multiple perspectives and ideas on your topic. It will not be enough to simply recite and rehash existing materials. You will be required to demonstrate original thinking, analysis, and reflection in your essay and show that you are able to contribute to the ongoing discussion and debates in your  chosen field/ on your chosen topic. We will spend time in Workshop Four (Week 11) devising your project. You will be required to email to the course coordinator a short blurb (of no more than 250 words) of what your proposed project will be (as relevant: the topic and its associated focus / context and rationale/ expected output/s) by the end of Week 13 (October 28). This will assist in ensuring your project is feasible in its focus and allow for additional guidance as you move forward through the term. Devising your project In devising the project consider the following: •    Your area/s of interest within the six fields outlined above; •    Your creative skills ability and interests; •    The area of interest you may wish to pursue as you continue with your practice/ studies; •    How the project may sit within a portfolio of your creative work or support you in future advanced studies (where and as applicable) Assessment The assessment criteria relevant to your project format (composition, performance and/ or written work) will be applied per the rubrics in the MMus Handbook. This is addition to the requirements outline above in relation to creative and reflective thinking, and the furthering of existing ideas, debates and/ or approaches in your chosen field.

$25.00 View

[SOLVED] CS152 Project 3 Calculating Thermoclines Python

CS152 Project 3: Calculating Thermoclines The first task of this project is to build a library of functions that can be reused by other programs. In particular, we are going to write a set of functions that can calculate statistics for us. The second task will involve computing the depth of the thermocline on Great Pond and plotting it for the month of July. The thermocline is the depth at which there is the largest difference in water density, with a layer of denser water below and a layer of less dense water above. Outline of Lab/Project 3 Program Development Lab: Developing and working with libraries A.  Write a module that contains common statistics named stats.py B. Use the library functions in analyze.py using command line arguments Project:  Calculating thermoclines A. Write a function that converts water temperatures into water densities B. Write a function that computes the depth of the maximum change in density C. Write a top-level function that reads in the data file and guides the computation. Setup your workspace for the project 1. Create a Project 3 folder in a conveniently accessible location 2. Download GoldieJuly2019.csv, testDensity.py and testThermocline.py 3. Copy stats.py and analyze.py from lab folder into the Project03 folder Project Tasks (T1-T3) T1. Write your library of useful statistical functions In the stats.py file you started in the lab, add the following four (4) functions. Each function should have a single parameter, which should be a list of numbers. The functions should loop over the numbers in the list, compute the given statistic, and return it. 1.  mean(data) - computes the mean of the list of data. 2.  min(data) - computes the min of the list of data. 3.  max(data) - computes the max of the list of data. 4.  variance(data) - computes the variance of the list of data. As you probably recall, to compute the mean you sum all the values in the list and divide by the number of items. Notice that stats.py already has a function to do the summing up. Instead of reinventing the wheel why not have the mean function call the sum function you already wrote? This is an example of code reuse. The number of items in the list is the same as the length of the list. In this case, do use the Python built-in function len() to determine how many items are in the list. This is another example of code reuse. Write functions to calculate the min and max of the items in the list. Do NOT use built-in functions to do this. Finally, to calculate the variance you can use the following formula: The algorithm for this formula says that you will sum up all of the squared differences between   each list item and the mean of the items and divide by the total number of items minus 1. There is a mathematical reason why you divide by N-1 and not N. Run stats.py and make sure that it is working correctly. Required Output 1: Include a description in your report how you determined your stats functions were working correctly. (e.g., take a screenshot of the output of calling functions with a simple list(s) of values and display the result) T2. Write a program to compute statistics of a column of data Using your analyze.py file from the lab, update it so that it computes the sum, mean, variance, max, and min statistics. Recall that we are using command line arguments to obtain the file name and column number from the user. Print the statistics to the terminal. Calling analyze.py with the hurricanes.csv file and column 1 as command line arguments should produce the following statistics: sum : 103.00 mean: 7.36 var : 12.55 min : 2.00 max : 15.00 Required Output 2: Demonstrate that your program works with a column from GoldieJuly2019.csv data file provided with this project. One way to do this is to insert a function in the cell at the bottom of a column to calculate a statistic. For example, placing =Average(B2:B2977) in the cell below any column will calculate the average of all the cells above it. For column 2 this would give a value of 10.795. Compare this value with your stats mean function. Include a screenshot of the printed output of your program and a screenshot of the data files calculation as evidence that your library function works. T3. Calculate the thermocline depth in Great Pond for July 2019 The next task will be to write a program that computes the depth of the thermocline on Great Pond for each day in July 2019. The thermocline is the depth at which the water density changes most quickly, creating a layer of colder, denser water below a layer of warmer water that tends not to mix. To do this you will write three functions: 1. a function that converts water temperatures into water densities 2. a function that computes the depth of the maximum change in density 3. a top-level function that reads in the data file and guides the computation. T3a. Setup Create a new file, thermocline.py. Put your name, date, and class at the top, along with a comment indicating what the program will do (compute the thermocline). T3b. Convert temperatures to densities Write a function called density that takes in one parameter, temps, that is a list of temperatures. The function should first create a new empty list to hold density values, typically designated with the Greek letter rho. Then, it should loop over the temps list and for each temperature value compute the density using the following equation: rho = 1000 * (1 - (t + 288.9414) * (t - 3.9863)**2 / (508929.2*(t + 68.12963))) It should then append each computed density to a list that will be returned to the caller. Test your function using the included testDensity.py file. It should print out the following if your density function is working correctly. 24.47 -> 997.21 23.95 -> 997.34 24.41 -> 997.22 23.81 -> 997.37 19.92 -> 998.25 16.88 -> 998.82 14.06 -> 999.26 11.56 -> 999.57 9.82 -> 999.74 9.13 -> 999.80 8.82 -> 999.82 T3c. Compute the derivative of the densities Note: If you have not taken Univariate Calculus yet a derivative is just a slope at a point. Slope is defined as the rise of the function over the run. So in this program we are going to calculate   the change in density as the depth increases and locate the depth where the maximum change occurs. Add a function named thermocline_depth to thermocline.py that computes the derivative of density with respect to depth, or how fast the density is changing as you get deeper. The function will take in two lists: one is the set of temperatures, the other is the set of corresponding depths. The function will return one value: the depth of the maximum change in density. The  algorithm below gives the function. def thermocline_depth( temps, depths ): # assign to rhos the result of calling the density function with temps as the argument # create an empty list named drho_dz # loop for one less than the length of rhos # append to drho_dz the quantity rhos[i+1] minus rhos[i] divided by the quantity depths[i+1] minus depths[i] # sanity check (optional): print out temps[i], rhos[i], and drho_dz[i] for visual inspection # assign to max_drho_dz the value -1.0 # assign the maxindex the value -1 # loop for the length of drho_dz (loop variable i) # if drho_dz[i] is greater than max_drho_dz # assign to max_drho_dz the value drho_dz[i] # assign to maxindex the value i # assign to thermoDepth the average of depths[maxindex] and depths[maxindex+1] return thermoDepth Test your thermocline_depth function using the included testThermocline.py file. It should output a depth of 6.0m (note that the maximum change of 0.44 at that depth -- you do not need to report this, but if you run into problems, knowing what the maximum change is supposed to   be can help you debug your code). T3d. Compute the thermocline for each day in July The final step is to write the main function that reads in data from the included GoldieJuly2019 file, extracts all of the temperature fields in order, computes the thermocline_depth and prints  the day and thermocline_depth value. The file includes all of the data fields for the month of July and a single header line. Note: Pay particular attention to the indices. The field indices for the depths (in meters) [1, 3, 5, 7, 9, 11, 13, 15] are located at field numbers  [10, 11, 16, 17, 15, 14, 13, 12] in the GoldieJuly2019 file. You may want to double-check the field numbers before starting by looking at the header line. The algorithm given below is not strictly line by line. Each comment will correspond to one or more lines of Python. def main(): # these are the fields corresponding to the temperatures in order by depth # note they use 0-indexing fields = [10, 11, 16, 17, 15, 14, 13, 12] # these are the depth values for each temperature measurement depths = [ 1, 3, 5, 7, 9, 11, 13, 15 ] # open the data file and read past the header line # assign to day the value 0 # for each line in the file # split the line on commas and assign it to words # if the time is about noon (12:03:00 PM) # add one to the day variable # assign to temps the empty list # loop over the number of items in depths (loop variable i) # append to temps the result of casting words[ fields[i] ] to a float # assign to thermo_depth the result of calling thermocline_depth with temps and depths as arguments # print (or save to a file) the day of the month and thermo_depth separated by a comma if __name__ == "__main__": main() Required Output 3: Run your program and create a plot of the results with day on the x-axis and thermocline depth on the y-axis. Include this plot in your report Reflection Questions: Required Element  4: Follow-up Questions: 1.  Explain what is meant by the term “code reuse” and give an example? 2.   Explain what is meant by the term “modular design” and give an example? 3.  Perform. a Google search for a woman statistician and give a one sentence description of a contribution they made. Extensions Each assignment will have a set of suggested extensions. The required tasks constitute about 85% of the assignment, and if you do only the required tasks and do them well you will earn a B+. To earn a higher grade, you need to undertake one or more extensions. The difficulty and  quality of the extension or extensions will determine your final grade for the assignment. One complex extension, done well, or 2-3 smaller extensions are typical. ● Write functions in your stats.py file to compute more types of statistics. ● Use your code to compute statistics on a data set of your own choosing. ● Compare different times or time periods in the Goldie data. ●   Add more command-line control options, such as specifying what time of day to compute the thermocline. ●   Explore how the thermocline changes and why? What are the min and max thermocline values for July? What if you graph wind direction and thermocline together, is there a relationship? ● Automate the process of making a graph from data( Hint: Matplotlib) Submit your code Turn in your code (all files ending with .py) by zipping the file and uploading it to Google Classroom. When submitting your code, double check the following. 1.   Is your name at the top of each Python file? 2.   Does every function have a docstring (‘’’ ‘’’) specifying what it does? 3.   Is your Lab 04 folder in your Project 04 folder? 4.   Have you checked to make sure you have included all required elements and outputs in your project report? 5.   If you have done an Extension, have you included this information in your report under the Extension heading? Even if you have not done any extensions, include a section in your report where you state this. 6.   Have you acknowledged any help you may have received from classmates, your instructor, the TAs, or outside sources (internet, books, videos, etc.)? If you received no help at all, have you indicated that under the Sources heading of the report? Write your project report Reports are not included in the compressed file! Please don’t make the graders hunt for your report. You can write your report in any word processor you like and submit a PDF document in the Google Classroom assignment folder. Or just use a Google Document format. Review the Writeup Guidelines document. Your intended audience for your report is your peers who are not taking CS classes. From week to week, you can assume your audience has read your prior reports. Your goal should be to explain to peers what you accomplished in the project and to give them a sense of how you did it. The following is a list and description of the mandatory sections you must include in your report. Do not include the descriptions in your report, but use them as a guide in writing your report. ● Abstract A summary of the project, in your own words. This should be no more than a few sentences. Give the reader context and identify the key purpose of the assignment. An abstract should define the project's key lecture concepts in your own words for a general, non-CS audience. It should also describe the program's context and output, highlighting a couple of important algorithmic and/or scientific details. Writing an effective abstract is an important skill. Consider the following questions while writing it. ○   Does it describe the CS concepts of the project (e.g. writing well-organized and efficient code)? ○   Does it describe the specific project application (e.g. generating data)? ○   Does it describe your solution and how it was developed (e.g. what code did you write)? ○   Does it describe the results or outputs (e.g. did your code work as expected and what did the results tell you)? ○ Is it concise? ○   Are all of the terms well-defined? ○   Does it read logically and in the proper order? ● Methods The method section should describe in clear sentences (without pasting any code) at least one example of your own computational thinking that helped you complete your project. This could involve illustrating how a key lecture concept was applied to creating an image, how you solved a challenging problem, or explaining an algorithmic feature that is essential to your program as well as why it is so essential. The explanation should be suitable for a general audience who  does not know Python. ● Results Present your results in a clear manner using human-friendly images or graphs labeled with captions and interpreted for a general audience such as your peers not in the course. Explain, for a general, non-CS audience, what your output means and whether it makes sense. ● Reflection and Follow-up questions Draw connections between lecture concepts utilized in this project and real-world problems that interest you. How else could these concepts apply to our everyday lives? What are some specific things you had to learn or discover in order to complete the project? Look for a set of short answer questions in this section of the report template. ● Extensions (Required even if you did not do any) A description of any extensions you undertook, including text output or images demonstrating those extensions. If you added any modules, functions, or other design components, note their structure and the algorithms you used. ● References/Acknowledgements (Required even if there are none) Identify your collaborators, including TAs and professors. Include in that list anyone whose code you may have seen, such as those of friends who have taken the course in a previous semester. Cite any other sources, imported libraries, or tutorials you used to complete the project.

$25.00 View

[SOLVED] Course Scheduler Final Project Part 1 Java

Course Scheduler Final Project Part 1 You have been asked to develop a Course Scheduling application for a College. The application will enable two types of Users to perform. their necessary functions to schedule courses by semester. The Admin User will perform multiple functions to set up the database so that Students my schedule courses. The functions each User will be able to perform. will be described below. This application should have a very nice GUI interface and will be a database driven application. The database used will be Derby. This application must use good Object-   Oriented Design and Programming. The database must use good Object-Oriented Design and Programming. There is a very close correlation between Object-Oriented Design and Database Design. Your application design should include at least four classes besides the main GUI class. Your database access should be in the classes that correlate with the database tables. This assignment is the first half of the final project and will be submitted as Final Project Part 1. This phase of the project will implement the following Admin functions: Add Semester A semester is added to the database. The semester is identified by one name. Add Course A new course is added to the database. The course is identified by the code for the course, and the description of the course. Add Class A new class is added to the database. The class is identified by the semester the course is offered, the code for the course, and the maximum number of students the course will contain that semester. Add Student A student is added to the database. The student is identified by a studentID, the student’s first name, and the student’s last name. This phase of the project will implement the following Student functions: Schedule Class The student will be scheduled in the class for the specified semester if there are seats available. If there are no seats available, the student will be put in a wait status for that Class. The waiting status must be maintained in the order the students tried to schedule the class. It will display whether the student gets scheduled for the class or is waitlisted. Display Schedule The Display Schedule function will display the current schedule of classes for a specified student for the current semester. It will display the course code and the status of the student in the class, whether scheduled or waitlisted. Display Classes The Display Classes function will display a complete list of classes for the current semester showing the course code, description, and number of seats. Testing scenario: A testing scenario will be provided to assist you in testing this application. It will be called Final Project Part 1 Test Script on Canvas. Database considerations: Your database will be created but all the tables should be empty when your project is submitted. Initial NetBeans Project: An initial project is provided for you to be used as the basis of your final project. It is provided as a .zip file in Week 11 in Canvas under the name CourseSchedulerNameID.zip. It MUST be used for your Final Project. You will change the project name after you download it. There is a video in Week 11 about how to do this. GUI Guidelines: The user should be required to enter only unknown data. Drop down lists of known data such as Student names, Course Codes, or Semesters should be displayed for the user to select. Combo Boxes should be used for the drop-down lists on the form. When information is requested to be displayed, e.g., for a Display command, all the requested information must be displayed. When a command is performed, the results of that command should be displayed to the user on the same display without the user needing to use a Display function to see what was done. Submission Guidelines: Don't forget to submit your zipped PROJECT folder and your zipped DATABASE folder. Zip the ENTIRE database folder and the ENTIRE project folder and submit the two zipped files in the assignment under one submission. Note: Your project must be renamed with the name ‘CourseSchedulerNameID’, where Name is your name and ID is your psu account id, e.g. xxx1234. The database must be created with the name ‘CourseSchedulerDBNameID’, and a username and password of java and java. All tables should be empty. Grading Criteria: In this project I will be looking for good OO design practices and this includes: • Use of getter and setter methods for class variables • Good naming of your classes, methods and variables • Correct use of static and non-static methods • The way you split this project into classes. • All of your updates to the database must be done using SQL statements, do not use ResultSetTableModels to update the database. • If a SQL statement to update the database needs to contain a variable, then you must use PreparedStatements, do not use concatenation of strings to create the SQL statement. The Grading Rubric for Final Project Part 1 is posted on Canvas. Note: Make sure you look at all the videos about this assignment and the Course Scheduler Design Layout on Canvas before starting this assignment.

$25.00 View

[SOLVED] CS152 Lab Exercise 3 Modular Design and Lists Java

CS152 Lab Exercise 3: Modular Design and Lists The goal of this week's lab/project pair is to learn how to organize our Python programs in such a way that the functions inside of one Python file can be used by other Python programs. The general term for this is code reuse and it is a central idea in software engineering. After all, what’s the benefit of spending a lot of time working on a program if it can only be used once and only to solve one specific problem. But in order to achieve efficient code reuse, we will need to learn how to structure our programs in a particular way. This organizational model is commonly   referred to as modular design and means that we will build more complex programs by reusing modules (collections of functions) also known as Python programs. This lab will prepare you for Project 3 by introducing more details on lists, uses of the main function, more file processing techniques, and command-line arguments. So, let’s get started! Lab Tasks (L1-L7) L1. Set up your workspace Make a folder and name it Lab03. Open VS Code and then open this folder from the File menu. Create a new file, list_practice.py. L2. Working with lists Lists are an important data structure in Python. A list is an ordered sequence of values. In Python the values of a list can be of any type, including other lists, and the list does not have to all be of the same type (unlike in other programming languages--we’re looking at you Java!). But for this assignment, we'll mostly be dealing with lists of numbers. Put the following assignment into your list_practice.py file. It assigns to the variable numbers a new list with five values: numbers = [5, 3, 6, 1, 2] In Python a list is indicated by square brackets, and the elements of the list are separated by commas. We can make an empty list like this: my_empty_list = [] To access one element of a list, we use index notation with square brackets like this: first_number = numbers[0] Note: In Python we start counting indices at zero. Add two more lines to your file to print out the 5 and the 1 (the first element in the list and the fourth element in the list--be sure to check how you count!). To add items to the end of a list, use the append(item to append to end of list) method. To call a method on a list we combine the name of the list, the “dot” operator, and the method name as follows: numbers.append(7) print( numbers ) You should now see a 7 at the end of the list. Just like with accessing list elements, we can replace elements in a list using bracket notation. For example, the following changes the first element of the list to a 4 and then prints the updated list: numbers[0] = 4 Modify the value of two other locations in the list in your Python file, then print out the list and make sure it did what you think it should have. L3. Building lists So far, all of our programs have processed data while we read it from a file (Ok, technically we   created a list using the split method, but we didn’t keep that list around for later processing). For this project, we want to read the file and build a data list that stores the incoming data in a list and then manipulate the list. The concept is straightforward: start with an empty list and as your program reads through the file append each value to the list. A. Download the file hurricanes .csv  from Google Classroom assignment and save it in your Lab03 folder. B.  Create a new Python file called analyze.py. Add a file header (module string) at the top that contains your name, today’s date, and the section of CS 152 you are in. Then copy and paste the following pseudocode. Convert each line of pseudocode into actual Python code. Each comment will correspond to one line of code. def main (): # assign to fp the result of opening the file hurricanes.csv for reading # assign to line the first line of the data file # assign to headers the result of splitting the line using commas # print headers # assign to a list variable named data an empty list # for each line in the file # assign to items the result of splitting the line using commas # append the second item to data (be careful, which index is that?) # close the data file # print data if __name__ == "__main__": main() Program Output: [ 'Year ', 'Number ', 'Damage  '] [15, 5, 6, 8, 3, 12, 7, 10, 2, 6, 4, 7, 10, 8] L4. Work with command-line arguments One way to get information from the user into a Python program is to use the input(“prompt string”) technique. But there is a second way to do this--command-line arguments. Information can be entered on the command line when the program is started and Python stores that information in a special variable called sys.argv where argv stands for the list of arguments read from the command line For example, it would be nice to modify our analyze.py program so that we could use it with any data file and any column. The following steps will show you how to get access to the command-line information. A. Import the sys module Create a new file com.py. Add a file header (module string) at the top that contains your name, today’s date, and the section of CS 152 you are in. Add the following statement below your header information: import sys B. Find out what the sys package can do Put the following line of code in the com.py file: print(sys.argv) Save your file and run the com.py file. What do you see? Rerun the last command line, but add additional data after python3 com.py. For example, try: python3 com.py hello world 1 2 3 Now, what do you see? The sys package gives you the ability to see what the user has typed on the command line. Each individual string (separated by spaces) from the command line is an entry in the argv list. C. Access individual strings from the command line Add the following three lines to your com.py file: print("Running program", sys.argv[0]) print("I'm going to open the file", sys.argv[1]) print("I'm going to extract column", int(sys.argv[2])) Run the program using the following command. python3 com.py hurricanes.csv 1 Do you begin to see how the command-line arguments can control both the file and the column of data to extract without the need to edit the Python file each time? L5. Get user input from the command-line Edit your analyze.py file so that the csv filename and column index are given on the command line. A. Add the import sys statement to the top of the file. B. Change the definition of main() so that it has two parameters: filename, column_id. C. Change the hardcoded value, hurricanes.csv, with the filename parameter. D. On the line that appends the data to your list, replace the index with the column_id parameter. E. When the main function is called from the conditional block at the bottom of the file, use sys.argv[1] and int(sys.argv[2]) as arguments to be passed into the main function: main(sys.argv[1], int(sys.argv[2]) And add two parameters to the definition of the main function: def main(filename, column_id): Run your program using: python3 analyze.py hurricanes.csv 1 The result should be identical to the prior case. Try changing the 1 to a 2 and see what happens. What happens if youtube        forget the extra data on the command line? L6. A Library of Useful Functions In the next task we're going to create a file (module) that holds a library of useful functions. In Python, a  library, or package, or module, is a file that contains functions. When you import the module into another Python file, you can use those functions. We've already done this by importing the sys package into our program. Now we're going to create our own module and then import it into other Python files. Create a new file called stats.py. Add a file header (module string) at the top that contains your name, today’s date, and the section of CS 152 you are in. A. Write a function to compute the sum of a list of numbers Create a new function called sum(numbers) that takes one argument. You can assume that the argument will be a list of numbers. This function should add together all of the values in the list and return the sum. The algorithm is as follows: # Create a variable to hold the sum # Initialize the variable to 0.0 (explicitly make it a floating point number). # Define a for loop to iterate over the list passed in as the function parameter. # On each iteration, add the current number to the variable holding the sum.   # Once the loop completes, return the sum. B. Write a test function To test your function, make a second function called test at the bottom of your stats.py file. The function does not require any arguments. As the first instruction in the test function, assign  to a variable the list [1, 2, 3, 4]. For the second instruction assign to a second variable the result of calling sum with the list as the argument. For the third instruction, print out the variable holding the result. Put the following at the end of your stats.py file (just below your test function) to call the test function when stats.py is run directly (i.e., not imported). The test function will not run when stats.py is imported into another Python file. if __name__ == "__main__": test() Run your program and make sure you get the value 10.0 as an output. L7. Using a Library The last step in the lab is to import your stats library into another file and use a function in that  module. Reopen your analyze.py file. At the top, after the import sys, and add the following line of code: import stats To call a function in your stats library, all you have to do is put stats. in front of the name of the function you want to use (e.g., stats.sum(numbers) ) Edit your main function so it uses the stats.sum(numbers) function to compute the sum of the values stored in the data list and prints out the sum. If you run your analyze.py program using the hurricanes.csv file and the index of the second column, you should get a sum of 103 as the answer. When you are done with the lab exercises, begin the project.

$25.00 View

[SOLVED] PHI12 INTRODUCTION TO SYMBOLIC LOGIC C/C

PHI12 INTRODUCTION TO SYMBOLIC LOGIC Course Description This course considers the theoretical elements of formal or symbolic logic. The focus of this course is not on sharpening critical and evaluative skills of everyday discourse; instead, we look at logic as an area of study in, and of, itself. We consider truth-functional logic (TFL)– the branch of symbolic logic that takes sentences as the fundamental unit of logical analysis. Once we grasp the key notions of logic (Section I of the course text), we will learn how to logically symbolize sentences and the logical connections between them (Section II of the course text), given these symbolizations, we then make use of two logical methods to give an analysis of our logical notions: truth-tables (Section III of the course text) and derivations (Section IV of the course text). The class lectures (in contrast to the TA sections) are intended to explain the logical concepts of formal logic and so will focus more on the theoretical side of the material rather than on its applications. There are, however, many exercises found in the course text (and solutions to selected exercises are on Canvas)– it is the student’s responsibility to work through these exercises. Any questions of a conceptual nature will be taken up in class lectures and those related to the applications of these concepts are to be brought to the TA Sections. Attendance for both lectures and TA Sections is, therefore, essential. The overall aim of this course is to achieve a conceptual understanding of the formal notions and procedures of symbolic deductive logic. Consequently, a majority of the questions on assignments and tests will be theoretical in nature. Carnap.io • All assignments and exams must be completed and submitted using Carnap.io. • You must create an account on Carnap.io. For this you will need the “course enrollment link” it is: https://carnap.io/enroll/UC%20Davis%20PHI012%20Fall%202024 Grading Scale 90 - 100 = A+   78 - 80 = B+    68 - 70 = C+    58 - 60 = D+ 85 - 89 = A       75 - 77 = B       65 - 67 = C      55 - 57 = D 81 - 84 = A-      71 - 74 = B-     61 - 64 = C-     50 – 54 = D-    < 50 = F   

$25.00 View

[SOLVED] SPH4U Exam Review Problems Python

SPH4U Exam Review Problems Kinematics 1. Kyle is in his car traveling at a constant speed of 150 km/h down the road. He passes a police car that was stationary at the side of the road. He sees the radar reading and immediately begins accelerating (8 m/s/s) in order to catch the delinquent teenager. How long and how far down the road does he catch Kyle? 2. A train is travelling at 23 m/s [E] when it enters a curved portion of the track and experiences an average acceleration of 0.14 m/s2 [S] for 95 s. Determine the velocity of the trains after this acceleration. Projectile Motion 3. A catapult launches a cat from ground level to a target located on the ground. The cat leaves the catapult moving at 100 km/h at an angle of 40º. a) What is the cat’s velocity half-way through the trajectory (size and direction)? b) What is the cat’s velocity at impact (size and direction)? c) How long is the cat in the air for? d) What is the maximum height? e) What is the range of the cat? 4. After landing safely on the target the cat tries another projectile apparatus. This time the cat is shot out of a cannon over a 30 m high wall. The cat is launched at an angle of 55º0 and can be assumed to be at ground level during launch. With what speed (in km/h) does it have to be launched to make it approximately 5 m over the wall if the wall is 250 m from the cannon? Dynamics 5. Three blocks of masses m1=26kg, m2=38kg, and m3=41kg, are connected by two strings over two pulleys as shown in the figure. a) Determine the acceleration of the blocks. b) Determine the tension in each of the strings. 6. A skier on a slope inclined at 4.7º to the horizontal pushes on ski poles and starts down the slope. The initial speed is 2.7 m/s. The coefficient of kinetic friction between skis and snow is 0.11. Determine how far the skier will slide before coming to rest. 7. Box A (m=2.5 kg) is connected by a rope that passes over a frictionless pulley to Box B (m=5.5 kg), as shown in figure. The coefficient of kinetic friction between box and ramp is 0.54. Determine the acceleration of the boxes. 8. Determine the horizontal acceleration of a 0.5-kg block that is being pushed along the ceiling with a force of 40N at an angle of 20º upward to the horizontal. See diagram for the coefficient of friction. Circular Motion 9. A plane is flying in a vertical loop of 1500 m radius. At what speed is the plane flying at the top of the loop, if the vertical force exerted by the air on the plane is zero at this point? 10. An object of mass 3.0 kg is whirled around in a vertical circle of radius 1.3 m with a constant velocity of 6.0 m/s. Calculate the maximum and minimum tension in the string. Work & Energy 11. A 1.2x103 kg space probe, travelling initially at a speed of 9.5x103 m/s through deep space, fires its engines that produce a force of magnitude 9.2x104 N over a distance of 86 km. Determine the final speed of the probe. 12. A 73 kg skier coasts up a hill inclined at 9.3º to the horizontal. Friction is negligible. Use the work-energy theorem to determine how far along the hill the skier slides before stopping, if the initial speed at the bottom is 4.2 m/s. 13. An ideal spring is compressed 15 cm on a horizontal surface. When released, it accelerates a block (5-g) along the frictionless surface. The block leaves the spring launcher and then travels up a long ramp and stops when it reaches a height of 0.54 m. What is spring constant of the spring? Momentum & Collisions 14. A 5000 kg boxcar moving at 5.2 m/s on a level, frictionless track, runs into a stationary 8000 kg tank car. a) If they hook together during the collision, how fast will they be moving afterwards? b) If the collision is somehow completely elastic determine the speeds of the two cars after the collisions. 15. A 2000 kg car travelling east at 24 m/s enters an icy intersection and collides with a 3600 kg truck travelling at 10 m/s [S20ºW]. If they become coupled together in the collision, what is their velocity immediately after impact (size and direction)? Motion in Space 16. Tethys, one of Saturn's moons, travels in a circular orbit at a speed of 1.1x104 m/s. The mass of Saturn is 5.67x1026 kg. Calculate a) the orbital radius in kilometres. b) the orbital period in Earth days. 17. A neutron star results from the death of a star about 10 times as massive as the Sun. Composed of tightly packed neutrons, it is small and extremely dense. a) Determine the escape speed from a neutron star of diameter 17 km and mass 3.4x1030 kg. b) Express your answer as a percentage of the speed of light. Electric Fields & Forces 18. The figure represents a neutral He atom with two electrons on either side of the nucleus, in a well-defined circular orbit of radius 2.64x10-11 m. Calculate the magnitude and direction of the electric force on each electron. 19. An electron enters a parallel plate apparatus 10.0 cm long and 2.0 cm wide, moving horizontally at 8.0x107 m/s, as in figure. Calculate a) the vertical deflection of the electron from the original path, b) the velocity with which the electron leaves the parallel plate apparatus. Magnetic Fields & Forces 20. An α particle of charge +3.2x10-19 C and mass 6.7x10-27 kg first accelerates through a potential difference of 1.2x103 V, then enters a uniform. magnetic field of magnitude 0.25 T at 90º. Calculate the magnetic force on the particle. Wave Nature of Light 21. Two sources are vibrating in phase, and set up waves in a ripple tank. A point P on the second nodal line is 12.0 cm from source A and 20.0 cm from source B. When the sources are started, it takes 2.0 s for the first wave to reach the edge of the tank, 30 cm from the source. Find the velocity, wavelength and frequency of the wave. 22. In an interference experiment, red light with a wavelength 6.0x10-7m of passes through a double slit. On a screen 1.5 m away, the distance between the 1st and 11th dark bands is 2.0 cm. a) What was the separation of the slits? b) What would the spacing be, between adjacent nodal lines, if blue light were used? (λblue = 4.5x10-7m) Special Relativity 23. A spaceship goes past a planet at a speed of 0.80c. An observer on the planet measures the length of the moving spaceship as 40 m. He also says that his planet has a diameter of 2.0x106m. a) How long does the woman on the spaceship measure the ship to be? b) What does the woman on the spaceship measure the diameter of the planet to be? c) According to the man on the planet, the spaceship takes 8.0 s to reach the next planet in his solar system. How long would the woman on the spaceship say it took?

$25.00 View

[SOLVED] Check-In 5 - Multiple Regression and Memo R

Check-In 5 - Multiple Regression and Memo Multiple regression lets you examine whether two more or more explanatory variables explain the variable you are interested in, simultaneously. Or an equivalent way of thinking about this, that has a different intuition, is that it allows us to examine whether an explanatory variable we are interested in explains the variable of interest after controlling for (or holding constant) variation in other variables. Using the simple regressions you ran in Check-In-4 as a starting point, run a multiple regression with two or more variables on the right-hand side. In this regression, you are trying to get to the heart of the questions listed in Section 1. Run and tabulate this regression. You have to decide what tells the story in the clearest and most compelling manner. Now take a step back and write a paragraph explaining your results Finally, pull your results together in a memo (see next section for further details). Deliverables The final memo should be one to two pages (including your table, and a figure if you choose to include one). Adhere strictly to the page limit --- your audience needs to be briefed briefly! This should be a doc file or PDF. Also attach your Stata do file (clearly annotated) to the assignment submission, as a separate file. Use a 12-point font and a maximum of double spacing.   Check-in 5 is due no later than 6:00pm on December 17. Points to Consider in Writing the Memo Your audience Write at a level that this audience can appreciate. You are addressing people who are familiar with basic numerical concepts (averages, percents). However, most are probably not aware of concepts like hypothesis testing, regression coefficients, and so on – after all, you didn’t know about these until you took Stat 1. Such technical terms do not belong in your memo, unless you also explain them in plain English. A big part of your assignment is to convey your findings, using words that your audience can understand. Tips on organizing and writing a memo Typically, memos of this sort are organized as follows: 1.   Introduction. What are you going to talk about? Why are these issues important? (Note that because this is a statistics class rather than a policy course, this will be just one short paragraph.) 2.   Methods: What is your data source for addressing these issues? Very briefly, how did you analyze the data? (Again, a very short paragraph, for this class.) 3.   Findings: What did you find? (Normally, this section will be the bulk of your memo. For this class, it will comprise one table and perhaps one figure, and one interpretive paragraph). Here are a few tips: Do •   Include one good table and perhaps one good figure. •   Use this section to tell the story that was revealed in your analysis. •   Highlight the most important and interesting findings. •   Tell  important  things   first  and   save  details  for  last  (or  omit  them altogether). •   Use bolding and bullets to separate elements of the story, as needed. •   Draw  your  reader’s  attention  to  important  trends  in  the  tables.  For example, “As shown in Table 1, Group  1 and Group 2 differed on the following characteristics …”. Do not •   Bury important findings in minutiae •   Use space in your “Findings” section to recount every statistic in your table(s). In other words, be selective! 4.   Conclusions:  How  do  your  findings  address  the  question  that  you  posed  in  the introduction? What do you conclude? Briefly, what are the limitations of your analysis? (For us, this is one paragraph.)

$25.00 View