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
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 13: Introduction to statistical thermodynamics"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 13.1: The_probability.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"\n",
"//INPUT\n",
"p1=1/6;//probability for the first throw gives 6\n",
"p2=1/6;//probability for the first throw gives 5\n",
"n=2;//the no.of dice are two\n",
"\n",
"//CALCULATIONS\n",
"p=p1*p2*n;//the required probability is\n",
"\n",
"//OUTPUT\n",
"mprintf('the required probability is %3.2f',p)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 13.2: The_probability_of_drawing_four_aces.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"\n",
"//INPUT\n",
"p1=4/52;//the probability for getting ace in first draw is\n",
"p2=3/51;//the probability for getting ace in second draw is\n",
"p3=2/50;//the probability for getting ace in third draw is\n",
"p4=1/49;//the probability for getting ace in fourth draw is\n",
"\n",
"//CALCULATIONS\n",
"p=p1*p2*p3*p4;//total probability is\n",
"\n",
"//OUTPUT\n",
"mprintf('total probability is %3.7f',p)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 13.3: The_probability_of_distributio.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"\n",
"//INPUT\n",
"n=12;//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));//probability of distribution (8,4)\n",
"\n",
"//OUTPUT\n",
"mprintf('probability of distribution (8,4) is %3.5f',p)"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 13.4: The_probability.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"clc\n",
"clear\n",
"\n",
"//INPUT\n",
"m=32;//mass of the oxygen molecule in gm\n",
"n=1.67*10^-27;//mass of one electron\n",
"k=1.38*10^-23;//boltzzmann constant in ergs/cal\n",
"t=200;//temperature of the oxygen in K\n",
"c=(100+101)/2;//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));//probability that the oxygen speed is lies between in m/sec\n",
"\n",
"//OUTPUT\n",
"mprintf('probability that the oxygen speed is lies between is %3.16f m/sec',p)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Scilab",
"language": "scilab",
"name": "scilab"
},
"language_info": {
"file_extension": ".sce",
"help_links": [
{
"text": "MetaKernel Magics",
"url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
}
],
"mimetype": "text/x-octave",
"name": "scilab",
"version": "0.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|