Thursday, 6 February 2025

Home


Soft Computing Laboratory Assignments-I, II, III

Syllabus


An outline of the course is as follows.

Introduction to Soft Computing

  • Concept of computing systems.
  • "Soft" compiting versus "Hard" computing
  • Characteristics of Soft computing
  • Some applications of Soft computing techniques

Fuzzy logic

  • Introduction to Fuzzy logic.
  • Fuzzy sets and membership functions.
  • Operations on Fuzzy sets.
  • Fuzzy relations, rules, propositions, implications and inferences.
  • Defuzzification techniques.
  • Fuzzy logic controller design.
  • Some applications of Fuzzy logic.

Genetic Algorithms

  • Concept of "Genetics" and "Evolution" and its application to proablistic search techniques
  • Basic GA framework and different GA architectures.
  • GA operators: Encoding, Crossover, Selection, Mutation, etc.
  • Solving single-objective optimization problems using GAs.

Multi-objective Optimization Problem Solving

  • Concept of multi-objective optimization problems (MOOPs) and issues of solving them.
  • Multi-Objective Evolutionary Algorithm (MOEA).
  • Non-Pareto approaches to solve MOOPs
  • Pareto-based approaches to solve MOOPs
  • Some applications with MOEAs.

Artificila Neural Networks

  • Biological neurons and its working.
  • Simulation of biolgical neurons to problem soloving.
  • Different ANNs architectures.
  • Trainging techniques for ANNs.
  • Applications of ANNs to solve some real life problems.

end



Soft Computing:- It is a family of techniques with the capacity to solve a class of problems for which other conventional techniques are inadequate to solve.

Example:-    The differentiation of any equation of straight lines in slope-intercept form always yields slope.

y = f(x) = mx + c ;    (dy/dx) =m 

y = f(x) = 2D matrix;   (dy/dx) = can not be solved by any traditional techniques; need a soft computing approach for finding the first-order differentiation.

Components of soft computing:-

1.    Fuzzy Systems

2.    Neural Networks

3.    Evolutionary Search Strategies


Hybrid Components of Soft Computing:-

1.    Evolutionary-Fuzzy Systems

2.    Neuro-Evolutionary Systems

3.    Neuro-Fuzzy Systems

4.    Neuro-Fuzzy-Evolutionary Systems


Soft Computing Laboratory Assignments-I

Crisp Sets and Basic Operations


1.    Write python functions to generate the n-population from a given set.

2.    Write python functions to generate the n-sampling sets, each of size k, from a given set.  

3.    Write python functions to compute the union of two crisp sets.

4.    Write python functions to compute the intersection of two crisp sets.

5.    Write python functions to compute the symmetric difference of two crisp sets.

6.    Write python functions to compute the power set of a crisp set.

7.    Write python functions to check whether a crisp set is a subset of another set.

8.    Write python functions to check whether a crisp set is a superset of another set.

9.    Write python functions to check whether two input crisp sets is disjoint or not.
 
10.    Write python functions to implement the following:
            (a)    Add an element in a given set. 
            (b)    Update the set.
            (c)    Remove an element from the set. 
            (e)    Discard an element from the set. 
            (f)     Pop the element from the set.
            (g)    Clear the set. 
            (h)   Distinguish between remove() and discard() functions in python.

 

Soft Computing Laboratory Assignments-II

Fuzzy Membership Functions and Basic Operations



1.    Write python functions to generate the following parameterized fuzzy membership functions and visualize them for different parameter values:

        (a)    Triangular MF

        (b)    Trapezoidal MF

        (c)    Gaussian MF

        (d)    Generalized Bell MF
         
        (e)    PI-MF 
 
        (f)    Z-MF 
 
        (g)    S-MF
 
        (h)    Sigmoid MF


2.    Write python functions to generate asymmetric MF using sigmoidal MFs by the following methods and visualize them:

        (a)    Absolute difference

        (b)    Product


3.    Write python functions to implement following fuzzy complement operations and visualize them for different parameter values:

        (a)    Classical fuzzy complement

        (b)    Sugeno's fuzzy complement

        (c)    Yager's fuzzy complement


4.    Write python functions to implement following fuzzy intersection operations (T-norms) and visualize them for different parameter values:

        (a)    Minimum

        (b)    Algebraic product

        (c)    Bounded product

        (d)    Drastic product


5.    Write python functions to implement following fuzzy union operations (S-norms) and visualize them for different parameter values:

        (a)    Minimum

        (b)    Algebraic product

        (c)    Bounded product

        (d)    Drastic product




Soft Computing Laboratory Assignments-III


Extension Principle, Fuzzy Relations, Linguistic Variables and Fuzzy Reasoning


1.    Write a python function to compute the image of a fuzzy set  A  using extension principle given a mapping function f(x). Test your program for the following cases:


    (a)    A is Triangular MF in the range [1 to 10] and f(x) = x+ 3x3 .

    (b)    A is Trapezoidal MF in the range [1 to 10] and f(x) = x+ 3x3 .

    (c)    A Gaussian MF in the range [1 to 10] and f(x) = x+ 3x3 .

    (d)    A Generalized Bell MF in the range [1 to 10] and f(x) = x+ 3x3 .

    (e)    A Triangular MF in the range [1 to 5] and f(x) = (x-3)2 + 2 .

    (f)    A Trapezoidal MF in the range [1 to 5] and f(x) = (x-3)+ 2 .

    (g)    A Gaussian MF in the range [1 to 5] and f(x) = (x-3)+ 2 .

    (h)    A Generalized Bell MF in the range [1 to 5] and f(x) = (x-3)+ 2 .

    (i)    A Triangular MF in the range [0 to 8] and f(x) = sin(x)
    
    (j)    A Trapezoidal MF in the range [0 to 8] and f(x) = sin(x)

    (k)    A Gaussian MF in the range [0 to 8] and f(x) = sin(x)

    (l)    A Generalized Bell MF in the range [0 to 8] and f(x) = sin(x)



2.    Write a python function to compute the max-min composition of two fuzzy relations.


3.    Write a python function to compute the max-product composition of two fuzzy relations.

4.    Define two suitable primary linguistic terms (using Gaussian MF or Generalized Bell MF) representing old and young people respectively over the age range [0 to 100]. Now obtain the membership functions for the following non-primary terms:

    (a)    not very young and not very old.

    (b)    very young or very old.

    (c)    young but not very young.

    (d)    extremely young or more or less old.

Plot the membership functions for all the primary and non-primary terms on a single plot with proper legends.


5.    Demonstrate the effect of contrast intensification on a fuzzy membership function.

6.    Write python functions for implementing cylindrical extension of a 1 D membership function and projection of a 2 D membership function. Demonstrate the result visually.

7.    Demonstrate the interpretation of fuzzy implication as coupling and entailment with relevent plots.

8.    Given a fuzzy membership function function mf(X) representing the fact x is A and a fuzzy relation R(X,Y) representing the fuzzy implication if x is A then y is B, find the consequent membership function representing y is B. Implement this for both max-min and max-product compositions and demonstrate the process visually. 


9.    Implement the fuzzy reasoning procedure for the following:

        Premise 1 (fact):    x is A' and y is B'
        
        Premise 2 (rule 1):    if x is A1 and y is B1 then z is C1

        Premise 3 (rule 2):    if x is A2 and y is B2 then z is C2
---------------------------------------------------------------------------------------------

        Consequence (conclusion):  z is C'

The notations have usual meaning. Demonstrate the procedure visually.










Friday, 31 January 2025

B.Tech. Pt-III (IT) 1 st Semester Examination, 2023. Subject: Graph Theory (Elective I). Paper: IT506B

 


B.Tech. Pt-III (IT) 1st Semester Examination, 2023 Subject: Graph Theory (Elective I) Paper: IT506B

Department of Engineering and Technological

 Studies, University of Kalyani


B.Tech. Pt-III (IT) 1st Semester

 Examination, 2023


Subject: Graph Theory (Elective I)


Paper: IT506B


Full marks=70 Time: 3 Hours


The figures in the right-hand margin indicate 

marks.


Candidate are required to give their answers 

in their own words as far as possible.

The notations follow their 

standard meanings.

Answer question number one and any 

five from rest.


1. Answer any ten questions: (2 x 10 = 20)


a) Define a graph and a subgraph.


b) What are the edge and vertex labeling?


c) Define order and size of a graph.


d) What do you mean by cut edge and

 cut vertex?


e) Explain union and intersection of two graphs.


f) A non-directed graph G has 8 edges. 

Find the number of vertices, 

if the degree of each vertex in G is 2.


g) What is cycle graph, 

differentiate it from wheel graph?


h)What is meant by complement of a graph? 

Find the complement of the cycle (C5) graph?

i) What is a complete graph? 

Find the degree of each vertex in a 

complete(K5) graph?

j) If G is a simple connected graph with 

70 vertices, 

then the number of edges of G is 

between --------- 

and --------- . Explain.


k) Suppose that G is a graph such that 

each vertex has degree 4 and 

|E|=4*|V| - 36. Then |V| = --------- 


and |E| = --------- .


l) What is rooted tree? 

Define level of a vertex in a rooted tree.


m) Determine the order and size of 

k-partite complete Kn1,n2,...nk graph.


n) Define simple path and circuit in a graph.


o) Define loop-graph and multi-graph.


2. a) Prove that, in any non-directed graph

 there is an even number of vertices of odd

 degree.


b) How many different simple graphs are 

there with the give verticex set

 {v1, v2,...., vn}? 


c) Suppose that G is a non directed graph 

with 12 edges. Suppose that G has 

6 vertices of degree 3 and the rest 

have degrees less than 3. 

Determine the minimum number of vertices

 G can have. 

                                                                                                                         (2+4+4)


3. a) Is there a graph with degree sequence

 (1, 3, 3, 3, 5, 6, 6) ?


b) Draw a nonsimple graph ‘G’ with degree 

sequence (1, 1, 3, 3, 3, 4, 6, 7) .


c) For any simple graph G, 

prove that the number of edges of G is less 

than or equal to n(n-1)/2, where n is the 

number of vertices of G.                                                                 

                                                                                                                                                                                                                                                                                                    ( 2+3+5)



4. a) Define isomorphism. 

Determine whether the following 

pair of graphs ‘H’ and ‘I’ are isomorphic.




b) Determine the graph G with adjacency

 matrix A such that


and (5+5)


5. a) If G is a connected planar graph,

then prove that the Euler’s formula

 (|V|-|E|+|R| = 2).


b) In a connected simple-plane graph G,

with |E| > 1, prove that |E| 3|V| - 6.


c) A complete graph Kn is planar iff n ≤ 4,

 justify. 

                                                                                                                     (4+4+2)


6. a) What do you mean by planar graphs?

b) Define dual graph and self-dual graph?


c) Show that the graph ‘I’ given below is

 planar

Find the dual graph of a planar graph ‘J’. 

Is it self-dual graph?



7. a) Differentiate between Euler path and

 Hamiltonian path.

b) Define chromatic number X(G). 

Find the X(G) of a graph ‘M’. 

c) What do you mean by a bipartite graph?

d) Find number of all possible binary tree of 

3-node.

                                                                                                                       (2+3+2+3)



8. Short notes:

                                                                        (2 x 5)

Answer any two of the following:


a) The four-color Problem.

b) The Hamiltonian Graphs.

c) The Königsberg Bridges Problem.

d) The Catalan numbers.




--------End---------------------

B.Tech. Pt-III (IT) 1 st Semester Examination, 2023. Subject: Computer Organization & Architecture. Paper: IT504


B.Tech. Pt-III (IT) 2nd Semester Examination, 2024 --- Compiler Design (IT601)

Department of Engineering and Technological 


Studies, 


University of Kalyani


B.Tech. Pt-III (IT) 2nd Semester 


Examination, 2024


Subject: Compiler Design


Paper: IT601


Full marks=70 Time: 3 Hours


The figures in the right-hand margin indicate 

marks.


Candidate are required to give their answers 


in their own words as far as possible.


The notations follow their standard 

meanings.


Answer question number one and

 any five from rest.


1.   Answer any ten questions:                                                                

                                                                                                                            (2 x 10 = 20)


    a)     What do you mean by utility program?


    b)     Define cross-compiler.


    c)     What do you mean by 

               Incremental-compiler?


    d)     Define top-down and bottom-up parsing.


    e)     What do you mean by shift / reduce 

            and reduce / reduce conflict?


    f)     What is the relation between regular

             expressions a* and a+ ?


    g)     What do you mean by intermediate

             code generation ?


    h)     What are the purpose of 

                activation record ?


    i)     Discuss the importance of symbol

             table in compiler design.


    j)     What are the role of laxical analyzer

             in compiler design?


    k)     What are the role of syntax analyzer

             in compiler design?


    l)     What are the role of semantic analysis

             in compiler design?


    m)   Write down the advantage of optimized

             code over non-optimized code.


    n)    Show that for improving the locality


         of reference the optimizer exchange the

         inner loops with outer loops.


    o)     Compare the expression A * B and A + A + ... + A(B-times) in terms of strength
            reduction from code.

2. a)     Represents the relationship between

             the phases of a compiler.


    b)     Match all items in Group 1 with correct 

            options from those given in Group 2.


Group 1

Group 2


Regular expression


Syntax analysis


Pushdown 

automata


Code generation


Dataflow analysis


Laxical analysis


Register allocation


Code optimization


 c)     Distinguish between NFA and DFA. 

            Compare their powers as token

             recognizer.

                                                                                                                                            (4+2+4)



3. a)     What do you mean by left recursive 

            grammar? 

            Eliminate the left recursion from

            the following grammar rule 

A -> Aɑ1 | Aɑ2 | ... | Aɑm | β1 | β2 | ... | βn .


    b)     What do you mean by operator 

grammar? Give example.


    c)     What are the different types of 

common error occuring in programs?

                                                                                                                                            (4+3+3)


4. a)     Define First(A), Follow(A), and

 nullable(A) for a grammer.

   

 b)    Find the First, Follow and nullable for 

each of the non-terminal in the following 

grammar     


E -> ME’ , E’ -> ɛ , E’ -> +ME’ , M -> AM’ , 

M’ -> ɛ , M’ -> *AM’ , A -> num , A -> (E) .


    c)     What do you mean by LR parsing ? 

Write down different methods to perform

 LR parsing.    

                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                (3+5+2) 


5. a)     Define non-recursive predictive 

parsing-LL(k) parsing.


    b)     Write down the conditions that a given

 grammar is LL(1) grammar.


    c)     Prove that the grammar 

S -> A | B, A -> cA + b | a, B -> cB + a | b 

is not LL(1).

                                                                                                                                                (2+3+5)


6. a)     What do you mean by code 

optimization? 

Discuss different types of code 

            optimization technique.

   

     b)     Discuss loop fission, loop fusion, 

loop unrolling in a loop optimization technique.


    c)     Consider following piece of program:

                a = c + d , e = a + b , f = e – 1

            What is the fewest number of register 

that are needed for the program ?

                                                                                                                                            (5+3+2)


7. a)     What do you mean by Abstract Syntax

 Trees (AST) ?


    b)     Draw a Abstract Syntax Trees (AST) 

of the following piece of code.

               

         If x > 0 then x = 3 * (y + 1) else y = y + 1


c)     What do you mean by Directed Acyclic

 Graphs (DAGs)?


d) Construct a Directed Acyclic Graphs (DAGs)

     of the following piece of code.


   If x > 0 then x = 3 * (y + 1) else y = y + 1

    


                                                                                                                                            (2+3+2+3)




8.     Short notes:

                                                                                                                                                    (2 x 5)


        Answer any two of the following:


        a)     Compiler vs. Interpreter.

        b)     The lexical analysis tool-LEX.

        c)     Parser generator-YACC.

        d)     Challenges in complier design and

                 its application.






--------------------End-------------------



Home

Soft Computing Laboratory Assignments-I, II, III (click here) PRINCIPAL COMPONENT ANALYSIS (PCA) (click here) Soft Computing Laboratory Assi...