Ask your own question, for FREE!
Discrete Math 17 Online
OpenStudy (anonymous):

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.

OpenStudy (anonymous):

not my style of question. haha

OpenStudy (amistre64):

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

OpenStudy (anonymous):

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

OpenStudy (amistre64):

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

OpenStudy (amistre64):

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

OpenStudy (anonymous):

I will do a screenshot and paste it here hang on

OpenStudy (anonymous):

Here it is

OpenStudy (amistre64):

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

OpenStudy (amistre64):

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

OpenStudy (amistre64):

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

OpenStudy (amistre64):

x = 7606 if its 1 to start with

OpenStudy (anonymous):

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

OpenStudy (amistre64):

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 ...

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!