100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Computational Thinking Assignment 2 $5.90
Add to cart

Case

Computational Thinking Assignment 2

 16 views  0 purchase
  • Course
  • Institution

Computational Thinking Assignment 2

Preview 2 out of 5  pages

  • June 14, 2022
  • 5
  • 2019/2020
  • Case
  • Bhulai
  • 9-10
avatar-seller
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.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller TR19. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $5.90. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

50843 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$5.90
  • (0)
Add to cart
Added