Leah.J
Badges: 13
Rep:
?
#1
Report Thread starter 4 months ago
#1
Name:  Screenshot (5).png
Views: 18
Size:  100.0 KB
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; 4 months ago
0
reply
Routeri
Badges: 15
Rep:
?
#2
Report 4 months ago
#2
(Original post by Leah.J)
Name:  Screenshot (5).png
Views: 18
Size:  100.0 KB
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
reply
uberteknik
  • Study Helper
Badges: 21
Rep:
?
#3
Report 4 months ago
#3
(Original post by Leah.J)
Name:  Screenshot (5).png
Views: 18
Size:  100.0 KB
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; 4 months ago
0
reply
winterscoming
Badges: 19
Rep:
?
#4
Report 4 months 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; 4 months ago
1
reply
Leah.J
Badges: 13
Rep:
?
#5
Report Thread starter 4 months ago
#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
reply
uberteknik
  • Study Helper
Badges: 21
Rep:
?
#6
Report 4 months 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?

l) if no, then return to instruction g)
f) if yes fill the cup with boiled water

etc. etc.
2
reply
winterscoming
Badges: 19
Rep:
?
#7
Report 4 months 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; 4 months ago
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

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

Personalise

University open days

  • The University of Law
    Solicitor Series: Assessing Trainee Skills – LPC, GDL and MA Law - Exeter campus Postgraduate
    Thu, 27 Feb '20
  • University of East Anglia
    PGCE Open day Postgraduate
    Sat, 29 Feb '20
  • Edinburgh Napier University
    Postgraduate Drop-in Brunch Postgraduate
    Sat, 29 Feb '20

Do you get study leave?

Yes- I like it (276)
61.06%
Yes- I don't like it (22)
4.87%
No- I want it (120)
26.55%
No- I don't want it (34)
7.52%

Watched Threads

View All