SlideShare a Scribd company logo
1 of 68
Maths and Programming
Omar Bashir
Introduction
Studied at College of Aeronautical Engineering,
PAF Academy Risalpur.
Graduated as an avionics systems engineer.
Further Education
Further Education
MSc IT (Electronic Communications) 1995
PhD (Network Performance Monitoring) 1998
Research on monitoring parts of the Internet
owned by British Telecom on how well they
perform.
Current Professional Focus
Financial Technology
My First Computer
Casio PB-100F
BASIC programming language
544 bytes of memory
As opposed to 1 gigabytes of a simple netbook
1 gigabytes = 1073741824 bytes
Programs and Data
Data are numbers, alphabets, movies,
pictures and sound.
Inside a computer all of them are stored as
numbers.
Programs tell the computer how to treat
those numbers, i.e., as alphabets, numbers,
movies, pictures or sound.
Programs
List of instructions that execute on data.
Data that programs process is stored in
variables.
Variables are memory locations which are
given identifiable names.
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
a
b
sum
diff
prod
div
Enter a:
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6a
b
sum
diff
prod
div
Enter a: 6
Enter b:
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
a
b
sum
diff
prod
div
Enter a: 6
Enter b: 2
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
a
b
sum
diff
prod
div
Enter a: 6
Enter b: 2
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
4
a
b
sum
diff
prod
div
Enter a: 6
Enter b: 2
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
4
12
a
b
sum
diff
prod
div
Enter a: 6
Enter b: 2
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
4
12
a
b
sum
3
diff
prod
div
Enter a: 6
Enter b: 2
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
4
12
a
b
sum
3
diff
prod
div
Enter a: 6
Enter b: 2
sum =
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
4
12
a
b
sum
3
diff
prod
div
Enter a: 6
Enter b: 2
sum = 8
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
4
12
a
b
sum
3
diff
prod
div
Enter b: 2
sum = 8
diff =
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
4
12
a
b
sum
3
diff
prod
div
Enter b: 2
sum = 8
diff = 4
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
4
12
a
b
sum
3
diff
prod
div
sum = 8
diff = 4
prod =
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
4
12
a
b
sum
3
diff
prod
div
sum = 8
diff = 4
prod = 12
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
4
12
a
b
sum
3
diff
prod
div
diff = 4
prod = 12
div =
Memory
My First Program
Input "Enter a:", a
Input "Enter b:", b
sum = a + b
diff = a - b
prod = a * b
div = a/b
Print "sum = ";
Print sum
Print "diff = ";
Print diff
Print "prod = ";
Print prod
Print "div = ";
Print div
6
2
8
4
12
a
b
sum
3
diff
prod
div
diff = 4
prod = 12
div = 3
Memory
Mean, Median, Mode
7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2
Mean, Median, Mode
7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2
Mean = Sum of all the numbers divided by
the count = 37/12 = 3.083
Mean, Median, Mode
7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2
Mean = Sum of all the numbers divided by
the count = 37/12 = 3.083
Median = Average of the numbers in the
middle of the sorted list of values.
Mean, Median, Mode
7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2
Mean = Sum of all the numbers divided by
the count = 37/12 = 3.083
Median = Average of the numbers in the
middle of the sorted list of values.
1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 7
Mean, Median, Mode
7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2
Mean = Sum of all the numbers divided by
the count = 37/12 = 3.083
Median = Average of the numbers in the
middle of the sorted list of values.
1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 7
Median = 3
Mean, Median, Mode
7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2
Mode = The number that occurs the most.
Mean, Median, Mode
7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2
Mode = The number that occurs the most.
Number Count
1
2
3
4
7
Mean, Median, Mode
7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2
Mode = The number that occurs the most.
Number Count
1 1
2 3
3 5
4 2
7 1
Mean, Median, Mode
7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2
Mode = The number that occurs the most.
Number Count
1 1
2 3
3 5
4 2
7 1
Mean, Median, Mode
7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2
Mode = The number that occurs the most.
Mode = 3
Number Count
1 1
2 3
3 5
4 2
7 1
A Python Program to Compute
Meandata = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
done
Memory
data
input
sum
value
mean
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
done
Memory
data
input
sum
value
mean
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
Enter a number of 'n' to end:
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
Enter a number of 'n' to end: 3
3
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
Enter a number of 'n' to end: 3
3
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
Enter a number of 'n' to end: 3
3
3
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
Enter a number of 'n' to end: 3
3
3
Enter a number of 'n' to end:
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
Enter a number of 'n' to end: 3
1
3
Enter a number of 'n' to end: 1
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
Enter a number of 'n' to end: 3
1
3
Enter a number of 'n' to end: 1
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
1
3 1
Enter a number of 'n' to end: 3
Enter a number of 'n' to end: 1
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
1
3 1
Enter a number of 'n' to end:
Enter a number of 'n' to end: 3
Enter a number of 'n' to end: 1
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
2
3 1
Enter a number of 'n' to end: 2
Enter a number of 'n' to end: 3
Enter a number of 'n' to end: 1
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
2
3 1
Enter a number of 'n' to end: 2
Enter a number of 'n' to end: 3
Enter a number of 'n' to end: 1
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
2
3 1 2
Enter a number of 'n' to end: 2
Enter a number of 'n' to end: 3
Enter a number of 'n' to end: 1
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
2
3 1 2
Enter a number of 'n' to end:
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
n
3 1 2
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Falsedone
Memory
data
input
sum
value
mean
n
3 1 2
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
0.0
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
0.0
3
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
3.0
3
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
3.0
1
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
4.0
1
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
4.0
2
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
6.0
2
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
6.0
2
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
6.0
2
2.0
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 1
Enter a number of 'n' to end: 2
data = list()
done = False
while (not done):
input = raw_input("Enter a number or 'n' to end:
")
if (input != "n"):
data.append(int(input))
else:
done = True
print(data)
sum = 0.0
for value in data:
sum = sum + value
mean = sum/len(data)
print(mean)
Truedone
Memory
data
input
sum
value
mean
n
3 1 2
6.0
2
2.0
Enter a number of 'n' to end: n
Enter a number of 'n' to end: 2
2.0
Key Lessons
Computers are not intelligent or smart,
humans are.
Computer follow instructions listed as
programs to perform tasks.
Computers are much faster than humans in
following instructions.
All operations within a computer are either
arithmetic or logical.
The Future
Data and information driven.
Need for speed, the faster you can find,
process and analyse data you need, the
more successful you are.
You will need to use computers efficiently to
get that advantage.
Most jobs in the next 30 years will require
some level of programming.
The Future
“Sometime in the future, the trading floor of
the London Stock Exchange will only be
occupied by a computer, a man and a dog.
The dog will guard the computer, the man
will feed the dog and the computer will
conduct the business”, Anonymous
Maths with Programming

More Related Content

Viewers also liked

Dmitry Shabanov – Improved algorithms for colorings of simple hypergraphs and...
Dmitry Shabanov – Improved algorithms for colorings of simple hypergraphs and...Dmitry Shabanov – Improved algorithms for colorings of simple hypergraphs and...
Dmitry Shabanov – Improved algorithms for colorings of simple hypergraphs and...Yandex
 
Hypergraph Mining For Social Networks
Hypergraph Mining For Social NetworksHypergraph Mining For Social Networks
Hypergraph Mining For Social NetworksGiacomo Bergami
 
Maths Games & Videos
Maths Games & VideosMaths Games & Videos
Maths Games & VideosSuhaila
 
Statistics used in Cricket
Statistics used in Cricket Statistics used in Cricket
Statistics used in Cricket Makhan Dey
 
Graph coloring and_applications
Graph coloring and_applicationsGraph coloring and_applications
Graph coloring and_applicationsmohammad alkhalil
 
Application of graph theory in drug design
Application of graph theory in drug designApplication of graph theory in drug design
Application of graph theory in drug designReihaneh Safavi
 
Applications of graphs
Applications of graphsApplications of graphs
Applications of graphsTech_MX
 
Pascal’s triangle and its applications and properties
Pascal’s triangle and its applications and propertiesPascal’s triangle and its applications and properties
Pascal’s triangle and its applications and propertiesJordan Leong
 
Football and graph theory
Football and graph theoryFootball and graph theory
Football and graph theoryUmang Aggarwal
 
Applications of maths in our daily life
Applications of maths in our daily lifeApplications of maths in our daily life
Applications of maths in our daily lifeAbhinav Somani
 

Viewers also liked (15)

Dmitry Shabanov – Improved algorithms for colorings of simple hypergraphs and...
Dmitry Shabanov – Improved algorithms for colorings of simple hypergraphs and...Dmitry Shabanov – Improved algorithms for colorings of simple hypergraphs and...
Dmitry Shabanov – Improved algorithms for colorings of simple hypergraphs and...
 
Graph Coloring using Peer-to-Peer Networks
Graph Coloring using Peer-to-Peer NetworksGraph Coloring using Peer-to-Peer Networks
Graph Coloring using Peer-to-Peer Networks
 
Hypergraph Mining For Social Networks
Hypergraph Mining For Social NetworksHypergraph Mining For Social Networks
Hypergraph Mining For Social Networks
 
Cell division and pascal triangle
Cell division and pascal triangleCell division and pascal triangle
Cell division and pascal triangle
 
Careers
CareersCareers
Careers
 
Maths Games & Videos
Maths Games & VideosMaths Games & Videos
Maths Games & Videos
 
Statistics used in Cricket
Statistics used in Cricket Statistics used in Cricket
Statistics used in Cricket
 
Graph coloring and_applications
Graph coloring and_applicationsGraph coloring and_applications
Graph coloring and_applications
 
Application of graph theory in drug design
Application of graph theory in drug designApplication of graph theory in drug design
Application of graph theory in drug design
 
Applications of graphs
Applications of graphsApplications of graphs
Applications of graphs
 
Pascal’s triangle and its applications and properties
Pascal’s triangle and its applications and propertiesPascal’s triangle and its applications and properties
Pascal’s triangle and its applications and properties
 
Football and graph theory
Football and graph theoryFootball and graph theory
Football and graph theory
 
Maths in cricket
Maths in cricketMaths in cricket
Maths in cricket
 
Pascal Triangle
Pascal TrianglePascal Triangle
Pascal Triangle
 
Applications of maths in our daily life
Applications of maths in our daily lifeApplications of maths in our daily life
Applications of maths in our daily life
 

Similar to Maths with Programming

Python programming workshop session 4
Python programming workshop session 4Python programming workshop session 4
Python programming workshop session 4Abdul Haseeb
 
Best C Programming Solution
Best C Programming SolutionBest C Programming Solution
Best C Programming Solutionyogini sharma
 
C programs
C programsC programs
C programsMinu S
 
Simple C programs
Simple C programsSimple C programs
Simple C programsab11cs001
 
Yolygambas
YolygambasYolygambas
Yolygambasrosyp
 
03 Geographic scripting in uDig - halfway between user and developer
03 Geographic scripting in uDig - halfway between user and developer03 Geographic scripting in uDig - halfway between user and developer
03 Geographic scripting in uDig - halfway between user and developerAndrea Antonello
 
Torchbearersnotebook.blogspot.com program to create a list in python and valu...
Torchbearersnotebook.blogspot.com program to create a list in python and valu...Torchbearersnotebook.blogspot.com program to create a list in python and valu...
Torchbearersnotebook.blogspot.com program to create a list in python and valu...SAKSHISINGH486
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3Abdul Haseeb
 
Pythonlearn-03-Conditional.pptx
Pythonlearn-03-Conditional.pptxPythonlearn-03-Conditional.pptx
Pythonlearn-03-Conditional.pptxVigneshChaturvedi1
 
25422733 c-programming-and-data-structures-lab-manual
25422733 c-programming-and-data-structures-lab-manual25422733 c-programming-and-data-structures-lab-manual
25422733 c-programming-and-data-structures-lab-manualkamesh dagia
 

Similar to Maths with Programming (20)

Python programming workshop session 4
Python programming workshop session 4Python programming workshop session 4
Python programming workshop session 4
 
901131 examples
901131 examples901131 examples
901131 examples
 
Best C Programming Solution
Best C Programming SolutionBest C Programming Solution
Best C Programming Solution
 
C programs
C programsC programs
C programs
 
Simple C programs
Simple C programsSimple C programs
Simple C programs
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Yolygambas
YolygambasYolygambas
Yolygambas
 
Cpl
CplCpl
Cpl
 
03 Geographic scripting in uDig - halfway between user and developer
03 Geographic scripting in uDig - halfway between user and developer03 Geographic scripting in uDig - halfway between user and developer
03 Geographic scripting in uDig - halfway between user and developer
 
C-LOOP-Session-2.pptx
C-LOOP-Session-2.pptxC-LOOP-Session-2.pptx
C-LOOP-Session-2.pptx
 
Torchbearersnotebook.blogspot.com program to create a list in python and valu...
Torchbearersnotebook.blogspot.com program to create a list in python and valu...Torchbearersnotebook.blogspot.com program to create a list in python and valu...
Torchbearersnotebook.blogspot.com program to create a list in python and valu...
 
python codes
python codespython codes
python codes
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
 
C
CC
C
 
Python programs
Python programsPython programs
Python programs
 
Hargun
HargunHargun
Hargun
 
python programs .docx
python programs .docxpython programs .docx
python programs .docx
 
Pythonlearn-03-Conditional.pptx
Pythonlearn-03-Conditional.pptxPythonlearn-03-Conditional.pptx
Pythonlearn-03-Conditional.pptx
 
25422733 c-programming-and-data-structures-lab-manual
25422733 c-programming-and-data-structures-lab-manual25422733 c-programming-and-data-structures-lab-manual
25422733 c-programming-and-data-structures-lab-manual
 

More from Omar Bashir

Cloud migration challenges london ct os
Cloud migration challenges   london ct osCloud migration challenges   london ct os
Cloud migration challenges london ct osOmar Bashir
 
5 Software Development Lessons From a Mountaineer
5 Software Development Lessons From a Mountaineer5 Software Development Lessons From a Mountaineer
5 Software Development Lessons From a MountaineerOmar Bashir
 
Technology Agility
Technology AgilityTechnology Agility
Technology AgilityOmar Bashir
 
Quality Loopback
Quality LoopbackQuality Loopback
Quality LoopbackOmar Bashir
 
Achieving Technological Agility
Achieving Technological AgilityAchieving Technological Agility
Achieving Technological AgilityOmar Bashir
 
Technical Debt: Measured and Implied
Technical Debt: Measured and ImpliedTechnical Debt: Measured and Implied
Technical Debt: Measured and ImpliedOmar Bashir
 
Distilling Agile for Effective Execution
Distilling Agile for Effective ExecutionDistilling Agile for Effective Execution
Distilling Agile for Effective ExecutionOmar Bashir
 
Authorisation: Concepts and Implementation
Authorisation: Concepts and ImplementationAuthorisation: Concepts and Implementation
Authorisation: Concepts and ImplementationOmar Bashir
 
Coding for 11 Year Olds
Coding for 11 Year OldsCoding for 11 Year Olds
Coding for 11 Year OldsOmar Bashir
 
High Speed Networks - Applications in Finance
High Speed Networks - Applications in FinanceHigh Speed Networks - Applications in Finance
High Speed Networks - Applications in FinanceOmar Bashir
 
Functional Programming in Java 8
Functional Programming in Java 8Functional Programming in Java 8
Functional Programming in Java 8Omar Bashir
 
An Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeAn Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeOmar Bashir
 
Computing at Schools: A Guide to Parents
Computing at Schools: A Guide to ParentsComputing at Schools: A Guide to Parents
Computing at Schools: A Guide to ParentsOmar Bashir
 
Information technology
Information technologyInformation technology
Information technologyOmar Bashir
 
Code Club Talk 2014
Code Club Talk 2014Code Club Talk 2014
Code Club Talk 2014Omar Bashir
 

More from Omar Bashir (17)

Cloud migration challenges london ct os
Cloud migration challenges   london ct osCloud migration challenges   london ct os
Cloud migration challenges london ct os
 
5 Software Development Lessons From a Mountaineer
5 Software Development Lessons From a Mountaineer5 Software Development Lessons From a Mountaineer
5 Software Development Lessons From a Mountaineer
 
Why Java ?
Why Java ?Why Java ?
Why Java ?
 
Technology Agility
Technology AgilityTechnology Agility
Technology Agility
 
Quality Loopback
Quality LoopbackQuality Loopback
Quality Loopback
 
Achieving Technological Agility
Achieving Technological AgilityAchieving Technological Agility
Achieving Technological Agility
 
Technical Debt: Measured and Implied
Technical Debt: Measured and ImpliedTechnical Debt: Measured and Implied
Technical Debt: Measured and Implied
 
Distilling Agile for Effective Execution
Distilling Agile for Effective ExecutionDistilling Agile for Effective Execution
Distilling Agile for Effective Execution
 
Authorisation: Concepts and Implementation
Authorisation: Concepts and ImplementationAuthorisation: Concepts and Implementation
Authorisation: Concepts and Implementation
 
SOLID Java Code
SOLID Java CodeSOLID Java Code
SOLID Java Code
 
Coding for 11 Year Olds
Coding for 11 Year OldsCoding for 11 Year Olds
Coding for 11 Year Olds
 
High Speed Networks - Applications in Finance
High Speed Networks - Applications in FinanceHigh Speed Networks - Applications in Finance
High Speed Networks - Applications in Finance
 
Functional Programming in Java 8
Functional Programming in Java 8Functional Programming in Java 8
Functional Programming in Java 8
 
An Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeAn Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and Runtime
 
Computing at Schools: A Guide to Parents
Computing at Schools: A Guide to ParentsComputing at Schools: A Guide to Parents
Computing at Schools: A Guide to Parents
 
Information technology
Information technologyInformation technology
Information technology
 
Code Club Talk 2014
Code Club Talk 2014Code Club Talk 2014
Code Club Talk 2014
 

Recently uploaded

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 

Recently uploaded (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

Maths with Programming

  • 2. Introduction Studied at College of Aeronautical Engineering, PAF Academy Risalpur. Graduated as an avionics systems engineer.
  • 4. Further Education MSc IT (Electronic Communications) 1995 PhD (Network Performance Monitoring) 1998 Research on monitoring parts of the Internet owned by British Telecom on how well they perform.
  • 6. My First Computer Casio PB-100F BASIC programming language 544 bytes of memory As opposed to 1 gigabytes of a simple netbook 1 gigabytes = 1073741824 bytes
  • 7. Programs and Data Data are numbers, alphabets, movies, pictures and sound. Inside a computer all of them are stored as numbers. Programs tell the computer how to treat those numbers, i.e., as alphabets, numbers, movies, pictures or sound.
  • 8. Programs List of instructions that execute on data. Data that programs process is stored in variables. Variables are memory locations which are given identifiable names.
  • 9. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div a b sum diff prod div Enter a: Memory
  • 10. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6a b sum diff prod div Enter a: 6 Enter b: Memory
  • 11. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 a b sum diff prod div Enter a: 6 Enter b: 2 Memory
  • 12. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 a b sum diff prod div Enter a: 6 Enter b: 2 Memory
  • 13. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 4 a b sum diff prod div Enter a: 6 Enter b: 2 Memory
  • 14. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 4 12 a b sum diff prod div Enter a: 6 Enter b: 2 Memory
  • 15. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 4 12 a b sum 3 diff prod div Enter a: 6 Enter b: 2 Memory
  • 16. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 4 12 a b sum 3 diff prod div Enter a: 6 Enter b: 2 sum = Memory
  • 17. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 4 12 a b sum 3 diff prod div Enter a: 6 Enter b: 2 sum = 8 Memory
  • 18. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 4 12 a b sum 3 diff prod div Enter b: 2 sum = 8 diff = Memory
  • 19. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 4 12 a b sum 3 diff prod div Enter b: 2 sum = 8 diff = 4 Memory
  • 20. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 4 12 a b sum 3 diff prod div sum = 8 diff = 4 prod = Memory
  • 21. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 4 12 a b sum 3 diff prod div sum = 8 diff = 4 prod = 12 Memory
  • 22. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 4 12 a b sum 3 diff prod div diff = 4 prod = 12 div = Memory
  • 23. My First Program Input "Enter a:", a Input "Enter b:", b sum = a + b diff = a - b prod = a * b div = a/b Print "sum = "; Print sum Print "diff = "; Print diff Print "prod = "; Print prod Print "div = "; Print div 6 2 8 4 12 a b sum 3 diff prod div diff = 4 prod = 12 div = 3 Memory
  • 24. Mean, Median, Mode 7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2
  • 25. Mean, Median, Mode 7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2 Mean = Sum of all the numbers divided by the count = 37/12 = 3.083
  • 26. Mean, Median, Mode 7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2 Mean = Sum of all the numbers divided by the count = 37/12 = 3.083 Median = Average of the numbers in the middle of the sorted list of values.
  • 27. Mean, Median, Mode 7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2 Mean = Sum of all the numbers divided by the count = 37/12 = 3.083 Median = Average of the numbers in the middle of the sorted list of values. 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 7
  • 28. Mean, Median, Mode 7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2 Mean = Sum of all the numbers divided by the count = 37/12 = 3.083 Median = Average of the numbers in the middle of the sorted list of values. 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 7 Median = 3
  • 29. Mean, Median, Mode 7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2 Mode = The number that occurs the most.
  • 30. Mean, Median, Mode 7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2 Mode = The number that occurs the most. Number Count 1 2 3 4 7
  • 31. Mean, Median, Mode 7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2 Mode = The number that occurs the most. Number Count 1 1 2 3 3 5 4 2 7 1
  • 32. Mean, Median, Mode 7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2 Mode = The number that occurs the most. Number Count 1 1 2 3 3 5 4 2 7 1
  • 33. Mean, Median, Mode 7, 3, 2, 3, 3, 4, 1, 4, 2, 3, 3, 2 Mode = The number that occurs the most. Mode = 3 Number Count 1 1 2 3 3 5 4 2 7 1
  • 34. A Python Program to Compute Meandata = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean)
  • 35. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) done Memory data input sum value mean
  • 36. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) done Memory data input sum value mean
  • 37. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean
  • 38. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean Enter a number of 'n' to end:
  • 39. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean Enter a number of 'n' to end: 3 3
  • 40. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean Enter a number of 'n' to end: 3 3
  • 41. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean Enter a number of 'n' to end: 3 3 3
  • 42. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean Enter a number of 'n' to end: 3 3 3 Enter a number of 'n' to end:
  • 43. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean Enter a number of 'n' to end: 3 1 3 Enter a number of 'n' to end: 1
  • 44. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean Enter a number of 'n' to end: 3 1 3 Enter a number of 'n' to end: 1
  • 45. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean 1 3 1 Enter a number of 'n' to end: 3 Enter a number of 'n' to end: 1
  • 46. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean 1 3 1 Enter a number of 'n' to end: Enter a number of 'n' to end: 3 Enter a number of 'n' to end: 1
  • 47. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean 2 3 1 Enter a number of 'n' to end: 2 Enter a number of 'n' to end: 3 Enter a number of 'n' to end: 1
  • 48. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean 2 3 1 Enter a number of 'n' to end: 2 Enter a number of 'n' to end: 3 Enter a number of 'n' to end: 1
  • 49. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean 2 3 1 2 Enter a number of 'n' to end: 2 Enter a number of 'n' to end: 3 Enter a number of 'n' to end: 1
  • 50. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean 2 3 1 2 Enter a number of 'n' to end: Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 51. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean n 3 1 2 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 52. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Falsedone Memory data input sum value mean n 3 1 2 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 53. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 54. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 55. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 0.0 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 56. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 0.0 3 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 57. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 3.0 3 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 58. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 3.0 1 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 59. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 4.0 1 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 60. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 4.0 2 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 61. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 6.0 2 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 62. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 6.0 2 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 63. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 6.0 2 2.0 Enter a number of 'n' to end: n Enter a number of 'n' to end: 1 Enter a number of 'n' to end: 2
  • 64. data = list() done = False while (not done): input = raw_input("Enter a number or 'n' to end: ") if (input != "n"): data.append(int(input)) else: done = True print(data) sum = 0.0 for value in data: sum = sum + value mean = sum/len(data) print(mean) Truedone Memory data input sum value mean n 3 1 2 6.0 2 2.0 Enter a number of 'n' to end: n Enter a number of 'n' to end: 2 2.0
  • 65. Key Lessons Computers are not intelligent or smart, humans are. Computer follow instructions listed as programs to perform tasks. Computers are much faster than humans in following instructions. All operations within a computer are either arithmetic or logical.
  • 66. The Future Data and information driven. Need for speed, the faster you can find, process and analyse data you need, the more successful you are. You will need to use computers efficiently to get that advantage. Most jobs in the next 30 years will require some level of programming.
  • 67. The Future “Sometime in the future, the trading floor of the London Stock Exchange will only be occupied by a computer, a man and a dog. The dog will guard the computer, the man will feed the dog and the computer will conduct the business”, Anonymous