Question: The second Xenoravon module takes an integer input and outputs a value that resembles the length of a Collatz Conjecture sequence. Although it isn't likely

The second Xenoravon module takes an integer input and outputs a value that resembles the
length of a Collatz Conjecture sequence. Although it isn't likely the Xenoravons know anything
about Lothar Collatz, in 1937 he made a conjecture about whether two simple mathematical
operations will eventually transform every positive integer into 1. The operations that are part of his
conjecture are:
If the number is even, divide it by two.
If the number is odd, triple it and add one.
For example, given the number 5, since it is odd, you would triple it (15) and add 1 to get 16(one
step). Since 16 is even, you will divide it by two to get 8(two steps). Since 8 is even, you would
divide it by two to get 4(three steps). Since 4 is even, you would divide it by two and get 2(four
steps). FInally, since 2 is even, you divide it by two and end up with one (5 steps). So, the length of
the Collatz Conjecture sequence for the input of 5 is 5.
There is currently no proof that these operations will eventually transform all positive integers to the
value 1, but that is not your problem - the Xenoravons appear to think it does and are using it for
their coded communications. All you need to do is create a flowchart that will count the number
steps that occur given a specific input integer value, until that value is transformed to become 1.
Your flowchart will take an input N, and print as its result the number of operations needed to
transform N to the value 1. Each bullet point given above is considered a single operation.
Again, once you have perfected your flowchart, you will need to test it by hand on given inputs to
see if it gives the same output that the Xenoravon module gives. Try it on the following inputs and
give the resulting output:
10,12. How to make flowchart for this
The second Xenoravon module takes an integer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!