20201001, 11:32  #1 
Jul 2015
2^{3}×3 Posts 
October 2020

20201001, 13:28  #2 
Jan 2017
57_{16} Posts 
The control graph example image at the end ("Here's a sample program, along with its controlflow graph:") doesn't seem to load.

20201001, 18:46  #3 
Sep 2017
2×7^{2} Posts 
The question is also illposed, needs many clarifications. For example: how does the algorithm will work for negative integers? Return value of modulo operation changes from one programming language to another.

20201001, 19:57  #4 
Sep 2017
62_{16} Posts 
Here are the different results of modulo operation for negative numbers in some commonly known languages:
https://torstencurdt.com/tech/posts/...ativenumbers/ 
20201002, 05:47  #5 
Jun 2003
3053_{8} Posts 
Possible hint if I understand the question correctly (I agree that the language is not very clear).
Hint: https://cs.stackexchange.com/questions/63572/whatisthemathcaloofsubtractionbasedgcdalgorithm 
20201005, 08:13  #6 
Oct 2017
103 Posts 
Can anyone explain to me
 why the ** in "**20** lines"?  why the $ in "length $n$"?  which other path than 102030407090 is possible in the sample program?  what will say "the number of paths ... is the sequence 0,2,2,...?" Isn't the number dependent of a,b? Does 0 make sense? Perhaps I'm the only one who doesn't understand this. 
20201005, 09:40  #7  
Sep 2017
2×7^{2} Posts 
Quote:
I think ** and $ is just for formatting, and you can ignore. The sample program is not an indicator of what to expect from the real problem, let alone the missing image is not helping at all. 

20201005, 09:47  #8 
Apr 2020
5_{8} Posts 
Its similar to assembly codes
I think its about how to make jump below( jump condition on a>b or a<b) logic within 20lines btw I still dont know why they added chaos operator 
20201005, 10:17  #9 
Oct 2017
103 Posts 
It's no problem to write a code with 20 lines (not using "chaos lines", of course) for the search of the gcd, if I take a>b>0 for granted, and to draw the controlflow graph. But the paths are dependent of a and b, and so I don't know how to achieve the given sequence. And the zero!

20201005, 19:22  #10 
Jan 2017
127_{8} Posts 
I interpreted it as creating the controlflow graph based only on the existence of jump commands, so it does not depend on values of a and b. Actual behavior of the program will depend on those, but the graph won't.
I believe the sequence 0, 2, 2, ... starts from 1 for path length (that's another kindofflaw in the problem description, as it links to an OEIS sequence with a definition that doesn't match, without mentioning that you need a different offset). The 0 means that there is no direct path from the starting node in the graph to the end node, then 2 means there are 2 possible paths with 2 steps. 
20201005, 20:56  #11  
Oct 2017
67_{16} Posts 
Quote:
Meanwhile the cfg of the example can be seen, and it were a good exercise to write down the sequence: 0,0,0,1,... (there is no path of length 1,2,3 and only one path of length 4) Unfortunately I don't understand the edge from 60 to 70. 

Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
October 2019  Xyzzy  Puzzles  21  20191107 13:13 
October 2016  R. Gerbicz  Puzzles  10  20161101 13:35 
October 2015  LaurV  Puzzles  3  20151102 15:22 
October 2014  Xyzzy  Puzzles  8  20141102 19:03 
13 October is approaching!  Joe O  Prime Sierpinski Project  1  20101009 06:12 