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)]
1. a) Prove that if n is an odd number then 3n + 1is an even
number. Use direct proof.
b) Prove that if n is an odd number then n^2+ 3 is divisible by
4. Use direct proof.
2. a) Prove that sum of an even number and an odd number is an
odd number. Use direct proof.
b) Prove that product of two rational numbers is a rational
number. Use direct proof.
3. a) Prove that if n2is...
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
Null graph,Nn, n=1,2,3,4...,the graph with n vertices and no
edges. (N4=4 vertices with no edges)
4 a) find a graph with 8 vertices with no 3-cycles and no
induced sub graph isomorphic to N4
b)prove that every simple graph with 9 vertices with no 3-cycles
has an induced sub graph isomorphic to N4