Professional Documents
Culture Documents
Table of Contents
1.Mathematical Definitions
2.Geometry and Trigonometry Basics
3.Numeral Systems
4.Algorithms
Mathematical Definitions
Mathematical Definitions
Prime numbers
Any
Number sets
Basic
Factorial (n!)
Vectors and Matrices
4
Prime Numbers
A prime number is a natural number
that can be divided only by 1 and by itself
Examples:
Largest
6 = 2 x 3, 24 = 2 x 2 x 2 x 3, 95 = 5 x 19
Non-prime
Number Sets
Natural numbers
Used
Integer numbers
Numbers
Number Sets
Rational numbers
Any
Real numbers
Used
Number Sets
Ration
al
Numbe
rs
Natural
Number
s
Prime
Number
s
Intege
r
Numbe
rs
Real
Number
s
8
Number Sets
Fibonacci numbers
A
Tribonacci numbers
A
Factorial
n! the product of all positive integers, less than or
equal to n
n
should be non-negative
n! = (n 1)! x n
Example: 5! = 5 x 4 x 3 x 2 x 1 = 120
20! = 2,432,902,008,176,640,000
Geometry and
Trigonometry
on canvas
Placement and styling in HTML / CSS
13
numerical coordinates
Signed
distances to three
mutually perpendicular planes
Useful for:
Interacting
Calculating
distances in 3D graphics
3D
Trigonometric Functions
Define the correlation between the angles
and the lengths of the sides
of a right-angled triangle
Useful for:
Positioning
in navigation systems
Calculating distances in 3D graphics
Modeling sound waves
15
Trigonometric Functions
16
Numeral Systems
using 10 numerals:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
130
9786
unit of information 0 or 1
Bits are easy to represent in electronics
1
0
0
1
1
0
19
by 2 numerals: 0 and 1
101b
+
=
+
=
+
+ 1 = 53
20
= 9
0111b
= 7
110110b
21
= 250
= 125
500d = 111110100b
= 62
= 31
= 15
22
Binary Examples
Binar
y
10100
11
ASCII(Dec
)
83
Symbo
ls
11011
11
11001
10
11101
00
10101
01
11011
10
11010
01
111
102
116
85
110
105
23
Binary systems
Exercise
using 16 numerals:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and F
0x0
0x1
0x2
0x3
4
5
6
7
25
Hexadecimal to Decimal
Conversion
Decimal to Hexadecimal
Conversion
500d = 1F4hex
27
=
=
=
=
=
=
0010
0011
0100
0101
0110
0111
0xA
0xB
0xC
0xD
0xE
0xF
=
=
=
=
=
=
1010
1011
1100
1101
1110
1111
28
Algorithms
What is Algorithm?
A step-by-step procedure for calculations
A set of rules that precisely defines a sequence of
operations
The
Usage:
In
30
2. Check if X is equal to 2
.Examples: 1, 2, 6, 7, -2
31
Example: 100
Divisors: 2, 4, 5, 10, 20, 25, 50
100 = 2 50 = 4 25 = 5 20 = 10 10 = 20
5 = 25 4 = 50 2
10 = 100
32
Sorting Algorithms
Live Demo
http://visualgo.net
http://
www.sorting-algorithms.com
Summary
Mathematical definitions
Sets,
coordinate system
Trigonometric functions
Numeral systems
Binary,
decimal, hexadecimal
s
e
u
Q
?
s
n
o
ti
?
?
https://softuni.bg/courses/programming-basics/
License
This course (slides, examples, demos, videos, homework, etc.)
is licensed under the "Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International" license
"Fundamentals of Computer Programming with C#" book by Svetlin Nakov & Co.
under CC-BY-SA license
softuni.bg
facebook.com/SoftwareUniversity
youtube.com/SoftwareUniversity