100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Case

Computational Thinking Assignment 2

Rating
-
Sold
-
Pages
5
Grade
9-10
Uploaded on
14-06-2022
Written in
2019/2020

Computational Thinking Assignment 2

Institution
Course









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Course

Document information

Uploaded on
June 14, 2022
Number of pages
5
Written in
2019/2020
Type
Case
Professor(s)
Bhulai
Grade
9-10

Subjects

Content preview

Computational Thinking – Assignment 2 (Artificial Intelligence Year 1)


1. Pirate treasure

Jack can bury the treasure in 5 hours. This means he can bury 1/5th of the treasure in 1
hour.
Will can bury the same treasure in 20 hours. This means he can bury 1/20th of the treasure
in 1 hour.

Together in 1 hour they can bury: 1/5 + 1/20 = 1/4th of the treasure.
This means 1 x 4 = 4 hours for 4/4th of the treasure (=the whole treasure).

It will take the two pirates 4 hours to bury the treasure together.

a xb
You can also use this formula: .
a+ b
a xb 5 x 20
= = 4 hours
(a+ b) (5+20)


Type of strategy/algorithm: “divide the problem into several steps”. I solved the problem by
simplifying the problem and dividing it into a few simple steps.
Also, the strategy “use of formula” fits here. This is a faster way to solve the problem. You
can see there are multiple ways to solve this problem.

2. Sharing pizza

A) The three friends all want to try every pizza. Karen divides the three pizzas into 12 slices
each. Carol does not like salami but wants to have a slice with only mozzarella. On six slices
there is salami, on ten slices mozzarella. Molly does not like mozzarella and wants to eat
every slice with salami only.
Pizza 1: mozzarella and salami.
 Divided into 12 slices
⁃ 6 with salami
⁃ 10 with mozzarella
This means that there are 4 slices with both
mozzarella and salami.
So, this makes a distribution of 2 salami only - 6
mozzarella only - 4 with both
Carol can eat 6 slices of the mozzarella and salami pizza, because she eats slices with
mozzarella only.
B) There are 12 slices total. On 6 slices there is salami, on 10 slices there is mozzarella.
That would mean a total of 16 slices if you didn’t think of the fact that there can be a
combination of mozzarella and salami on one slice. But in this case, there are slices with
both mozzarella and salami. So, 16 – 12 = 4 slices have both mozzarella and salami.
Type of strategy/algorithm: “divide the problem into several steps”. I solved the problem by
simplifying the problem and dividing it into a few simple steps.

, Computational Thinking – Assignment 2 (Artificial Intelligence Year 1)


C) Molly does not like mozzarella and wants to eat every slice with salami only. Molly also
wants a single slice of every other pizza. She gets 2 slices of the mozzarella and salami
pizza (because this is the number of slices with salami only), 1 slice of the pizza with tuna
and 1 slice of the pizza with mushrooms.
Molly gets 4 slices pizza in total.

3. Pooling resources

A) There are 2 USB stands. Alice decided to price her USB sticks at 2 for 10 euro, while Bob
was thinking 3 for 20 euro. If they decide to combine forces, they can sell their products 5 for
30 euro.
If Alice and Bob decide to sell their USB sticks separately, Alice would sell a single USB stick
for = 5 euro and Bob for = 6,67 euro.
The average price per USB stick will be (5 + 6,67) / 2 = 5,83 euro
If they decide to sell together, the price of a single USB stick would be = 6 euro.
Alice and Bob can get a higher result working together, because the average price per USB
stick is higher. At least if you assume that all offered USB sticks will be sold.
B) Chris was thinking of selling his USB sticks at 2 for 10 euro = 1 for 5 euro. Diane was
thinking of selling hers at 3 for 10 euro = 1 for 3,34 euro. They decided to pool their
resources, selling their USB sticks at 5 for 20 euro = 1 for 4 euro.
If Chris and Diane sell their USB sticks separately, together they would make:
30 x 5 + 3,34 x 30 = 250 euro.
If they combine forces, they would make: 4 x 60 = 240 euro.
It is not a good idea for Chris and Diana to combine their resources. Their result would be
less.

4. Nim

A) We have a pile of 21 matchsticks. Two players take turns and can remove at least 1 and
maximal 5 matchsticks. The players cannot repeat each other’s moves. The player who
removes the last matchstick, wins the game.
My solution: A winning strategy does exist for this game. The first player (who can remove
the first matchstick) should be the one to use this strategy.

I am going to explain this strategy by counting from 21 to 0.

First you (player 1) take 1 matchstick to drop it to 20 matchsticks. Then you need to make
sure you that there are 13 matchsticks left (and it’s your turn). I demonstrated this below:

21 - 1 = 20 (player 1 his move)
20 - 2/3/4/5 = 18/17/16/15 (player 2 his move)

Now you (player 1) can always make (the number of matchsticks left on the pile) 13 by
responding to player 2. The last step of the winning strategy is that you need to make sure
there are 7 matchsticks left. Check the next page to see what I mean.
$6.66
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
TR19

Also available in package deal

Get to know the seller

Seller avatar
TR19 Vrije Universiteit Amsterdam
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
9 year
Number of followers
0
Documents
7
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions