Computer Notes, Programming codes, Hardware and Networking Tip, Entertainment, Biography, Internet Tip, Tech News, Latest Technology, YouTube,

Articles by "Discrete Structure"
About RAM Advantages of multiprocessing system Associative memory Binary Number System CA CA Notes Change drive icon change pendrive icon Computer Abbreviation Computer Architecture Computer fundamental MCQ Computer Generation Computer generation computer notes Computer MCQ Computer Network MCQ Computer Operator MCQ Critical Section Critical section in OS Database connectivity in java Deadlock avoidance Deadlock detection algorithm Deadlock Detection and Recovery Deadlock detection method Deadlock Handling Deadlock in OS Deadlock Prevention Deadlock Recovery define object and class Define system cell Descrete Structure Device Driver Device driver in computer device driver in os DFA DFA contains with DFA ends with dfa examples dijkstra's algorithm Discrete Structure Discrete Structure graph theory Download JDBC Driver Download MySql Download PUBG DS DS Notes FCFS Job Scheduling Algorithm Finding shortest path Finite Sate Automata Flynn's Classifications fragmentation in computer fragmentation in harddisk fragmentation in os fragmented memory Full form related to computer Generations of operations Generations of OS Graph theory ICT 1st semester notes Instruction Address Modes Java java array declaration java class and object example Java Database connectivity example java event handling example program Java JDBC Java JMenuBar Java JSP program example java notes java program methods example Java program to create class and object java program to create methods java program to print even number between any two numbers Java programming java programming notes Java programs Java question answer java swing example java swing program to calculate simple interest Java Tutorials JSP program learn qbasic Lekh MCQ MCQ Computer MCQ Operating System memory fragmentation MICT 1st semester notes mict 1st semester operating system notes MICT first semester notes Multiprocessing mutex in os Necessary conditions for deadlock Number System Operating System Operating system notes OS OS Notes OS Numeric pattern printing program in qbasic patterns in qbasic Pipeline Hazards Pipelining Pipelining concept prime or composite in qbasic print patterns qbasic print series in qbasic Printing Series in qbasic PUBG PUBG Mobile PUBG PC PUBG Story qbasic qbasic code qbasic for class 10 qbasic for class 8 qbasic for class 9 qbasic for school QBASIC Pattern printing qbasic pattern printing program qbasic pattern printing programs qbasic pattern types qbasic patterns qbasic programming tutorials qbasic programs qbasic sequence printing programs qbasic tutorials Race Condition in Operating system reverse order in qbasic RISC and CISC RISC Pipeline Scheduling algorithm segmentation in operating system segmentation in os semaphore and mutex Semaphore concept in os Semaphore in os semaphore in os notes semaphore meaning sequential programs in qbasic series in qbasic series printing programs in qbasic shell in operating system shell in os shortest path shortest path algorithm simple interest program in java swing System Bus System Cell Teach Blog Tech Blog Tech School technical school The Shell in Operating system types of fragmentation Types of Multiprocessor types of operating system Types of pipeline hazards View Connected Wifi password Virtual Memory Virtual memory in OS Von Neumann's architecture What is associative memory? what is class? What is computer system? What is Fragmentation? What is jsp? what is object? What is process? What is segmentation What is System Cell What is Thread? what is virtual memory in computer What is virtual memory? पब्जी गेम

1. Construct finite state automata (DFA) that contains with abb

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string with a
          q2 = string with ab
          q3 = string with abb

Q: set of all states (q0, q1, q2, q3)
F: Final State 

 Transition Matrix
  f
    a b
ε q0 q1 q0
a q1 q1 q2
ab q2 q1 q3
abb q3 q3 q3
Transition Graph


2. Construct finite state automata (DFA) that contains with aab

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string with a
          q2 = string with aa
          q3 = string with aab

Q: set of all states (q0, q1, q2, q3)
F: Final State 

  Transition Matrix
  f
    a b
ε q0 q1 q0
a q1 q2 q0
ab q2 q2 q3
abb q3 q3 q3
Transition Graph


3. Construct finite state automata (DFA) that contains with aba

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string with a
          q2 = string with ab
          q3 = string with aba

Q: set of all states (q0, q1, q2, q3)
F: Final State 

  Transition Matrix
  f
    a b
ε q0 q1 q0
a q1 q1 q2
ab q2 q3 q0
abb q3 q3 q3
Transition Graph


4. Construct finite state automata (DFA) that contains with aabb

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string with a
          q2 = string with aa
          q3 = string with aabb

Q: set of all states (q0, q1, q2, q3)
F: Final State 

  Transition Matrix
  f
    a b
ε q0 q1 q0
a q1 q2 q0
aa q2 q2 q3
aab q3 q1 q4
aabb q4 q4 q4
Transition Graph

1. Construct finite state automata (DFA) that ends with abb

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string ends with a
          q2 = string ends with ab
          q3 = string ends with abb

Q: set of all states (q0, q1, q2, q3)
F: Final State 
 
Transition Matrix
  f
    a b
ε q0 q1 q0
a q1 q1 q2
ab q2 q1 q3
abb q3 q1 q0
Transition Graph


2. Construct finite state automata (DFA) that ends with aab

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string ends with a
          q2 = string ends with aa
          q3 = string ends with aab

