What is a random number and what is the random number generator?

Dice

Sungmin in Year 13 looks at random numbers, explaining what they are and how they are relevant to our lives – from encrypted passwords to how games are programmed.

Random number in real life

As public and private data networks proliferate, it becomes increasingly important to protect the privacy of information. Having a random number is one of the steps which can become a core component of the computer to increase the security of the system platform. Random numbers are important for other things – computer games, for example. Random numbers will ensure there are different consequences after making different decisions during a game. The results will always be different because the given input is different. At an arcade, there are many games that rely on randomness. Falling objects fall in different patterns so that no one can anticipate when to catch the object. Otherwise, some people will be able to calculate how an object will fall and the game will no longer be loved by the people visiting arcades. It is interesting that we get some randomness as such.

The examples such as the falling object and computer games both require random numbers in order to be unique. For those games and many other situations that require randomness, private data must be encrypted. To do so, a true random number plays such a significant role and must be used. On the other hand, when we are programming games, both true random number and pseudo-random numbers can be used. As you might have noticed already, there are two types of random numbers. Random numbers are separated depending on how they are generated. One is the true/real random number and the other is the pseudo-random number.

Definitions of ‘random number’

There are several different ways to define the term, ‘random number’. First of all, it is a number which is generated for, or part of, a set exhibiting statistical randomness. Statistical randomness is a characteristic where a numeric sequence is said to be statistically random when it contains no recognisable patterns or regularities.

Secondly, a random number can be defined as a random sequence that is obtained from a stochastic process. A stochastic or random process can be defined as “a collection of random variables that is indexed by some mathematical set, meaning that each random variable of the stochastic process is uniquely associated with an element in the set.”  Moreover, a random number is an algorithmically random sequence in algorithmic information theory. An algorithm is a “process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer”. Also, the sequence which is algorithmically random can be explained as an infinite sequence of binary digits that appears random to any algorithm. The notion can be applied analogously to sequences of any finite alphabet (e.g. decimal digits).

Random sequences are the key object of study in algorithmic information theory. Algorithmic information theory is a merger of information theory and computer science that concerns itself with the relationship between computation and information of computably generated objects, such as strings or any other data structure. Random numbers can also be described as the outputs of the random number generator. In cryptography we define a random number through a slightly different method. We say that the random number is “the art and science of keeping messages secure”.

Different types of random number generators

1:

  • True random number generator (TRNG)
  • Hardware true random number generator (HRNG)

2:

  • Pseudo-random number generator (PRNG)
  • Linear Congruential Generator
  • Random number generator in C++

The major difference between pseudo-random number generators (PRNGs) and true random number generators (TRNGs) is easier to understand if you compare and contrast computer-generated random numbers to rolls of a dice. Since the pseudo-random number generator generates random numbers by using mathematical formulae or precalculated lists akin to someone rolling a dice multiple times and writing down all the outcomes, whenever you ask for a random number, you get the next roll of the dice on the list. This means that there are limitless results produced from the list. Effectively, the numbers appear random, but they are in fact predetermined. True random number generators work by “getting a computer to actually roll the dice — or, more commonly, use some other physical phenomenon that is easier to connect to a computer than is a dice”

Comparisons of PRNGs and TRNGs

As you go about your day today, consider how random numbers are being used to support your daily activities – from the passwords we use, the apps we run on our phones, and the devices and programmes we engage with. Maths is all around us.

Teaching and learning Gem #30: Computer Science Practical Work and Metacognition

Spring Focus: Metacognition – Computer Science Skills

In this gem, I will be looking at the thinking skills that are taught as part of the Computer Science Curriculum and the ways in which they are taught. I hope that by sharing our ideas, we can start to think of problem solving as a set of skills involved across a range of subjects.
Metacognition skills are key to the study of computer programming. When encountering a new task, novice computer programmers are likely to concentrate on the superficial details of the problem, failing to break it down into manageable sub tasks and trying to solve the whole problem in one go. We often see this in our lessons and I’d be really interested to hear if any other colleagues encounter similar issues or use similar skills in their subjects.

