Develop software that can be used to investigate

Assignment Help Other Subject
Reference no: EM133306430

ASSESSMENT DETAILS 

Introduction.

Task 1

In this assignment you are required to develop software (a set of functions) that can be used to investigate/research the unsolved mathematical problem called Although the problem is considered to be very difficult, its formulation can be understood by a school student:
Collatz Conjecture: Consider the following operation on an arbitrary positive inteux., n, which we denote f(n):
- If the number n is even, the f(n) = n/2.
- If the number n is odd, f(n) 3*n + 1.

Now form a sequence (a Collatz sequence) by performing this operation repeatedly, beginning with a positive integer, n, and taking the result at each step as the input at the next. You stop once you reach 1.

For example, if n = 3, then the sequence will be:
[3, 10, 5, 16, 8, 4, 2, 1]
Or for n = 7 the sequence is:
(7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1) You can see that in both examples we eventually reach 1.

The Collets Conjecture claims that this is always true, i.v., the process will eventually reach the number 1, regardless ot which positive integer n is chosen initially.

Task 2. Function maxLengths(m).

In this task you are required to write a Python function, maxLength, that returns two integers:

'First returned value: for each integer k, 1≤ k ≤ m, the length of Collatz sequence for each k is computed and the largest of these numbers is returned.

'Second returned value is the integer k, 1 ≤ k ≤ m, whose Collatz sequence has largest length. In case there several such numbers, return the first one (the smallest).

For example, maxLength(10) returns numbers 20 and 9

Which means that among the numbers 1, 2, 3,..., 10, nine has the longest Collatz sequence, and its length is equal to 20.

In your program you may define other (auxiliary) functions with arbitrary names, however, the solution function of this task should be named maxLength(m).

Task 3. Function maxValue(m).

In this task you are required to write a Python function, maxValue, that returns two integers:

'First returned value: for each integer k, 1 S k S m, the maximal integer in the Collatz sequence for k is computed and the largest of these numbers is returned.

'Second returned value is the integer cma4 1 S k S m, whose Collatz sequence Page
;NM the largest maximal member. In 1of6
case there are several such numbers,
return the first one (the smallest).
For example, maxValue(10)returns the numbers
52 and 7

Which means that among the numbers 1, 2, 3,..., 10, seven has the largest maximal number in its Collatz sequence, and that number is equal to 52.

In your program you may define other (auxiliary) functions with arbitrary names, however, the solution function of this task should be named maxValue(m).

Task 4. Function main().
In this task you are required to write a function main() where you test your functions. The output should be similar to the following:

RESTART: Ci/MyPiage/2021/Sesester_2/1TECH1400/A_I/al_collatz.py -------. Enter a positive Integer:
100000
For nunhers <- 100000:
77031 has the longest Collatz sequence. The length is 351.
77671 has the largest number In its ColLatz sequence. The number is 1570824736.

>>>

Verified Expert

Python program to generate collatz sequence for the given number. Finding collatz length which is longest among all. And finding colleg value which is largest among all collaz sequence.

Reference no: EM133306430

Questions Cloud

What do the spinal cords dorsal and horns direct : What do the spinal cord's dorsal/ventral/lateral horns direct? What type of signal do the spinal nerve's ventral/dorsal roots carry?
Routine audit of software : A routine audit of software for which you are responsible reveals that one of the physicians in the hospital where you work is routinely upcoding while billing
Design a workflow for talent acquisition : Design a workflow for talent acquisition with the following givens: The company is a service provider which manages a certain lab for manufacturing companies
Analyze areas for collaboration between hr and managers : Analyze two areas of critical importance for collaboration between HR and managers when making staffing decisions. Recommends a process and elements
Develop software that can be used to investigate : Develop software (a set of functions) that can be used to investigate/research the unsolved mathematical problem called Although the problem
Discuss three qualities that make ethical leaders : Compare the features of functional teams with the features of self-directed teams. Are functional teams more effective than self-directed teams?
How do you find good people who want to work : How do you find good people who WANT to work? How can you acquire and keep top talent as an organization? Organizations are in a war to hire talented employees
Describe conditions that would lead to job dissatisfaction : Identify and briefly describe a context with which you are familiar that could be facing such a situation now or in the future.
Determining whether to continue serving client : What factors should be considered when determining whether to continue serving a client?

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd