anonymous
  • anonymous
Consider the following algorithm. for i is in {1, 2, 3, 4} do beep for j is in {1, 2, 3, 4} do beep for k is in {1, 2, 3} do for l is in {1, 2, 3, 4, 5, 6} do beep for m is in {1, 2, 3, 4, 5} do beep How many times does a beep statement get executed?
Discrete Math
schrodinger
  • schrodinger
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this
and thousands of other questions

IrishBoy123
  • IrishBoy123
check the indents which are absolutely crucial but indexed like this in Python ==> **152** times x = 0 for i in range(1,5): x+=1 for j in range(1,5): x+=1 for k in range(1,4): for l in range(1,7): x+=1 for m in range(1,6): x+=1 print x NB "range" doesn't run on the last item in Python so range(1,5) \(\equiv\) {1,2,3,4} assuming that is how your source works
anonymous
  • anonymous
Thank you! I tried calculating, but did not get it. So, I have to add 1 to every range? and then add them all together and multiply by 4? is that how you got the final answer?
IrishBoy123
  • IrishBoy123
no i just re-wrote the instructions in Python and ran it you could work it out by hand, of course you could.

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.