
Getting ready for your GCSE Computer Science exams? Test our knowledge by answering all the following questions:
GCSE Computer Science RevisionOpen in New Window
Getting ready for your GCSE Computer Science exams? Test our knowledge by answering all the following questions:
GCSE Computer Science RevisionOpen in New Window
In this post, we are investigating our daily use of the main protocols used when accessing the Internet while using our smartphone, laptop or desktop computer, tablet, smartTV or game console.
Protocols are an essential concept to enable network communications and data transfer between different devices. A protocol defines the rules to be followed by both devices to be able to communicate with one another.
On the Internet, most communications use the TCP/IP range of protocols which relies on packet switching and the use of IP addresses to uniquely identify devices on the network.
Protocols can also be grouped into layers: The TCP Stack consists of 4 key layers:
Answer the following 10 questions to evaluate your daily use of networking protocols:
Daily ProtocolometerOpen in New Window
“Stylish” is a Hair & Beauty Salon offering a wide range of hair & beauty treatments to customers. They currently employ five hair stylists and three beauticians. They currently use a notebook to record all their information such as customer contact details, appointments, treatments to be performed and payments.
They would like a new IT system to optimise their booking systems and keep track of payments so that they can renumerate their employees accordingly based on the treatments they completed.
They would like the new system to allow staff to:
Your task is to review the requirements of this Hair & Beauty Salon in order to design the Entity Relationship Diagram (ERD) for this system.
For more information about relational databases and Entity Relationship Diagrams, visit the following pages:
Use our online ERD tool to design the Entity Relationship Diagram for this salon. Note that you have not been given all pieces of information to store about the employees, customers, appointments, bookings, treatments and payments so you will have to decide of the most relevant fields to include on your ERD.
Design Your ERD OnlineAs you know, computers can only process binary data which consists of 0’s and 1’s. This is due to the fact that the main processing components (e.g. the CPU) are made of transistors: tiny electronic switches that can be turned on (1) and off (0).
A transistor is an electronic component with three pins. Basically, a transistor is a switch (between two of the pins: the collector and the emitter) that is operated by having a small current in the third pin called the base.
Use the checkboxes below this transistor to understand how applying a voltage to the base of a transistor is equivalent to turning on a switch.
A transistor acts like a switch, operated by applying a small current to the base.
Transistors come in many shapes and sizes. Inside the CPU fully integrated nano-transistors are just a few atoms wide!
Using a small breadboard circuit, we can test the behaviour of a transistor. You can reproduce the following circuit see how the transistor operates.
A logic gate is a small electronic circuit made of one or two transistors and used to process binary data. Logic gates such as the AND gate, OR Gate, NOT Gate, XOR gate and NAND gates are the key building blocks of any computer system.
In this challenge, you will recreate some of theses logic gates by combining several transistors together. You will then test your logic gates to record their behaviour using a truth table, that will show all the outputs of your logic gates for all possible input combinations.
Use the tabs below to see how some of the key logic gates are built using transistors:
Input A | Input B | Output X |
0 | 0 | |
0 | 1 | |
1 | 0 | |
1 | 1 |
Input A | Input B | Output X |
0 | 0 | |
0 | 1 | |
1 | 0 | |
1 | 1 |
Input A | Output X |
0 | |
1 |
Input A | Input B | Output X |
0 | 0 | |
0 | 1 | |
1 | 0 | |
1 | 1 |
Integrated Circuit 7408: Quad 2-input AND gate
More complex integrated circuits include binary adders (half-adder, full adder used to perform binary additions) and flip-flop circuits used to implement volatile memory.
List of 7400 series integrated circuits:
https://en.wikipedia.org/wiki/List_of_7400_series_integrated_circuits
A microprocessor is a computer processor which incorporates the functions of a computer’s central processing unit (CPU) on a single integrated circuit
Roman Britain was a period of nearly 400 years between AD 43 to AD 410 when large parts of Great Britain were under occupation by the Roman Empire. During this period, the Romans built roads and architectural structures that can still be seen today. These include military structures such as forts and walls (including Hadrian’s Wall), Roman baths and aqueducts.
The Romans also introduced a number system based on roman numerals. These roman numerals are still used today, for instance on most analogue clocks, even though mechanical clocks did not exist at the time. Three main types of timepieces were used in ancient Roman times: The sundial, the klepsydra, and the obelisk.
A team of archaeologists has recently discovered some old parchments that include a map of the old roman city of Bath, Somerset, UK (Aquae Sulis) covered with Roman numerals from I to L (1 to 50). They also found 12 encoded messages and a piece of a golden sundial that they believed belonged to emperor Claudius. The legend tells that the sundial was broken in 13 pieces which were spread out and buried all over the city of Bath. The archaeologists would need your help to decode these messages, which they believe will help them locate the 12 remaining pieces of the lost golden sundial!
The Lost Roman Sundial – Code Breaking ChallengeOpen in New Window
The most prestigious art exhibition is about to start at Tate Modern, London, UK. For the purpose of this exhibition, paintings from all over the world have been securely transported to London using a state of the art protection system called the multi-safe.
The multi-safe contains 12 individual locked compartments which are large enough to store one painting each. Each compartment is locked using a rotating combination locking system. Each combination consists of 3 numbers.
For security purposes, the actual combinations are kept secret and the Gallery manager has only been given access to 12 coding puzzles that will be necessary to retrieve the combinations and unlock the multi-safe 12 compartments. The gallery manager needs you to help him access to the world’s 12 most famous paintings before the gran opening of the Expo Art exhibition.
Before attempting this task, you should practice unlocking this padlock, by spinning the padlock wheel and using the combination provided below:
You now have under 1 hour to unlock the 12 compartments of the secure artwork storing safe. Good luck!
Art-Expo – Code Breaking ChallengeOpen in New WindowBinary data is made of (short for binary digits) of data: 0s and 1s. Everything that is stored on a computer must be in binary form. This includes, numbers, , images, sound files and video clips.
So let’s start with numbers: Using of data you can form a : For instance is a Byte of data. A Byte of data can be used to represent any denary number between . You can easily convert a denary number into binary and vice versa using the following conversion table:
Using this conversion table, you can see that the bit on the left is the bit and is worth 128, whereas the bit on the right is the bit as it is only worth 1.
You will hence notice that in Binary an number will always have 1 as its least significant bit, whereas an number will always have 0 as its least significant bit.
To make a number higher than 255, you will need to use extra bits, added to the left of this conversion table. e.g. Using 9 bits instead of 8 would allow you to store numbers up to , and using 2 Bytes (16 bits) would allow you to store numbers from 0 to
Now that you understand how numbers can be stored into binary, you can investigate further how text files, images and sound files can also be stored in binary:
When your browser displays a webpage on screen it uses 3 different programming languages called HTML, CSS and JavaScript. We call the combination of these three languages “client-side web technologies”.
Each of the three language has its own syntax and purpose:
Each of these languages are based on web standards defined by the World Wide Web Consortium W3C. As a consequence these languages are recognised by all the main web-browsers including Google Chrome, Microsoft Edge, Modzilla Firefox, Safari, etc. on various platforms (Windows, MacOs, Linux, Android etc.)
The Following codepen provides a clear demonstration of the syntax and purpose of HTML, CSS and JavaScript and shows how JavaScript can interact with various HTML tags.
See the Pen
Untitled by 101 Computing (@101Computing)
on CodePen.
The birthday paradox is based on a counter-intuitive fact that in any class of 23 students or more, there is a higher probability of having at least two students sharing the same bithday.
Considering that there are 366 different possible dates in a year (leap year), you may first predict that it would take a group of 183 students (50% of 366) to reach a 50% probability of at least two students sharing the same birthday. However this prediction would be wrong as this is not how the probabilities work in this case. You can use this page to find out more how to work out that with a class size of only 23 students, there is a probability of 50% that at least two students share the same birthday.
For this Python challenge we will create a statistical simulation program to test the Birthday Paradox. Our aim is to determine whether the actual probabilities match the predicted probabilities by showing that, with a group of 23 students or more, the probability of having at least two students sharing the same birthday will be at least 50%.
We have started a program to help you with this challenge (See trinket window below). So far our program will:
Your task is to complete this code to:
You will then be able to run this code several time to check whether, with a group of 23 students or more, you obtain a 50% or above chance of having at least two students sharing the same birthday. Note that you could also get the program to automatically repeat the experiment several times and calculate the resulting statistic (e.g. out of 10 experiments).
Below is the code to complete…
A range of video games use elastic collision formulas to predict the change of velocity of two objects when a collision occurs.
Elastic collision occurs when two objects are colliding and the total kinetic energy of the two objects remains the same. In reality, most collisions between two objects would result in some loss of energy (inelastic collision). However in some contexts, such as when two rigid billiard balls are colliding, this loss of energy is negligeable. In a video game of pool we would therefore implement an algorithm based on an elastic collision.
Let’s investigate how we can implement an elastic collision in a computer animation or a video game.
In a frame based game, most moving sprites would have a set of coordinates (x,y) to inidicate their position on the screen as well as a vaolcity vector (vx,vy) to indicate used to increment the (x,y) coordinates between two frames of the game and hence implement the movement of the sprite.
Let’s consider two perfectly elastic balls of masses m1 and m2 moving along the same straight line with velocities u1 and u2.
Our aim is to calculate the velocity v1 and v2 of these two balls after the collision.
Conisidering that both momentum and kinetic energy are conserved quantities in an elastic collision, we can deduct the following two formulas:
Conservation of momentum
Conservation of kinetic energy
We can use both these formulas to calculate the velocity vectors v1 and v2 of the two colliding objects after the collision:
Note that these equations can be simplified when both colliding objects have the same mass: m1=m2. In this case we can use the following simplified formulas:
In a 2-dimension environment, the velocity vectors may not be aligned on the same straight line.
We can however decompose the velocity vectors to identify the component of the velocity that is going along the straight line joining the centre of both moving balls (Purple vectors on the above diagram) and the component that is perpendicular to this straight line (Grey vectors on the above diagram). The first component will be affected by the elastic collision using the 1-Dimensional model/formulas whereas the second component will not be affected by the collision.
In order to calculate the 2 components of our velocity vectors (purple and grey vectors) we will first need to perform a rotation by θ, the angle that can be calculated using the (x,y) cartesian coordinates of the centre of both moving objects as follows:
We will then rotate our velocity vectors by θ as shown on the diagram below. Note however, that we would apply the same rotation for both velocity vectors (red and blue balls).
The formulas to perform a 2D rotation are as follows: (You can find out more about these formulas on this page)
where (Vx,Vy) represents the velocity vector (vx,vy) after the rotation.
We can now apply the 1-dimensional elastic collision formulas to the Vx (purple component) of the velocity for each moving object, whereas the Vy components will not be affected by the elastic collision.
And then we will need to rotate our new velocity vectors by -θ to cancel out the previous rotation.
To see how the above formulas can be implemented, we have created a demo using JavaScript. You can investigate this code further to identify how the steps described above have been implemented.
In our demo, all the moving objects have a different mass, pro-rata of their size (radius).
Note that this code could be simplified further using objects of the same mass as this would be the case in a game of pool!
Finally, you will notice that this code also applies some formulas to the velocity vectors of each ball to let the balls bounce against the edge of the canvas. These formulas are explained on this page.
Your task consists of tweaking the above code (Click on “Edit On Codepen” button in the top right corner of the above codepen frame) in order to create a pool table with:
Note that, in a game of pool, all balls have the same mass and size. You can hence simplify the code to use the simplified 1-dimensional elastic collision formulas.
About this task: The aim of this challenge is not to create a full game of pool but just to tweak the above code to make sure that the canvas contains 16 balls of the right colour and of the same weight/size. In a full game of pool, other features would need to be considered such as, implementing the correct size of the pool table, adding pockets and detecting when balls fall into these pockets, adding friction to slow down the rolling balls and adding a mechanism for the player to aim/shoot. All of these features are not part of this task.