Q: set of all states (q0, q1, q2, q3)
F: Final State 
 Transition Matrix
  f
    a b
ε q0 q1 q0
a q1 q2 q0
aa q2 q2 q3
aab q3 q1 q0
Transition Graph


3. Construct finite state automata (DFA) that ends with aba

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string ends with a
          q2 = string ends with ab
          q3 = string ends with abb

Q: set of all states (q0, q1, q2, q3)
F: Final State 

  Transition Matrix
  f
    a b
ε q0 q1 q0
a q1 q1 q2
ab q2 q3 q0
aba q3 q1 q2
Transition Graph


4. Construct finite state automata (DFA) that ends with aabb

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string ends with a
          q2 = string ends with aa
          q3 = string ends with aab
         q= string ends with aabb

Q: set of all states (q0, q1, q2, q3, q4)
F: Final State 

  Transition Matrix
  f
    a b
ε q0 q1 q0
a q1 q2 q0
aa q2 q2q3
aab q3 q1 q4
aabb q4 q1 q0
Transition Graph

1.  Construct finite state automation (DFA) that starts with 'abb'. 

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string starts with a
          q2 = string starts with ab
          q3 = string starts with abb

Q: set of all states (q0, q1, q2, q3,qФ)
F: Final State 

    Transition Matrix
  f
    a b
ε p0 p1 qФ
a p1 qФ p2
ab p2 qФ p3
abb p3 p3 p3

p4 qФ qФ
Transition Graph

2.  Construct finite state automation (DFA) that starts with 'aab'. 

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string starts with a
          q2 = string starts with aa
          q3 = string starts with aab

Q: set of all states (q0, q1, q2, q3,qФ)
F: Final State 

    Transition Matrix
f
ab
εp0p1qФ
ap1p2qФ
abp2qФp3
abbp3p3p3

p4qФqФ
Transition Graph

3.  Construct finite state automation (DFA) that starts with 'aba'. 

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string starts with a
          q2 = string starts with ab
          q3 = string starts with aba

Q: set of all states (q0, q1, q2, q3,qФ)
F: Final State 

    Transition Matrix
f
ab
εp0p1qФ
ap1qФp2
abp2p3qФ
abbp3p3p3

p4qФqФ
Transition Graph


4.  Construct finite state automation (DFA) that starts with ''. 

Solution :
Σ: inputs = {a, b}
          q0 = initial state
          q1 = string starts with a
          q2 = string starts with aa
          q3 = string starts with aab
          q4 = string starts with aabb

Q: set of all states (q0, q1, q2, q3q4, qФ)
F: Final State 

    Transition Matrix
f
ab
εp0p1qФ
ap1p2qФ
aap2qФp3
aabp3qФp4
aabbp4p4p4

p5 qФ qФ
Transition Graph

Graph Theory |Walk, Path, Trial, Cycle and Circuit in Graph|



Walk

Let G=(V, E) a Graph, then 
A walk in G is a list W={u, e1, v1, e2, v2 ...... v} whose elements are alternatively vertices and degrees. 
The vertices u and v are called its end-vertices. 
The vertices v1, ........ are called inner vertices. 
In a simple graph, walk can be denoted by sequence of vertices only. 

Path

Let G=(V, E) be a Graph, then 
A path in G is a walk with no repeated vertex and edges. 

Trial 

Let G=(V, E) be a Graph, then 
A trial in G is a walk with no repeated edges. 

Cycle

Let G=(V, E) be a Graph, then 
A cycle in G is a closed path. 
In a cycle, start and end vertex are same. 

Circuit

Let G=(V, E) be a graph, then 
A trial in G is a walk with no repeated edges. Now a closed trial in G is closed circuit. 



Example: In the graph given below, construct walk, path, trial, cycle and circuit from a to e. 

           A)   
Graph
Solution Here, 
1. Walk (Vertex and Edge can be repeated) 
walk = {a, b, f, a, b, e}

2. Path (Vertex and Edge is not repeated) 
path = {a, b, f, e}

3. Trial (Vertex can be repeated, Edges not repeated) 
trial = {a, b, f, g, a, f, e}



4. Cycle (Vertex not repeated, Edge not repeated, close path)
cycle = {a, b, e, f, a}

5. Circuit (Vertex can be repeated, edge not repeated, close trial)
circuit = {a, f, b, e, f, g, a}



Dijkstra's algorithm is used to find the shortest path between source vertex (a) to destination vertex (b).


According to Dijkstra's algorithm, to find the shortest path from source vertex to destination vertex we need to follow the following steps.
Step 1: Remove all the loops
Step 2: Remove all parallel edges between two vertices except the one with least weight.
Step 3: Create the weight matrix table
            i) Set 0 to the source vertex and infinite to the remaining vertices.
                        For all vertices, repeat (ii) and (iii)
            ii) Mark the smallest unmarked value and mark that vertex.
            iii) Find those vertices which are directly connected with marked vertex and update all.
                  Update value formula:
                  New Destination value = Minimum(Old destination value, Marked value + Edge weight)
Step 4: Perform backtrack
Some Examples: 

1. Find shortest path from a to g. 



2. Find shortest path from a to c. 


MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget