# What part of computer science is this ?

Watch
Announcements
#1

These questions are examples of what we're currently taking in uni, I'm confused as to what we're doing and what this topic is called ?
The teacher said we were writing simple algorithms, what for ?
What's an algorithm ? Is this for the computer, an app, a program ? In real life who does this ? And if I want to solve problems like those in the picture, what can I look for on the internet ? What do I look up ?

p.s, our teacher calls the topic : Problem solving
Last edited by Leah.J; 1 year ago
0
1 year ago
#2
(Original post by Leah.J)

These questions are examples of what we're currently taking in uni, I'm confused as to what we're doing and what this topic is called ?
The teacher said we were writing simple algorithms, what for ?
What's an algorithm ? Is this for the computer, an app, a program ? In real life who does this ? And if I want to solve problems like those in the picture, what can I look for on the internet ? What do I look up ?
The first three are arithmetic operations so maths basically written in a way a computer would understand.

The last two are boolean logic operations. Using comparisons of statement to produce a true or false outcomes.

Also an algorithm is just a set of instructions.

Maybe googling boolean logic, logic gates and arithmetic operators for programming would help you.

In real life, we do use these concepts just not in this format. In order to solve problems sometimes we are required to manipulate number or react depend if someone is happening or not.
0
1 year ago
#3
(Original post by Leah.J)

These questions are examples of what we're currently taking in uni, I'm confused as to what we're doing and what this topic is called ?
The teacher said we were writing simple algorithms, what for ?
What's an algorithm ? Is this for the computer, an app, a program ? In real life who does this ? And if I want to solve problems like those in the picture, what can I look for on the internet ? What do I look up ?

p.s, our teacher calls the topic : Problem solving
It's exactly as your lecturer said, 'problem solving'.

They are all mathematical and logical statements. It's asking you to evaluate an outcome by using the rules for execution of mathematical statements learned in GCSE. i.e. in the precedence order: brackets, division, multiplication, addition, subtraction etc. There are also conditional statements to be evaluated In the same way.

In other words, the rules governing mathematical precedence and logical expression becomes the algorithm to be followed to arrive at the correct evaluation.

Yes, after determining the rules, the algorithm (sequence of instructions) is followed. The algorithm can be converted to a computer programme written in whatever programming language one chooses.
Last edited by uberteknik; 1 year ago
0
1 year ago
#4
The topic is called Computational Thinking (in layman's terms it means "how to think like a computer scientist" or "how to think like a programmer"). The examples you've got there are just a small part of that, but it's worth typing that term into Google to look for some examples of how computational thinking helps with analysing and solving problems in ways that computers are able to understand.

There's a really good video from Harvard University with a slightly more general introduction. This might help give you a bit more of the background and context of how/why computers need to work in this way: https://www.youtube.com/watch?v=5aza...mlC7sxNDH&t=0s
Last edited by winterscoming; 1 year ago
1
#5
(Original post by uberteknik)
It's exactly as your lecturer said, 'problem solving'.

They are all mathematical and logical statements. It's asking you to evaluate an outcome by using the rules for execution of mathematical statements learned in GCSE. i.e. in the precedence order: brackets, division, multiplication, addition, subtraction etc. There are also conditional statements to be evaluated In the same way.

In other words, the rules governing mathematical precedence and logical expression becomes the algorithm to be followed to arrive at the correct evaluation.

Yes, after determining the rules, the algorithm (sequence of instructions) is followed. The algorithm can be converted to a computer programme written in whatever programming language one chooses.
So we write an algorithm that would help us solve a specific problem and then this algorithm is converted to programming language so that the computer understands our language ? Or does a computer understand algorithms ? What or who converts algorithms ?

When we say problem, do we literally mean problem ? Any problem ?
And why do we have to write an algorithm, why can't we just tell the computer what to do through a programming language ?
0
1 year ago
#6
(Original post by Leah.J)
So we write an algorithm that would help us solve a specific problem and then this algorithm is converted to programming language so that the computer understands our language ? Or does a computer understand algorithms ? What or who converts algorithms ?

When we say problem, do we literally mean problem ? Any problem ?
And why do we have to write an algorithm, why can't we just tell the computer what to do through a programming language ?
An algorithm is a generic word to describe any process to solve any problem in reality. It could be, making a cup of tea say, written in plain English so that anyone else can read it and follow the same process to solve the problem or carry out an action in exactly the same way time and again.

The computer cannot understand the algorithm. Humans must first break a problem down into a sequence of instructions (and hence solve the problem generically) which other humans can understand. i.e. an algorithm is constructed - it could be in plain English, or a mathematical expression with logical statements, or a flow chart, or a route map to get from a) to b), or a recipe in a cookbook, or the pictorial instructions to assemble flat pack furniture etc. etc.

The algorithm is then converted by humans into a set of instructions written in the programming language the computer can execute.
NB the computer cannot understand the algorithm. The computer is a slave to the instructions written in the programming language it is designed to work with. It can only follow exactly the instructions written for it - nothing more, nothing less. If there are errors in the instruction, the computer executes these blindly - which is why computers sometimes crash and stop working!

A simple algorithm example might be:

a) choose a cup and put a teabag into it;
b) fill a kettle with water;
c) boil the water;
d) fill the cup with freshly boiled water;
e) remove the teabag and dispose;
f) add milk and sugar to taste;
f) stir with a spoon;
g) enjoy.

The is a very simplistic algorithm which could be improved using conditional statements and rearranging to make best use of concurrent actions to minimise the time taken to make the cup. e.g:

a) choose a cup
b) fill a kettle with enough water to fill the cup

c) test: is there enough water in the kettle?

d) if too much, then pour away some water and return to instruction c)
e) if too little, then fill more water and return to instruction c)
f) if enough water then continue to instruction g)

g) boil the water in the kettle

h) while the water is boiling choose a cup
i) while the water is boiling choose a teabag
j) place the chosen tea bag into the cup

k) test: is the water boiling?

f) if yes fill the cup with boiled water

etc. etc.
2
1 year ago
#7
(Original post by Leah.J)
So we write an algorithm that would help us solve a specific problem and then this algorithm is converted to programming language so that the computer understands our language ? Or does a computer understand algorithms ? What or who converts algorithms ?
You can use a computer language to describe (the steps for) an algorithm -- that's essentially what programming languages are for. Programming languages are quite terse though, and they're not always particularly expressive, so humans usually have a harder time thinking in terms of programming syntax compared with Plain English.

Writing it out in Plain English first is a way for a human to understand those steps before writing it in a computer language.

(Original post by Leah.J)
When we say problem, do we literally mean problem ? Any problem ?
Yes, anything which can be done objectively, deterministically, and can be described in absolute terms. The only things computers can't really do (at least not easily) is to work with things which are subjective, and opinionated (Well, that's not quite true, the programmer could create an algorithm based around her/his own opinions, in which case the computer would treat those opinions as fact) -- e.g. you can't ask a computer what it's favourite colour is (unless a programmer has already told it how to choose a favourite colour based on some pre-defined deterministic calculation), but you could write a program which analyses data collected from billions of people around the world and find out what the most popular colour is among those people.

(Original post by Leah.J)
And why do we have to write an algorithm, why can't we just tell the computer what to do through a programming language ?
The programming language is a tool which you can use to write/express an algorithm, whereas the algorithm itself is a series of steps that a computer or a human could follow in order to reach a result. You can express an algorithm in lots of ways, including any programming language, or "pseudo" code, or a flowchart..

But the reason for putting things into something more closely resembling natural/human language is that computer programs are written by humans -- as a programmer it is not possible to write the code for an algorithm without first having an understanding of that algorithm and being able to work through it by yourself (or on paper).

Furthermore, people make mistakes, so one advantage of working out an algorithm on-paper first is that you will be working it out "by hand" with some sample test data, and calculating the result for yourself. When you've written the code for it, you can then use the same sample test data and verify that the program you've written produces the same result (it should do because it should be the same algorithm, but humans are error-prone and might have done something wrong in the program's source code, so doing things 'by hand' first is really helpful for catching mistakes)/
Last edited by winterscoming; 1 year ago
0
X

new posts
Back
to top
Latest
My Feed

### Oops, nobody has postedin the last few hours.

Why not re-start the conversation?

see more

### See more of what you like onThe Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

### Poll

Join the discussion

#### If you haven't confirmed your firm and insurance choices yet, why is that?

I don't want to decide until I've received all my offers (69)
40.12%
I am waiting until the deadline in case anything in my life changes (28)
16.28%
I am waiting until the deadline in case something in the world changes (ie. pandemic-related) (7)
4.07%
I am waiting until I can see the unis in person (18)
10.47%
I still have more questions before I made my decision (19)
11.05%
No reason, just haven't entered it yet (15)
8.72%
Something else (let us know in the thread!) (16)
9.3%