100% tevredenheidsgarantie Direct beschikbaar na betaling Zowel online als in PDF Je zit nergens aan vast
logo-home
Computational Thinking Assignment 2 €5,49   In winkelwagen

Case uitwerking

Computational Thinking Assignment 2

 14 keer bekeken  0 keer verkocht

Computational Thinking Assignment 2

Voorbeeld 2 van de 5  pagina's

  • 14 juni 2022
  • 5
  • 2019/2020
  • Case uitwerking
  • Bhulai
  • 9-10
Alle documenten voor dit vak (7)
avatar-seller
TR19
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.

Voordelen van het kopen van samenvattingen bij Stuvia op een rij:

Verzekerd van kwaliteit door reviews

Verzekerd van kwaliteit door reviews

Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!

Snel en makkelijk kopen

Snel en makkelijk kopen

Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.

Focus op de essentie

Focus op de essentie

Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!

Veelgestelde vragen

Wat krijg ik als ik dit document koop?

Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.

Tevredenheidsgarantie: hoe werkt dat?

Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.

Van wie koop ik deze samenvatting?

Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper TR19. Stuvia faciliteert de betaling aan de verkoper.

Zit ik meteen vast aan een abonnement?

Nee, je koopt alleen deze samenvatting voor €5,49. Je zit daarna nergens aan vast.

Is Stuvia te vertrouwen?

4,6 sterren op Google & Trustpilot (+1000 reviews)

Afgelopen 30 dagen zijn er 83100 samenvattingen verkocht

Opgericht in 2010, al 14 jaar dé plek om samenvattingen te kopen

Start met verkopen
€5,49
  • (0)
  Kopen