def seq3np1(n):
""" Print the 3n+1 sequence from n, terminating when it reaches
1. args: n (int) starting value for 3n+1 sequence return: None
"""
while(n != 1):
print(n)
if(n % 2) == 0: # n is even
n = n // 2 else: # n is odd
n = n * 3 + 1
print(n) # the last print is 1
def main():
seq3np1(3)
main()
Using the provided code, alter the function as
follows:
First, delete the print statements...
1- Show that (n^3+3n^2+3n+1) / (n+1) is O (n2 ). Use the
definition and proof of big-O notation.
2- Prove using the definition of Omega notation that either 8 n
is Ω (5 n ) or not.
please help be with both
6a. Show that 2/n = 1/3n + 5/3n and use this identity to obtain
the unit fraction decompositions of 2/25 , 2/65 , and 2/85 as given
in the 2/n table in the Rhind Mathematical Papyrus.
6b. Show that 2/mn = 1/ (m ((m+n)/ 2 )) + 1/ (n ((m+n)/ 2 )) and
use this identity to obtain the unit fraction decompositions of 2/7
, 2/35 , and 2/91 as given in the 2/n table in the Rhind
Mathematical Papyrus....
Derive the Sackur-Tetrode equation starting from the
multiplicity givenin Ch. 2:
Ω =(1/N!)(V^{N}/h^{3N})(pi^{3N/2}/3N^{2}!)(2mU)^{3N/2}
The Sackur-Tetrode equation is:
S=Nk[ln((V/N)((4pi*m*U)/(3Nh^{2}))^{3/2})+(5/2)]
a) Let T(n) be a running time function defined as T(n) = 3n^2 +
2n + 5, is this ϴ(n^2 )? Explain prove your answer using the
definitions of big-o and omega notations.
b) Solve the following recurrence relations using Master
theorem.
a. ?(?) = 3? ( ?/3 ) + ?
b. ?(?) = 5?( ?/2 ) + 2?^2
please help them with both
Let sn be a Cauchy sequence such that ∀n > 1, n ∈ N, ∃m >
1, m ∈ N such that |sn − m| = 1/3 (this says that every term of the
sequence is an integer plus or minus 1/3 ). Show that the sequence
sn is eventually constant, i.e. after a point all terms of the
sequence are the same