Computational thinking Worksheet 5, Exercises of Computer science

Computer Science is the study of computers and computational systems. It involves understanding the theory, design, development, and application of software and hardware to solve problems efficiently. This field covers areas such as algorithms, programming languages, data structures, artificial intelligence, computer networks, cybersecurity, and software engineering. Computer science plays a crucial role in advancing technology and impacting various industries through innovation and automation.

Typology: Exercises

2023/2024

Uploaded on 06/11/2025

wdcv-sdcsdv
wdcv-sdcsdv 🇬🇧

4 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Worksheet 5 Problem recognition
Unit 10 Computational thinking
Worksheet 5 Problem recognition
Task 1
1. Write an algorithm to allow the user to enter an integer number for the number of paper
bags, and a second integer (which must be greater than the first) for the number of
sweets. The program then tells the user whether it is possible to put an odd number of
sweets in each bag.
B= int(input(“How many bags”))
S= int(“input(“how many sweets”))
If S<B then
Print(“please insure that the sweet amount is greater than the bag amount”)
EndIf
If S % B == 0 then:
Print(“It is possible.”)
Else
Print(“ it is not possible”)
EndIf
Task 2
2. There are many way of solving a problem, including:
simulation
enumeration – list all cases
trial and error
theoretical approach
creative solution
a. Which of the methods listed above could you use to find the cube root of 729?
(i) Write down the answer (what is the cube root of 729)?
Enumeration
(ii) Write down the steps you took to find the answer
Listing the cubes of integers until reaching 729 (1, 8, 27, 64, 125, 216, 343, 512,
729).
1
pf3

Partial preview of the text

Download Computational thinking Worksheet 5 and more Exercises Computer science in PDF only on Docsity!

Unit 10 Computational thinking

Worksheet 5 Problem recognition

Task 1

  1. Write an algorithm to allow the user to enter an integer number for the number of paper bags, and a second integer (which must be greater than the first) for the number of sweets. The program then tells the user whether it is possible to put an odd number of sweets in each bag. B= int(input(“How many bags”)) S= int(“input(“how many sweets”)) If S<B then Print(“please insure that the sweet amount is greater than the bag amount”) EndIf If S % B == 0 then: Print(“It is possible.”) Else Print(“ it is not possible”) EndIf

Task 2

  1. There are many way of solving a problem, including:
    • simulation
    • enumeration – list all cases
    • trial and error
    • theoretical approach
    • creative solution a. Which of the methods listed above could you use to find the cube root of 729? (i) Write down the answer (what is the cube root of 729)?

Enumeration

(ii) Write down the steps you took to find the answer

Listing the cubes of integers until reaching 729 (1, 8, 27, 64, 125, 216, 343, 512,

Unit 10 Computational thinking

b. What method(s) could you use to estimate the probability of throwing a double six with two dice? Simulation

Conduct a large number of trials by rolling two dice repeatedly and recording how

many times a double six occurs. This empirical data can provide an estimate of the

probability.

c. Add up all the numbers between 1 and 50. What method of solution did you use?

d. On a computer network, if two devices using the same line try to transmit at exactly the same time, a “collision” occurs. The network detects the collision and both transmissions are discarded. Can you think of a solution to this problem? Which of the problem-solving methods is applicable? e. Scientists working at Bletchley Park on the Enigma code during WWII eventually managed to decode the messages sent by the Germans, even though the “key” was changed daily. What problem solving techniques do you think would be effective in cracking what was supposed to be an “uncrackable” code? f. Environmental scientists want to study the effects on the rabbit population in a particular area if a cull of foxes is carried out. What problem-solving method could be applied?