Maths
Maths
Maths
Characteristics of an Algorithm -
1. Its complexity can vary greatly, and it must have inputs and an output.
2. The input types should be known beforehand, and it must always
produce an output.
3. An algorithm should be clear, unambiguous, competent with available
resources, and should have independent step-by-step directions.
4. The characteristics of an algorithm include finiteness, input, output,
definiteness, and effectiveness.
5. It should have at least one output, and the instructions should be clear
and simple.
6. There are no well-defined standards for writing algorithms, and it is
problem dependent.
7. The efficiency of an algorithm is decided by time and space used by
the algorithm, which includes the running time and storage space required
by an algorithm in terms of input data size.
{
4
x if x is even
f(x) = for all integers x.
¿ x 4 if x is odd
54, 54, 54, 55, 56, 57, 57, 58, 58, 60, 60
The most commonly occurring value is 54, therefore the mode of this
distribution is 54 years.
Q.5 What is main advantage of mode over the median and the mean?
Ans - The advantage of mode over the median and the mean is that it can
be found for both numerical and non-numerical data.
54, 54, 54, 55, 56, 57, 57, 58, 58, 60, 60
52, 54, 54, 54, 55, 56, 57, 57, 58, 58, 60, 60
The two middle values are 56 and 57; therefore the median equals 56.5
years:
54, 54, 54, 55, 56, 57, 57, 58, 58, 60, 60
The mean is calculated by adding together all the values
(54+54+54+55+56+57+57+58+58+60+60-623) and dividing by the
number of observations (11) which equals 56.6 years.
Median:-
The median is the middle value of a set of observations. There are as
many observations above the median as there are below it. To find the
median, observations must be arranged in order of value. Median is
useful for variables such as age, income, turnover and housing prices.
Mode:-
The mode is the most commonly observed data item in a data set. A set of
data can have more than one mode. The mode is useful when the most
common item, characteristic or value of a data set is required.
For example,
V(G₁) (1, 2, 3, 4, 5)
E(G₁)=((1, 2), (2, 3), (3, 4), (4, 5), (5, 1), (1,3), (5, 3))
The arrow is always from tail vertex to head vertex. Thus in an undirected
graph, pair of vertices representing any edge is unordered i.e. (v, w) and
(w, v) represent the same edge whereas in the directed graphs each edge
is an ordered pair of vertices i.e. each edge is represented by a directed
pair. So in an directed graph (v,w) and (w, v) represent two different
edges.
For example,
G is bipartite because its vertex set V = {1, 2, 3, 4, 5, 6) is partitioned into
two non empty sets V₁ = {1, 3, 5} and V₂ = {2. 4, 6). Every edge in G
connects a vertex in V₁, and a vertex in V₂.
For example,
The graphs shown below are complete bipartite graphs.
For example,
For example -
A is the root of this tree. No edge enters A, but several may leave and we
draw these edges downward.
There is a row for every vertex and a column for every edge in the
incidence matrix.
The number of one's in an incidence matrix of undirected graph without
loops is equal to the sum of degrees of all the vertices of the graph.
For example,
Graph G has 5 nodes V1, V2, V3, V4, V5 and 8 edges e₁, e2, 23, 24, 25,
26, 27, eg as given below:-
For example,
Consider the following undirected weighted graph:-
w(e1) = 4, w(e3) = 7,
w(e4) = 4, w(e6) = 5,
The graphs shown in figures (b), (c), (d) and (e) are each a sub graph of
the graph shown in figure (a).
V(G) represents the set of vertices of graph G. E(G) represents the set of
edges of graph G. G=(V, E) is used to represent the graph.
For example -
Consider the following graph G
Here -
V(G) = {1,2,3,4,5}
E(G) = {(1,2),(2,3),(3,4),(4,5),(5,1).(1,3),(3,5)}
Definition:- f(n) = O(g(n)) iff there exists two constants k and k1 such that
| f(n) | ≤ k | g(n) for all n ≥k1.
Where