Computer Science Summer Homework

Computer Science Summer Homework

1 We are pleased that you are considering the study of Computer Science at A level. This AQA exam board course is assessed by 2 exams worth 80% of the A level and coursework worth 20%. Further information about the course can be found at: tinyurl.com/compsciaqa Computer Science students will develop an understanding of why computer work in the way that they do as well as learning how to create computer programs using a A cat looking at a computer screen. number of programming paradigms. In order to prepare students to study Computer Science at Richard Huish College, we have included in this booklet some links to videos and online activities as well as some activities that we’d like you to try. Some useful web links to get you started BBC Bitesize GCSE Computer Make sure that you are prepared for A Level by reviewing Science (AQA) the GCSE content. This will be useful whether you have studied Computer Science already or not. The Computer Programme BBC programme from 1982 introducing the ‘latest’ (BBC iPlayer) technology available and what the next development will be. Computerphile (YouTube) A series of videos presented by professors from the University of Nottingham all about computers and computer stuff, from why hexadecimal is a useful number system to understanding artificial intelligence. Getting Started with Visual Get started with some VB.NET programming using Visual Basic.Net Studio 2019 (download for free). Contents Encryption ........................................................................................................ 3 Bitmaps ............................................................................................................. 4 Sorting Algorithms ............................................................................................ 5 The Turing Machine .......................................................................................... 6 Summer Homework .......................................................................................... 8 2 Encryption Encryption methods can be symmetric (same key used to encrypt as to decrypt) or asymmetric (two different keys used; one to encrypt, another to decrypt). We study both methods in Computer Science. An example of a symmetric encryption method is the rail fence cipher. See here for more information: crypto.interactive-maths.com/rail-fence-cipher For example, to encrypt the message: “Help me, Obi-Wan Kenobi. You’re my only hope.” we remove punctuation, ignore spaces and decide what key to use. The key gives us the height of the grid into which our plaintext is going to be entered and the message is entered along the diagonals, as shown below. Key = 6 H A U O E W N O R H P L I K Y E Y E P B E I M L X M O N B Y N X E O O X (Xs are typically used to complete the columns) The cipher text is then read across each row: HAUOEWNORHPLIKYEYEPBEIMLXMONBYNXEOOX To decrypt this message (the key, 6, needs to be known) a grid with a height of the value of the key is drawn and dashes are used as place holders for unknown letters. The ciphertext is then entered into the positions until the message can be read along the diagonals. H A U O E W N O R H P - - - - - - - - - - - - - - - - - - - - - - - - - Now you try A plaintext message has been encrypted using the rail fence cipher and a key of 4 to produce the ciphertext: CENOEOTRECFRNRMUSIESWNSPCIIX Q. What is the original plaintext message? Did you know… The Vernam cipher is the only encryption method that is considered to be 100% mathematically secure. It was developed in 1917 and it has been used for critical international diplomatic and military communications. Careers…. University degree courses and level 4 apprenticeships are available in cyber security, either of which can lead to a career in thee field. There is a recognised shortage of cyber security experts in the industry in the UK. Previous students have gone on to study at university as well as apprenticeships, including at GCHQ. What next…? You might like to try this cyber security challenge: cyber-school.joincyberdiscovery.com/ It is free for all 11 to 18 year olds in the UK. 3 Bitmaps Digital images can be stored using bitmaps or vector graphics. Both are studied in Computer Science. A bitmap is stored using a binary value for each pixel, where the binary value represents a colour. High quality bitmap images (such as photographs) use 24 bits for each pixel, 8 bits for each colour red, blue and green. These are often represented using 6 hexadecimal numbers. Examples can be found here: htmlcolorcodes.com/color-names/ Early computer games used 3 bits or 6 bits to represent graphics. For example, a colour pallet for 3-bit images uses the following colour codes: Black 000 Aqua 011 Red 100 Magenta 101 Green 010 Yellow 110 Blue 001 White 111 Using a 3-bit colour pallet, the first two rows of the image to the left can be represented as: 111111110110110110111111111111 111110110111110110110111111111 Alongside these binary value, other metadata would need to be stored, such as the height and width of the image. Now you try Q. How would rows 6 and 7 be stored using the 3-bit binary described above? The file size of the above image (not including metadata) is calculated by: h × w × n Where h is the height of the image in pixels, w is the width of the image in pixels and n is the number of bits used to represent colour in each pixel (also known as bit depth or colour depth). Q. What is the file size of the image above in bits? There are 8 bits in a byte. Can you also give the file size in bytes? The number of available colours for each bit increases as the number of bits used to represent colour increases. For example, 1 bit allows 2 colours (black and white), 2 bits allow 4 colours and 3 bits allow 8 colours. Q. How many colours could be represented if 4 bits are used? Q. How many colours could be represented if 6 bits are used? Q. How many colours could be represented if 24 bits are used? (You may need to use a calculator!) Did you know… Run Length Encoding (RLE) is a technique used to compress bitmap images. The value given to a pixel is stored alongside the number consecutive pixels of the same colour. So the first line of the image above could be represented as 2W 4Y 4W Careers… Computer games developers require a good understanding of how images are stored and how much memory is used. What next…? pixelart.com can be used to create your own bitmap images. Daily challenges are available and images can be shared with others. 4 Sorting Algorithms There are a number of sorting algorithms that can be used by a computer. The most famous is probably the bubble sort. It is easy to follow and to code, but it is quite inefficient. A YouTube video that compares some of the most well known sorting algorithms is here: youtu.be/ZZuD6iUe3Pc The bubble sort works by comparing pairs of values and switching them if they are in the wrong order over a number of passes. The basic bubble sort will do this a sufficient number of times to ensure that all the possible comparisons are made. Compare the 1st and 2nd value 5 8 2 6 9 3 5 and 8 are in the correct order, don’t swap Compare the 2nd and 3rd value 5 8 2 6 9 3 8 and 2 are in the incorrect order, swap. Compare the 3rd and 4th value 5 2 8 6 9 3 8 and 6 are in the incorrect order, swap Compare the 4th and 5th value 5 2 6 8 9 3 8 and 9 are in the correct order, don’t swap Compare the 5th and 6th value 5 2 6 8 9 3 9 and 3 are in the incorrect order, swap Result of 1st pass 5 2 6 8 3 9 Now you try Q. Use the table below to show the result of each comparison for the 2nd pass. st nd Compare the 1 and 2 value 5 2 6 8 3 9 nd rd Compare the 2 and 3 value rd th Compare the 3 and 4 value th th Compare the 4 and 5 value th th Compare the 5 and 6 value nd Result of 2 pass In a Computer Program, in order for the swap to be made, if the following value is in the wrong place, it needs to be stored in a temporary position so that the current value can take its place. An algorithm (using pseudo code) is below. Some lines have been left out. It uses two ‘loop’ structures; one to go through all the passes (m), and the other to make all the comparisons in each pass (n). Q. Choose the missing lines of code from the right hand side and write them in to complete the algorithm. For m = 1 to numberOfValues Missing lines of code If (n+1)th value > nth value Move temp value into nth value’s position Move nth value into (n+1)th value’s position For n = 1 to numberOfValues End if Next Move (n+1)th value into temp Next Did you know… Big O notation is used to compare the efficiency of algorithms. The bubble sort has a O(n2) which means that (very) approximately if there are n items, n×n operations are required. Careers… Software developers need to know how to produce code that runs efficiently, using as little memory and time as possible. University degrees and level 4 apprenticeships are both progression routes that students can take to become a software developer and many of our previous students have done so. What next…? Learn about different programming languages.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us