summaryrefslogtreecommitdiff
path: root/Heat_And_Thermodynamics_by_A._Manna/ch13.ipynb
blob: daac0e6598675c4a6c15f110f61693aea92bfba5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
{
 "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": {}
  }
 ]
}