Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[30 pts.] Question 3: Complexity of Songs You may be familiar with the children's song Old MacDonald Had a Farm. The first verse is Old

image text in transcribed

[30 pts.] Question 3: Complexity of Songs You may be familiar with the children's song "Old MacDonald Had a Farm." The first verse is Old MacDonald had a farm, E-I-E-1-O. And on that farm he had a cow, E-I-E-1-O With a moo-moo here and a moo-moo there, Here a moo, there a moo Everywhere a moo-moo, Old MacDonald had a farm, E-I-E-1-O. In successive verses, more animals are added, and the middle refrain gets longer and longer. For example, the second verse is: Old MacDonald had a farm, E-I-E-1-O. And on that farm he had a pig, E-I-E-I-O. With an oink-oink here and an oink-oink there, Here an oink, there an oink Everywhere an oink-oink, With a moo-moo here and a moo-moo there, Here a moo, there a moo Everywhere a moo-moo, Old MacDonald had a farm, E-I-E-1-O. [20 pts.] Question 3a Now, suppose that we consider singing the song "Old MacDonald Had a Farm" to be an algorithm, and we count singing one word as an operation. Then, perform an exact analysis for this algorithm. That is, what is the exact number of words sung in N verses? Explain how you arrived at this expression. You may assume that all animal names and animal sounds used in the song are one word each. Further, you should count hyphenated words (such as E-I-E-I-O and moo-moo) as one word [10 pts.] Question 3b Given your analysis from question (3a), and again assuming that we treat each word sung as one operation, what is the order of magnitude for the "Old MacDonald" algorithm

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

1 . 1 9 : Find i in the network of Figure below:

Answered: 1 week ago

Question

1 . Television News channels importantance of our Life pattern ?

Answered: 1 week ago