Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

vknight33

Consider the following algorithm. x ← 1 for i is in {1, 2, 3, 4} do for j is in {1, 2, 3} do x ← x + x for k is in {1, 2, 3, 4, 5, 6} do x ← x + 1 x ← x + 5 Count the number of + operations done by this algorithm.

  • 10 months ago
  • 10 months ago

  • This Question is Open
  1. chris00
    Best Response
    You've already chosen the best response.
    Medals 0

    not my style of question. haha

    • 10 months ago
  2. amistre64
    Best Response
    You've already chosen the best response.
    Medals 0

    it looks like some type of for/next looping but the syntax is hard to parse

    • 10 months ago
  3. vknight33
    Best Response
    You've already chosen the best response.
    Medals 0

    Its suppose to be discrete mathematics. I am not a math person at all.

    • 10 months ago
  4. amistre64
    Best Response
    You've already chosen the best response.
    Medals 0

    its countable ... but the syntax/notation is hard to read thru. without knowing what the format is trying to convey its difficult to understand the process that is being described

    • 10 months ago
  5. amistre64
    Best Response
    You've already chosen the best response.
    Medals 0

    was this a write up or did you copy/paste it?

    • 10 months ago
  6. vknight33
    Best Response
    You've already chosen the best response.
    Medals 0

    I will do a screenshot and paste it here hang on

    • 10 months ago
  7. vknight33
    Best Response
    You've already chosen the best response.
    Medals 0

    Here it is

    • 10 months ago
    1 Attachment
  8. amistre64
    Best Response
    You've already chosen the best response.
    Medals 0

    hmm, im guessing it follows as such: x = 1 for i = 1 to 4 for j = 1 to 3; x=x+x for k = 1 to 6; x=x+1, x=x+5 4(3(1)+6(2)) operations is what it looks like to me

    • 10 months ago
  9. amistre64
    Best Response
    You've already chosen the best response.
    Medals 0

    x=n [x = n+n x = (n+n)+(n+n) x = (n+n)+(n+n)+(n+n)+(n+n) = 8(n) ] [x = 8(n)+6] x = 1 x'= 8(1)+6 x'= 8(8(14)+6)+6 x'= 8(8(8(14)+6)+6)+6 x'= 8(8(8(8(14)+6)+6)+6)+6 x = 60854

    • 10 months ago
  10. amistre64
    Best Response
    You've already chosen the best response.
    Medals 0

    pfft, i left the 14 in there ... should be a 1 :)

    • 10 months ago
  11. amistre64
    Best Response
    You've already chosen the best response.
    Medals 0

    x = 7606 if its 1 to start with

    • 10 months ago
  12. vknight33
    Best Response
    You've already chosen the best response.
    Medals 0

    Is that the answer for "Count the number of + operations done by this algorithm."

    • 10 months ago
  13. amistre64
    Best Response
    You've already chosen the best response.
    Medals 0

    of course not, i already surmised the results for that .... this was just an attempt to actually work the algorithm to see what the output would give us ...

    • 10 months ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.