Mohamed sheik sirajuddeen
have greater quest to acquire more knowledge.. become indispensable ...become invincible
Monday, January 27, 2025
Solid State Physics (SSP)
Monday, November 18, 2024
Sunday, August 18, 2024
Nuclear Advocacy Programme-2023 at ICTP, Trieste, Italy
Wednesday, July 10, 2024
Saturday, June 22, 2024
Learn Python codes for the rate of decay of atoms in radioactivity
import math
def compute_quantity(N0, lambda_, T):
N = N0 * math.exp(-lambda_ * T)
return N
# Example usage:
N0 = 100 # Initial quantity
lambda_ = 0.1 # Decay constant
T = 5 # Time
result = compute_quantity(N0, lambda_, T)
print(f"N = {N0} * exp(-{lambda_} * {T}) = {result}")
Chart a python program for the quadratic type x^2-5x+6=0 findings its roots.
import math
def solve_quadratic(a, b, c):
# Calculate the discriminant
discriminant = b**2 - 4*a*c
if discriminant < 0:
return "No real roots"
elif discriminant == 0:
# One real root
root = -b / (2*a)
return (root,)
else:
# Two real roots
root1 = (-b + math.sqrt(discriminant)) / (2*a)
root2 = (-b - math.sqrt(discriminant)) / (2*a)
return (root1, root2)
# Coefficients for the equation x^2 - 5x + 6 = 0
a = 1
b = -5
c = 6
# Solve the equation
roots = solve_quadratic(a, b, c)
print(f"The roots of the equation {a}x^2 + ({b})x + {c} = 0 are: {roots}")
Learn a program for a series (1-x)^2
ef compute_expression(x):
return (1 - x) ** 2
# Example usage:
x_value = 3
result = compute_expression(x_value)
print(f"(1 - {x_value})^2 = {result}")