In [1]:

```
# Variables
p1 = 1./6; #probability for the first throw gives 6
p2 = 1./6; #probability for the first throw gives 5
n = 2; #the no.of dice are two
# Calculations
p = p1*p2*n; #the required probability is
# Result
print 'the required probability is %3.2f'%(p)
```

In [1]:

```
# Variables
p1 = 4./52; #the probability for getting ace in first draw is
p2 = 3./51; #the probability for getting ace in second draw is
p3 = 2./50; #the probability for getting ace in third draw is
p4 = 1./49; #the probability for getting ace in fourth draw is
# Calculations
p = p1*p2*p3*p4; #total probability is
# Result
print 'total probability is %3.9f'%(p)
```

In [3]:

```
# Variables
n = 12.; #no.of particles
n1 = 8.;
n2 = 4.;
# Calculations
p = n*(n-1)*(n-2)*(n-3)/(n2*(n2-1)*(n2-2)*(2**n)); #probability of distribution (8,4)
# Result
print 'probability of distribution 8(4) is %3.5f'%(p)
```

In [10]:

```
# Variables
m = 32; #mass of the oxygen molecule in gm
n = 1.67*10**-27; #mass of one electron
k = 1.38*10**-23; #boltzzmann consmath.tant in ergs/cal
t = 200; #temperature of the oxygen in K
c = (100.+101)/2; #average speed of the oxygen molecule in m/s
# Calculations
a = m*n/(2*3.14*k*t);
p = 4*3.14*(a**(3./2))*(c**2)*(2.303**(-a)); #probability that the oxygen speed is lies between in m/sec
# Result
print 'probability that the oxygen speed is lies between is %3.6e m/sec'%(p)
print "Note : answer is slightly different because of rounding error."
```