Metacognition Skill 1: Decomposition
Decomposition is the process of breaking a large problem down into progressively smaller “chunks”, making it easier to solve. By the time they complete the GCSE course, students should be comfortable with these steps. In order to promote this at GCSE, students develop this skill in three ways:

Computer Science

At the start of the course:

 After introducing the concept of decomposition, students are asked to create an overview of the parts of their favourite board game. This gets them to take an algorithm (set of steps, as defined by the rules) and gets them to think about them in a different way.

Computer Science Further on in their learning, the class will be asked to attempt a decomposition diagram, working collaboratively to spot the key components of the problem. This work is not marked, nor do they have to follow a set format; it simply acts as their plan for the task.
Computer Science

Finally, at the end of a project, the class is given a solution prepared by the teacher. Their task is then to reverse-engineer the decomposition diagram, so that they can follow the thought process used and begin to do it by themselves in the future.

Metacognition Skill 2: Abstraction

Abstraction is the skill of removing unnecessary detail, allowing the programmer to focus on the important parts of the problem. A famous example of this is tube map, where Harry Beck realised that the geographical positions of the tube stations was unimportant; his map focused more on the order of stations and highlighting interchanges, using approximate locations (click here for a geographically accurate tube map and see how much hared it is to follow).

In this activity, students are paired, with one partner blindfolded. The partner who can see is given a photograph (of a bird, for example) and has to get the blindfolded “artist” to recreate the picture as accurately as possible. The results are often comical, occasionally hilarious and always excite some sort of comment. After a couple of iterations, the class is asked to reflect and discuss how they made it easier to describe the image to their partner. Many of them will respond with ideas such as “I told her to draw a circle the size of a 10p” and this can lead us in to the concept.

Metacognition Skill 3: Mental Mapping

In creating larger software projects, it’s important to consider how users will interact with the solution; the user will create a mental map of software, giving them an idea of where they are, where they need to go and the way back to the beginning. The class are asked to close their eyes and count the number of windows in their house (some of the numbers shocked me when I first asked this in a private school). After asking for their responses and writing them on the board, they are asked to forget about the number and to describe the process they went through. Were they inside or outside? Which room did they start in if they were inside? Did they fly around the outside? This allows us to explore the idea that they have a mental model or map of their house in their heads. This can be broadened out into directions to their nearest train station or supermarket. Then we look at the steps involved in performing everyday computer tasks, such as writing a letter in Word. Using these examples, the students then design their solution.

Why these ideas are Useful…

  • By introducing the skill in a non-technical and familiar situation to begin with, we can avoid overwhelming the pupils with new terminology
  • Instead of this being something new that the students feel they have to acquire, we can give them the idea that these are skills that they already possess and with practice can develop
  • It allows them to develop their confidence in the face of unknown problems and to draw out the similarities between tasks
  • Although these are Computer Science examples, they can be applied to other subjects:
    • Planning a project or research by splitting it into easy to achieve tasks
    • Describing concepts to others in a simple and concise way
    • Designing the layout of anything

 

How is the Turing Test Relevant to Philosophy?

Kira, Year 13, looks at the Turing test and how criticisms of it bring new ideas and concepts into the philosophy of mind.

Alan Turing
Alan Turing

As emerging areas of computer science such as Artificial Intelligence (AI) continue to grow, questions surrounding the possibility of a conscious computer are becoming more widely debated. Many AI researchers have the objective of creating Artificial General Intelligence: AI that has an intelligence, and potentially a consciousness, similar to humans. This has led many to speculate about the nature of an artificial mind, and an important question arises in the wake of this modern development and research: “Can computers think?”

Decades before the development of AI as we know it today, Alan Turing attempted to answer this question in his 1950 paper Computing Machinery and Intelligence. He developed the famous Turing test as a way to evaluate the intelligence of a computer. Turing proposed a scenario in which a test subject would have two separate conversations: one with another human, and one with a machine designed to give human-like responses. These conversations would take place through a text-channel so the result would not be affected by the machine’s ability to render speech. The test subject would then be asked to determine which conversation took place with a machine. Turing argued that if they are unable to reliably distinguish the machine from the other human, then the machine has ‘passed the test’, and can be considered intelligent.

At the start of his essay, Turing specifies that he would not be answering “Can computers think?”, but a new question that he believed we are able to answer: “Are there imaginable digital computers which would do well in the imitation game?” However, Turing did believe that a computer which was able to succeed in ‘the imitation game’ could be considered intelligent in a similar way to a human. In this way, he followed a functionalist idea about the mind – identifying mental properties though mental functions, such as determining intelligence through the actions of a being, rather than some other intrinsic quality of a mental state.

Many scholars have criticised the Turing test, such as John Searle, who put forward the Chinese Room Argument and the idea of ‘strong AI’ to illustrate why he believed Turing’s ideas around intelligence to be false. The thought experiment looks at a situation where a computer is produced that behaves as though it understands Chinese. It is, therefore, able to communicate with a Chinese speaker and pass the Turing test, as it convinces the person that they are talking to another Chinese-speaking human. Searle then asks whether the machine really understands Chinese, or if it is merely simulating the ability to speak the language. The first scenario is what Searle calls ‘strong AI’, referring to the latter as ‘weak AI’.

In order to answer his question, Searle illustrates a situation in which an English-speaking human is placed in a room with a paper version of the computer program. This person, given sufficient time, could be handed a question written in Chinese and produce an answer by following the program’s instructions step-by-step, in much the same way as a computer does. Although this person is hence able to communicate with somebody speaking Chinese, they do not actually understand the conversation that is taking place, as they are simply following instructions. In the same way, a computer able to communicate in Chinese cannot be said to understand the language. Searle argues that without this understanding, a computer should not be described as ‘thinking’, and as a result should not be said to have a ‘mind’ or ‘intelligence’ in a remotely human way.

Searle’s argument has had a significant impact on the philosophy of mind and has come to be viewed as an important argument against functionalism. The thought experiment provides opposition to the idea that the mind is merely a machine and nothing more: if the mind were just a machine, it is theoretically possible to produce an artificial mind that is capable of perceiving and understanding all that it sees around it. According to Searle, this is not a possibility. However, many people disagree with this belief – particularly as technology develops ever further, the possibility of a true artificial mind seems more and more likely. Despite this, Searle’s Chinese Room argument continues to aid us in discussions around how we should define things such as intelligence, consciousness, and the mind.

In this way, both the Turing test and Searle’s critique of it shed new light onto long-standing philosophical problems surrounding the nature of the human mind. They serve to help bring together key areas of computer science and philosophy, encouraging a philosophical response to the modern world, as well as revealing how our new technologies can impact philosophy in new and exciting ways.

Computer Science at Wimbledon High

Veerman Sajadah, Head of Computer Science, investigates how a change in governmental policy in 2012 impacted the teaching of ICT and Computer Science to current pupils.

2012 marked a major change in secondary education. The education secretary announced that the Information Communication Technology (ICT) curriculum must be scrapped in favour of computer science. While this change was seen as a step forward by many, the debate is still on as to whether our students are missing out on the previously skill based ICT curriculum. Consequently, GCSEs in ICT have now disappeared to make way for new Computer Science (CS) GCSE courses from all major exam boards and all schools have had to adapt. At WHS, students were introduced to CS in Year 7 in 2013. These students were the first cohort to study CS instead of ICT.

The differences between the two subjects have been more contrasting than I anticipated, given that some of the CS content was already being brought into the ICT curriculum. CS offers more challenging topics and the subject content is more specific compared to ICT. ICT topics were seen as more relevant by students not aspiring to pursue a career in technology. If a student wanted to be a historian or lawyer, they could still relate to ICT but when being taught CS topics and programming, they have found it less relevant to what they aim to do in the future.

With all exam boards offering courses in Computer Science rather than ICT, it was important to look closely at their respective specifications. As of date, different exam boards expect different topics to be covered in different depths at GCSE and at A Level. This has major implications on how to structure the KS3 curriculum so that students are ready to cope with the GCSE contents by the end of Year 9.

When we started teaching CS to Year 7 back in September 2013, our students were excited to learn a subject different from what the previous groups had studied. Indeed, CS was a much welcomed change for our girls. This group of students are now in Year 12. Four girls are currently studying the subject at A Level and are keen to study it at University. They are our most senior girls in the subject and the only group from WHS who have a GCSE in CS. Last year’s year 11 result in CS saw all 11 girls score a grade A or A*, (100% A*/A, 46% A*).

Unfortunately, like in many schools, after the first wave of keen Computer Scientist, the numbers of students opting for the subject has fallen. Several studies have been conducted both nationally and internationally to investigate why it has been hard to attract students to study CS. At WHS, we have taken on board these researches and have worked on a plan to address the challenges that we face. We have restructured our KS3 curriculum by introducing key challenging topics early with the aim of making students feel more comfortable and confident with the subject by the time they decide whether to continue studying CS at GCSE. I believe that one of the reasons ICT uptake at GCSE was higher than CS was because students were confident and comfortable with the ICT curriculum. The introduction of programming in early years is also very important to achieve this aim. However, it is not simple to teach complex concepts to children who are too young to learn them. Fortunately, the emergence of several pieces of “children friendly” software that allow students to learn programming through “blockly” has aided teachers incredibly. We are now able to introduce coding to students as early as Year 4. This will produce a generation of students keen and enthusiastic in CS.

On the other hand, there can be a risk of bringing challenging topics to the KS3 curriculum. Students can be put off the subject if they find it too hard. Hence, it is paramount to strike the right balance between “fun” lessons and relevant CS concepts. At WHS, we have brought various new fun activities into our KS3 curriculum. Girls are now able to use the micro:bit to program ringtones and LED strips in Year 7 (see image 1 below). They can create websites and web apps in Year 8 (see image 2 below) and they can use Minecraft and robots to enhance their programming skills in Year 9 (see image 3 below). The department also offers various extra-curricular clubs to engage the students. We are also working with our Scientists in Residence every week to reinforce knowledge learnt in the classroom.

Image 1: Year 7 have been using the micro:bit to program LED lights.

Image 2: Year 8 have been using appshed to create web apps.

Image 3: Year 9 learn how to program the picaxe 20X2 robot.

Our efforts towards promoting this new subject at WHS remain as strong as ever. We are continuously thinking of new ways to promote CS amongst the girls with a view to preparing them for their technological future. We also reach out to Universities such as Imperial College and work with them on projects that allow female students to come in and inspire our pupils. Being a Microsoft Showcase school, we are lucky to participate in events run by Microsoft and we are also looking at inviting experts to deliver talks on latest technologies and innovations in the world of CS. The future of the subject at WHS is bright and we are all ready to embrace it.

Research articles:

1.Computing or ICT: which would serve our pupils better?

https://www.theguardian.com/teacher-network/teacher-blog/2013/aug/12/computing-ict-curriculum-teaching-debate

2.Encouraging Girls to Participate in Computer Science

https://www.slideshare.net/kimarnold28/encouraging-girls-to-participate-in-computer-science-1-092014

3.School ICT to be replaced by computer science programme

http://www.bbc.co.uk/news/education-16493929

4.Women in Computer Science: Getting Involved in STEM

https://www.computerscience.org/resources/women-in-computer-science/

 

Twitter: @CS_IT_WHS