Posts

Matrix representation of Graph, Edge Sequence, Walk, Path and Circuit

Image
  Matrix Representation of Graphs When G is a simple graph with n vertices V 1 ,V 2 ,V 3 …Vn the matrix A (or A G )=A ij . Where,A ij  is called the adjacency matrix of G. Properties of an Adjacency Matrix Since a simple graph has no loops, each diagonal entry of A, viz., A ij= 0, for i=1,2,…n. The  adjacency  matrix of simple graph is symmetric, viz. A ij=  A ji , since both of these entries are 1 when v i , v j  are adjacent and both are 0 otherwise. Note : The given any symmetric zero-one matrix A which contains only 0’s on its diagonal there exists a simple graph G whose adjacency matrix is A. deg(v i ) is equal to the number of 1’s in the i th  row and i th  column. Examples 1.Adjacency Matrix of a Simple Graph 2.Adjacency Matrix of a Weighted Graph 3.Adjacency Matrix of a Directed Graph EDGE SEQUENCE, WALKS, PATHS AND CIRCUITS Edge   Sequence An edge is the mathematical term for a line that connects two vertices. Many edges can be forme...

PREDICATE AND QUANTIFIERS

  PREDICATES AND QUANTIFIERS PREDICATES A Predicate is a sentence depending on variables which becomes a statement upon substituting values in the domain. Predicate usually represented by the letter P, the notation P(x) is used to represent some unspecified property or predicate that x may have. If P(x) is a predicate and x has domain D, the truth set of P(x)is the set of all elements of D that make P(x) true when they are substituted for x. The truth set of P(x) is denoted by: {x ∈ |P(x)} Examples P(x) is “x>5” and x ranges over Z P(8) is True P(-1) is False Note: Combining the quantifier and the predicate, we get a complete statement of the form ∀ xP(x) or ∃ xP ( x ) QUANTIFIERS Quantifiers are words that refer to quantities such as “some” or “all”. It tells for how many elements a given predicate is True. There are two types of quantifier in predicate logic Universal Quantifier Existential Quantifier   Universal Quantifier Many ...

Principles of Inclusion-Exclusion

Image
  Principle of Inclusion-Exclusion The Principle of Inclusion-Exclusion is a counting method used to compute the cardinality of the union set.   According to basic Inclusion-Exclusion Principles For 2 finite sets A and B      |A U B| = |A| + |B| - |A∩B| For 3 finite sets A, B and C      |A U B U C| = |A| + |B| + |C| - |A∩B| - |B∩C| - |A∩C| + |A∩B∩C| where |A| denotes the cardinality (the number of elements in) of the set A Properties It computes the total number of elements that satisfy at least one of several properties. It prevents the problem of double counting.   Examples 1. For three subsets A={2,3,7,9,10}, B={1,2,3,9}, C={2,4,9,10} of S={1,2,…..10} Compute |A U B U C|. Solution : According to basic Inclusion-Exclusion Principles For 3 finite sets A, B and C |A U B U C| = |A| + |B| + |C| - |A∩B| - |B∩C| - |A∩C| + |A∩B∩C| Term Set Cardinality A ...

Writing General Procedures in VB6.0

Image
VISUAL BASIC 6.0 WRITING GENERAL PROCEDURES Procedures perform some specific task of the VB Project. A procedure is a set of VB statement in a larger Project. Advantages Decomposing complex problems into smaller subproblems Reducing duplication of code Reuse of code Improving readability of the VB Project Creating a New Sub Procedure Steps to add a new general procedure to a form: Display the Code window for the form Select Add Procedure from the Tools menu Enter a name in the Add Procedure dialog box Choose the Type of Procedure (Sub/ Function / Property / Event) Select Private or Public for Scope of the VB Project Clink OK   Types of Procedures 1.Sub Procedures – perform actions but do not return a value to the calling code 2.Function Procedures – perform actions and return a value to the calling code 3.Property Procedures – create and execute custom properties of an objects 4.Event Procedures - execute when a particular event occur on ...