{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 13 : Introduction to statistical thermodynamics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.1 page no : 474"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "p1 = 1./6;\t\t\t#probability for the first throw gives 6\n",
      "p2 = 1./6;\t\t\t#probability for the first throw gives 5\n",
      "n = 2;\t    \t\t#the no.of dice are two\n",
      "\n",
      "# Calculations\n",
      "p = p1*p2*n;\t\t\t#the required probability is\n",
      "\n",
      "# Result\n",
      "print 'the required probability is %3.2f'%(p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the required probability is 0.06\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.2 pageno : 474"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "p1 = 4./52;\t\t\t#the probability for getting ace in first draw is\n",
      "p2 = 3./51;\t\t\t#the probability for getting ace in second draw is\n",
      "p3 = 2./50;\t\t\t#the probability for getting ace in third draw is\n",
      "p4 = 1./49;\t\t\t#the probability for getting ace in fourth draw is\n",
      "\n",
      "# Calculations\n",
      "p = p1*p2*p3*p4;\t\t\t#total probability is\n",
      "\n",
      "# Result\n",
      "print 'total probability is %3.9f'%(p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "total probability is 0.000003694\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.3 page no : 475"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "n = 12.;\t\t\t#no.of particles\n",
      "n1 = 8.;\n",
      "n2 = 4.;\n",
      "\n",
      "# Calculations\n",
      "p = n*(n-1)*(n-2)*(n-3)/(n2*(n2-1)*(n2-2)*(2**n));\t\t\t#probability of distribution (8,4)\n",
      "\n",
      "# Result\n",
      "print 'probability of distribution 8(4) is %3.5f'%(p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "probability of distribution 8(4) is 0.12085\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.4 page no: 475"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "m = 32;\t\t\t#mass of the oxygen molecule in gm\n",
      "n = 1.67*10**-27;\t\t\t#mass of one electron\n",
      "k = 1.38*10**-23;\t\t\t#boltzzmann consmath.tant in ergs/cal\n",
      "t = 200;\t\t\t#temperature of the oxygen in K\n",
      "c = (100.+101)/2;\t\t\t#average speed of the oxygen molecule in m/s\n",
      "\n",
      "# Calculations\n",
      "a = m*n/(2*3.14*k*t);\n",
      "p = 4*3.14*(a**(3./2))*(c**2)*(2.303**(-a));\t\t\t#probability that the oxygen speed is lies between in m/sec\n",
      "\n",
      "# Result\n",
      "print 'probability that the oxygen speed is lies between is %3.6e m/sec'%(p)\n",
      "print \"Note : answer is slightly different because of rounding error.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "probability that the oxygen speed is lies between is 6.867794e-04 m/sec\n",
        "Note : answer is slightly different because of rounding error.\n"
       ]
      }
     ],
     "prompt_number": 10
    }
   ],
   "metadata": {}
  }
 ]
}