University : UK University UniLearnO is not sponsored or endorsed by this college or university.
Country : United Arab Emirates
Assignment Task:

Task:

Task and Mark distribution:
The Individual Portfolio consists of four tasks (carrying equal marks). You are encouraged to explore these topics, use your initiative, and show some originality, within the time available. Ensure that you clearly reference any sources you have used.
Please submit one report (e.g. as a single Microsoft Word document) covering all of the tasks below, clearly organised by subtask. Make sure you include your Python code directly in the report. You must not submit a zip file. The word limit is a maximum rather than a target. Concentrate on producing a clear and concise answer to each subtask.
Task 1. Explain, critique, comment and debug code
Suppose you have found the following (incomplete) Python code on a scrap of paper. It isn’t quite finished and contains some errors.
def whatdoido(P,T)
p = len(P)
t = len(T)
for i in range(t-p-1)
j = 0
k = True
while (j<p-1 and k)
if (P[j] != '.')
if (T[i+j] != P[j])
k = False
j += 1
if (k)
print('Look at index:',i)
whatdoido('.at','atbatcatataxe...')

  • (1) Give a detailed critique of the incomplete code given above. Then fix any syntax errors so that the Python code runs, ensure the code follows good Python coding style, improve all the variable names, and improve the function name. Please annotate the existing code to show the syntax errors and provide a corrected version of the code. Do not fix any semantic errors and be careful about the indenting given.
  • [10 marks]
  • (2) Add appropriate print statements to the Python code from part (1) to generate (directly from the code) a clear nontrivial example illustrating the algorithm running on the example given. The level of detail should show what comparisons are being made and what decisions are being taken. Please provide both code (with print statements added) and the output from the code running in a way that illustrates the algorithm in detail but also gives insights into how it works. You can also add additional text explanation to your example. You may find it useful to use some indenting of the output using spaces in your print statements.
  • [5 marks]
  • (3) Insert additional Python code to count the number of comparisons (specifically each of the !=). Make improvements (with justification) to the code to improve its effectiveness (so that it actually does solve the task correctly, now fixing any semantic errors) and efficiency (solves the task using fewer operations). Also, explain what task the code is attempting to solve (one sentence) and the higher-level idea behind the algorithm (one sentence). Explain how the resulting algorithm is similar and different to the Boyer-Moore algorithm (which would you recommend using). Clearly state the criteria you are using to judge your improvements. Test your final Python code on some more complex examples. Do not attempt to implement the Boyer-Moore algorithm.
  • [10 marks
  • Task 2. Design, build and test
  • Dragonfly is a simple dice game for one player. The aim is to collect all the body parts of a dragonfly. Rolling an unbiased eight-sided dice, a 1 gives a dragonfly body (thorax), 2 gives a head, 3 gives a tail (abdomen), 4 gives an antenna, 5 gives an eye, 6 gives a mouth, 7 gives a wing, and 8 gives a leg. The player must collect a dragonfly body before any other body parts can be added. The player must collect a dragonfly head before any antennae, eyes or mouth can be added. A complete beetle consists of one body, one head, one abdomen, two antennae, two eyes, one mouth, four wings, and six legs.
  • Before you write any code, it is worth playing this game a few times using a pencil, paper and an eight-sided dice (or use https://rolladie.net/roll-a-d8-die).
  • (1) Implement this game as one Python function. Follow the steps and logic you take in a physical game. Your code should include enough print statements to generate a clear nontrivial example illustrating a play of the game, telling the story as the dice is rolled and the dragonfly body parts are assembled. Please provide both your code and the output from a sample run.
  • [10 marks]
  • (2) Modify your Python code to add at least three counts that effectively summarise a game, e.g., how many dice rolls are made. Use these summary counts to compare the original game described above with the variant in which the player needs to build two complete dragonflies (while carefully satisfying the precedence of body parts for both dragonflies). Also compare these with one further variant of the game of your choice. Explain carefully what steps you have taken to test your code (not just debugging). Please provide separate Python code for the original game with counts and the two variants, together with output from sample runs of each and a comparison of counts in a table.
  • [15 marks]
  • Task 3. Critically assess, select and apply data science tools
  • This task involves creating interesting exploratory graphical plots of a dataset using appropriate Python libraries and then critically assessing/comparing the capabilities of those plotting libraries.
  • (1) Select a dataset that has some interesting features, e.g., from Kaggle or fivethirtyeight. Consider building two polished nontrivial graphical plots that each illustrate something interesting about the dataset. The plots must be substantially different, and one of them should involve some complexity, e.g., a Mekko chart, a circular barplot, or a hexagonal heatmap. For each of the two plots, build that plot in three separate ways, each using a different Python plotting library. For example, you might use Matplotlib to build a stacked barchart and then also build a similar stacked barchart using each of two other Python plotting libraries separately. You must use at least two of seaborn, plotly and plotnine plotting libraries. The Python Graph Gallery (https://python-graph-gallery.com/) is a good place to start. Aim to make the plots of the same type as similar as possible using the different plotting libraries.
  • [10 marks]
  • (2) Drawing on your experience from part (1) and additional sources (e.g. articles, blogs, documentation or tutorials), critically assess the libraries you used to produce these particular plots, e.g., in terms of difficulty of coding, adaptability of the code, level of control over the plot layout or labelling, and quality of the graphical plot produced. Ensure you clearly reference any sources you use.
  • [10 marks]
  • (3) Suppose you wish to visualise geospatial data. Briefly describe the capabilities of one Python library that you would recommend and give an example (code and output) using UK data.
  • [5 marks]
  • Task 4. Data ethics and security
  • The Information Commissioner’s Office (ICO) defines a personal data breach as “a breach of security leading to the accidental or unlawful destruction, loss, alteration, unauthorised disclosure of, or access to, personal data” (see https://ico.org.uk/for-organisations/guide-to-data-protection/guide-to-the-general-data-protection-regulation-gdpr/personal-data-breaches/). Ensure you clearly reference any sources you use.
  • (1) Describe a significant data breach in the UK from the last 10 years and discuss its impact. Do not use examples involving Cambridge Analytica or British Airways.
  • [10 marks]
  • (2) Critically evaluate how the relevant principles of the UK Government Data Ethics Framework, the UK Data Protection Act and the EU General Data Protection Regulation were violated in the case you have described in part (1), and how these principles and regulations could (or should) have prevented such a breach.
  • [10 marks]
  • (3) The website dataethics.eu (https://dataethics.eu/data-ethics-principles/) says that data ethics is about “responsible and sustainable use of data” and “is the step further than mere compliance with personal data protection laws”. Evaluate this description of data ethics for the case you have described in part 

The above IT Assignment has been solved by our  IT Assignment  Experts at UniLearnO. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire considered worthy of the highest distinction.

Eureka! You've stumped our genius minds (for now)! This exciting new question has our experts buzzing with curiosity. We can't wait to craft a fresh solution just for you!

  • Uploaded By : Pearl
  • Posted on : October 12th, 2019

Whatsapp Tap to ChatGet instant assistance