Assignment 2 - Computational Thinking
Assignment 2 - Computational Thinking
1) Jack can bury a treasure in 5 hours, therefore his speed is s1 = ⅕ = 0.2 treasures/hours.
Will, on the other hand buries a treasure in 20 hours, so at a speed of s2 = 1/20 = 0.05
treasures/hour.
To calculate the amount of time they need in order to bury a treasure together we just
have to add the two values of their speed.
So they would bury a treasure together a treasure at a speed of s3 = s1 + s2 = 0.2 +
0.05 = 0.25 treasures / hour. That means that to bury one treasure it would take 1 / 0.25 = 4
hours.
To conclude it will take them 4 hours to bury the treasure together. To solve this problem
I used the method of equations and mathematical operations.
2) a) There are 10 slices with mozzarella on them, 6 with salami, and 12 in total from the
pizza with salami and mozzarella. Therefore, there should be 16 - 12 = 4 slices of pizza
with mozzarella and salami on them. In that case, there are 6 - 2 = 4 slices with only
salami on them and 10 - 4 = 6 slices with only mozzarella on them. So, if Carol doesn’t
want any salami slices and wants only mozzarella ones, she can get 6 slices from the
Mozzarella and Salami pizza.
b) As mentioned before, there are 4 slices with mozzarella and salami on them, because
16 slices are to many ( 16 > 12 ). To solve this, I used logic and diving the problem into
multiple steps, which are finding the number of pizza slices with mozzarella and salami
which leads to finding the number of pizza slices with only mozzarella or salami on them.
c) Molly gets all the slices with only salami on them, so 2 and one slice of each of the
other pizzas. Therefore, she takes 2 slices from the first pizza, 1 slice from the pizza with
tuna and last but not least, one slice from the pizza with mushrooms. In total, Molly gets
4 slices of pizza.
3) a) Alone, Alice is making (selling 2 for 10 and having a total of 30) 150 euros and Bob is
making (selling 3 for 20 and having a total of 30 as well) 200 euros. That makes up to a
total of 350 euros for selling 60 usb sticks. This means that they make 350/60 = 35/6
euros for one stick. Whereas, if they work together, by selling 5 sticks for 30 euros, they
make 12 * 30 = 360 euros for selling the same amount of chargers, which of course,
means that they make 360/60 = 6 euros for one stick and 6 > 35/6. So, selling together
will benefit them more than doing it by themselves.
b) Chris is selling 2 usb sticks for 10 euros and makes a total amount of 150 ( all 4 have
the same amount of usb sticks) and Diane is selling 3 for 10, so she makes a total of 100.
Alone, they make 250 euros, which means that they make 250/60= 25/6 for one stick. Together,
by selling 5 for 20, they would make a total amount of 12 * 20 = 240 euros, so 240/60= 4 euros
for 1 stick, and 4 < 25/6. So, it is less profitable for them to sell them together, with this
marketing strategy at least.
4) a) In order to win, the player who starts must take out only one matchstick, then he
needs to arrive on 13 and make the opponent arrive on 7. Therefore, 7 is a losing
position for the player who has the turn, because no matter what he does, he loses. The
same applies with 13, since whatever he does, the first player will be able to get to 7 and
therefore, win the game.
9 and 10 are always winning positions for the player who about to move because
he can easily get the other player to 7 and as mentioned before, win.
Also, if a player arrives on 6 and has to make a move, he automatically wins
because he can pick 3 and since you can’t pick the same amount of matchsticks twice in
a row, the other player is not able to do anything.
To conclude, the winning strategy is to start the game and get the key numbers,
which are 20, 13 and 7. With this strategy, the first player can control what will happen
next and the opponent cannot predict his next move
b) To solve this problem, I used brute force as well as trying all the possibilities by
evaluating all the possible positions. Another possibility would have been, going
backwards and leading the game, making the opponent make certain moves in some
way.
5) Considering that each helicopter’s fuel tank gets it to half of the desert, we need multiple
ones. As we can see in the drawing , a total of 3 extra helicopters seem enough to get
the president past the desert. The first helicopter flies until ¼ of the total distance, so
consumes half of its tank (the same applies for the third) Someone transfers the fuel
from the first to the second, and from the third to the president’s helicopter. With 2
helicopters left, they both fly until ½ of the total distance and the last secondary
helicopter transfers the amount of fuel left in its tank ( a half) to the president’s and with a
tank full, this will take the president until the other side of the desert. The other 3
helicopters will remain stranded in the desert, but as does not seem to be a problem, by
reading the problem given. The goal of the trip is to take the president on the other side
of the desert, by any means necessary, for the safety of his country!)