1. Compute the factorials of the following numbers: 10, 30, and 60. (15 points)
ID: 3792410 • Letter: 1
Question
1. Compute the factorials of the following numbers: 10, 30, and 60. (15 points)
a. Directly.
b. Using Stirling’s approximation
c. Compute the error in ln x! that results from each approximation.
2. Consider a hypothetical crystal containing 4 distinguishable lattice sites and 4 identical particles to occupy those sites. The crystal has a total energy, U = 4u and the energy level of the particles are quantized and equally spaced such that: 0 = 0u, 1 = 1u, 2 = 2u, etc.
a. How many different distributions of the particles among the energy levels are there? Show the distributions as in Figure 4.1. (10 points)
b. How many different arrangements are there within each distribution? Show the arrangements as in Figure 4.2. (10 points)
c. Calculate for each distribution and compare to part b. (5 points)
d. Calculate the probabilities of observing each distribution and state which distribution is most probable. (5 points)
3. Consider an insulated container of NA molecules of an ideal gas. Initially, a partition keeps all the molecules in the left half of the container. At some time, the partition is removed from the container.
a. What happens when the partition is removed? Is this a spontaneous process or not? Provide sketches of the initial and final states. (5 points)
b. Using Boltzmann’s equation, give an expression for the entropy of the initial state of the container. (5 points)
c. Repeat part b for the final state of the system. (5 points)
d. Compare your expressions of entropy in parts b and c. How does this support your answer to part a? (5 points)
Explanation / Answer
1a) The Factorial of a given number 10 is 3628800
b) The Factorial of a given number 30 is 2.65252859812191E+32
c) The factorialof a given number 60 is 8.32098711274139E+81
The best way to find the Factorial of a number is
FUNCTION fact(N):
ans = 1
for i = 1 to N
ans = ans * 1
return ans
C program to find the Factorial of a number:
# include <stdio.h>
int main()
{
int n,i;
unsigned long long factorial = 1;
printf("Enter an integer: ");
scanf("%d", &n);
// show error if the user enters negative number
if (n<0)
printf("Error! negatine number factorial does not exist."):
else
{
for(i=1; i<=n; i++)
{
factorial *= i; //factorial=factorial*i;
}
printf("Factorial of %d = ",n,factorial);
}
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.