What's a stick?

Logic Level 2

A survey was conducted on different age groups to determine whether more people prefer cars with automatic transmission or manual transmission.

Age 16 to 21 Age 22 to 30 Age 31 to 50 Age 51 and higher
Automatic 90% of 100 people 60% of 200 people 50% of 300 people 50% of 400 people
Manual 80% of 400 people 40% of 300 people 40% of 200 people 40% of 100 people

According to the survey result above, what is the conclusion?

Image Credit: Flickr Sophie .
More people prefer cars with automatic transmission. More people prefer cars with manual transmission. There is no difference.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Brock Brown
Sep 18, 2015

Python 3.4:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# pairs represent (percent_of_people, total_people)
automatic = [(0.9, 100), (0.6, 200), (0.5, 300), (0.5, 400)]
manual = [(0.8, 400), (0.4, 300), (0.4, 200), (0.4, 100)]
prefer_automatic = sum([i[0] * i[1] for i in automatic])
prefer_manual = sum([i[0] * i[1] for i in manual])
if prefer_automatic == prefer_manual:
    print ("There is no difference.")
elif prefer_automatic > prefer_manual:
    print ("More people prefer automatic.")
else:
    print ("More people prefer manual.")

Did you just copied from my pastebin? This is exactly how I've done it!

Pi Han Goh - 5 years, 8 months ago

Log in to reply

I did, actually: http://pastebin.com/5EYhN9JG

Brock Brown - 5 years, 8 months ago

Simple arithmetic

For automatic: 0.9(100)+0.6(200)+0.5(300)+0.5(400)= 560

For manual: 0.8(400)+0.4(300)+0.4(200)+0.1(100)= 560

So therefore, equal ammounts of people overal like the types

Yup, I'm glad you see through the ruse. It's kinda hard to find the numbers to make them equal.

Pi Han Goh - 2 years, 8 months ago

What about the rest of the samples. For example the 10% from first group of age 16-21 do they simply stay neutral?

Ashot Melkonyan - 5 months, 1 week ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...