Soft Computing Uploading

download Soft Computing Uploading

of 13

Transcript of Soft Computing Uploading

  • 8/3/2019 Soft Computing Uploading

    1/13

    SOFT COMPUTING

    1. A. Define : - Artificial Intelligence.

    B. Mention the characteristics of an artificialintelligent problem.

    2. A. How to represent a problem in State Space Search?

    Explain with an example

    B. Discuss on Depth First Search and Breadth First

    search.

    3. A. How knowledge can be represented throughPrepositional Logic?

    B. Explain the importance of Scripts and Frames.

    4. A. Define RESOLUTION.

    B. With an Example discuss on UNIFICATIONalgorithm.

    5. A. Define Fuzzy Sets.

    B. Discuss on Fuzzy Reasoning.

    6. A. How Membership functions can be included inFuzzy Set?

    B. Discuss on Fuzzy relations.

    7. A. How learning can be done with simple neurons?

    B. Explain the concept of Back Propagation Network.

    8. Discuss the following in Genetic Algorithms:

    i. Rank Method.

    j. Rank Space Method.

    SOFT COMPUTING Page1

  • 8/3/2019 Soft Computing Uploading

    2/13

    Artificial Intelligence (AI)

    Artificial intelligence, commonly abbreviated as AI, also known as

    machine intelligence, is the practice of developing algorithmsthat make machines (usually computers) able to make seeminglyintelligent decisions, or act as if possessing intelligence of ahuman scale.

    The branch of computer science concerned with making

    computers behave like humans. The term was coined in 1956 by

    John McCarthy at the Massachusetts Institute of Technology.

    Artificial intelligence includes

    o games playing: programming computers to play

    games such as chess and checkerso expert systems : programming computers to make

    decisions in real-life situations (for example, some expertsystems help doctors diagnose diseases based onsymptoms)

    o natural language : programming computers tounderstand natural human languages

    o neural networks : Systems that simulateintelligence by attempting to reproduce the types ofphysical connections that occur in animal brains

    o robotics : programming computers to see and hear

    and react to other sensory stimuli

    Problem Characteristics:

    The term heuristic is used for algorithms which find solutionsamong all possible ones, but they do not guarantee that the best

    will be found, therefore they may be considered as

    approximately and not accurate algorithms. These algorithms,

    usually find a solution close to the best one and they find it fast

    and easily. Sometimes these algorithms can be accurate, that is

    they actually find the best solution, but the algorithm is still

    called heuristic until this best solution is proven to be the best.

    The method used from a heuristic algorithm is one of the known

    methods, such as greediness, but in order to be easy and fast

    the algorithm ignores or even suppresses some of the problem's

    demands.

    SOFT COMPUTING Page2

    http://www.webopedia.com/TERM/A/computer_science.htmlhttp://www.webopedia.com/TERM/A/computer.htmlhttp://www.webopedia.com/TERM/A/artificial_intelligence.html#%23http://www.webopedia.com/TERM/A/program.htmlhttp://www.webopedia.com/TERM/A/artificial_intelligence.html#%23http://www.webopedia.com/TERM/A/expert_system.htmlhttp://www.webopedia.com/TERM/A/natural_language.htmlhttp://www.webopedia.com/TERM/A/language.htmlhttp://www.webopedia.com/TERM/A/neural_network.htmlhttp://www.webopedia.com/TERM/A/system.htmlhttp://www.webopedia.com/TERM/A/robotics.htmlhttp://www.webopedia.com/TERM/A/computer.htmlhttp://www.webopedia.com/TERM/A/artificial_intelligence.html#%23http://www.webopedia.com/TERM/A/program.htmlhttp://www.webopedia.com/TERM/A/artificial_intelligence.html#%23http://www.webopedia.com/TERM/A/expert_system.htmlhttp://www.webopedia.com/TERM/A/natural_language.htmlhttp://www.webopedia.com/TERM/A/language.htmlhttp://www.webopedia.com/TERM/A/neural_network.htmlhttp://www.webopedia.com/TERM/A/system.htmlhttp://www.webopedia.com/TERM/A/robotics.htmlhttp://www.webopedia.com/TERM/A/computer_science.html
  • 8/3/2019 Soft Computing Uploading

    3/13

    Is the problem decomposable into a set of

    nearly independent smaller or easier sub

    problems?

    Can solutions steps be ignored or at least

    undone if they prove unwise?

    Is the problems universe predictable?

    Is a good solution to the problem obvious

    without comparison to all other possible

    solutions?

    Is the desired solution a state of the world or a

    path to a state?

    Is a large amount of knowledge absolutely

    required to solve the problem, or its knowledge

    important only to constrain the search?

    Can a computer that is simply given the

    problem return the solution, or will the solution

    of the problem require interaction between the

    computer and a person?

    Is the problem decomposable?

    Consider the below problem tree where the computer is trying to

    find out a solution to the given problem x2+3x+sin2xcos2xdx.

    x2+3x+sin2xcos2xdx

    x2dx 3xdxsin2xcos2xdx

    SOFT COMPUTING Page3

  • 8/3/2019 Soft Computing Uploading

    4/13

    x3/3 3xdx (1-cos2x)cos2xdx

    3x2/2 cos2xdx -cos4xdx

    From the above problem tree, a set of problem equation has

    been decomposed into smaller further decomposable segments.

    To arrive at this, system checks whether it can be further

    decomposable or not at each and every state by a simple

    recursive integration program. If the steps leads to an answer,

    then the answer is directly returned otherwise it will search will

    go on. Using this technique of problem decomposition, we canoften solve very large problems easily.

    Let us consider one more example.

    We have got three [3] set of cubes namely {A}, {B} & {C}.

    These were to be arranged in such a manner, the Set {A} should

    be placed top followed by set {B} and then by set {C}. Given set

    is like this, Set {B} is outside and set {A} is at the bottom, and

    set {C} is at top. The aim to realign the same as A,B & C from

    top to bottom.

    Start Goal

    SOFT COMPUTING Page4

    C

    A B C

    B

    A

  • 8/3/2019 Soft Computing Uploading

    5/13

    ON (C, A) ON (B, C) & ON (A, B)

    Steps involved in this problem:

    1. CLEAR [x] [block x has nothing on it]

    2. On(x, Table) [Pick up x and put it on the table]

    3. CLEAR (x) and CLEAR (y)

    4. ON(x, y) [put x on y]

    5. ON (B, C) and ON (A, B)

    6. ON (B, C) and ON(A, B)

    7. ON (B, C) and CLEAR (A) and ON (A, B)

    8. ON (B, C) and CLEAR (A) and ON (A, B).

    9. Now GOAL SET (A, B & C) is achieved.

    Figuratively it is achieved as below:

    By this way we can also try to solve puzzle game where it

    consists of 9 cubes placed by 3 x 3 matrix. Out of this, one cube

    will be empty or space. The remaining 8 cubes of the matrix will

    have numbers. The aim of the game is to realign the numbers

    from the present position [What we call it as Startposition] to the new position [what we call it as Goalposition]. Here one has to move the adjacent number to the

    SOFT COMPUTING Page5

    On (b, c) and on (a,b)

    on (a, b)

    clear (a)

    on (a, b)clear (a)On (b,

    c)

    On (b,c)

    on (a, b)

  • 8/3/2019 Soft Computing Uploading

    6/13

    empty cube. Through this means one has to move the numbers

    in such a way that they reach the goal conveniently.

    Is the universe predictable?

    It is the planning that is going to pave way for solutions. Whether

    such planning has to be done well in advance or to be done at

    that time of activity or there is no such possibility of such

    planning? It is to be explored and cant be unique to all problem

    solving games. Considering the 8 cube puzzle and bridge card

    game, where unknown things are available as commonality. But

    in the 8 cube puzzle game before making a move, it is possible

    to compute the permutation and combination of the available

    moves to choose the one. Even if we make a wrong move, then it

    is possible to undo such moves to start from the same position.

    Whereas, it is not so in the game bridge, where once committed

    is once for all committed. Though planning is a must, it needsproper place to be implemented.

    In the first 8 cube puzzle game, even if planning fails there is

    recoverable process. But in the bridge card game, if planning is

    failed, it is out once for all. Improper planning and executing the

    same is very expensive and risky. It may succeed or may not

    succeed. The problem characteristics of this is ignorable versus

    recoverable versus irrecoverable and certain outcome versus

    uncertain outcome.

    Is a Good Solution Absolute or Relative?

    Considering the following database that reveals simple facts:

    1. Marcus was man.

    2. Marcus was a Pompeian.

    3. Marcus was born in 40 A. D.

    4. All men are mortal.

    5. All Pompeian died when the volcano erupted in 79 A. D.6. No mortal lives longer than 150 years.

    7. It is now 2007 A. D.

    Now, if anybody ask one question, whether Marcus is alive or

    Dead? We have to go through the above statement and find out

    the answer.

    SOFT COMPUTING Page6

  • 8/3/2019 Soft Computing Uploading

    7/13

    Let us see the methodology of finding out the answer through

    predicate logic, and using formal inference methods.

    Decisions Justifications.

    8. Marcus was a man. Axiom 1.

    9. All men are mortal. Axiom 4.

    10. Marcus is mortal. 1, 4.

    11. Marcus was born in 40 A. D. Axiom 3.

    12. It is now 2007 A. D. Axiom 7.

    13. Marcus age is 1967 years Axiom 3 & 7.

    14. No mortal lives longer than 150 yrs. Axiom 6.

    15. All Pompeian died when the

    Volcano erupted in 79 A. D. Axiom 5.

    16. So, Marcus is dead. 10, 13 & 14.

    Is the solution A State or Path?

    It is always best to choose the example of traveling salesmen,

    who has to travel from one city to another and a must that he is

    not supposed to return to the same city again and finally he has

    to reach back to his starting position. For this the law of findingthe solution is n-1!, where n is total number of cities, he has to

    travel and assuming that he has to travel from a particular city

    and that is reduced. Say for example, he has to travel 6 cities

    then the answer path will be 5! [5x4x3x2x1 = 120] solutions are

    there to identify the best possible shortest route. So it will be

    always very difficult to identify the best possible shortest route

    for this salesmen route. Though, one may come to a conclusion

    that it is possible to asses certain totally ignoring others for want

    of time and other activities and to proceed based on the

    assumption that the decision taken already is correct. Someoneat some time may come up with best possible shortest route.

    Until then, one will go by the same path.

    What is the role of knowledge?

    Chess and General opinion poll. For chess it is limited option and

    good logic. For general opinion poll, it is lot of reasons. Every

    SOFT COMPUTING Page7

  • 8/3/2019 Soft Computing Uploading

    8/13

    time we have to break our head to identify the reason for our

    success or failures.

    Does the task require Human Interaction or not?

    Answer to this is always difficult as many times, the reason

    assigned by the computer to identify the answer is not known

    properly or at times not acceptable to the human.

    Someone may thing that it is necessary for human interaction.

    We may take the same in the best manner that if the system

    [computer] needs, we can say human is assisting computer and

    if the human requires assistance, it is then assisting human to

    make understand the computer.

    The AI Problem:

    1. Mundane tasks:

    Perception.

    Understanding.

    Speech.

    Natural Language.

    Understanding.

    Generation.

    Translation.

    Common sense reasoning

    Robot Control

    2. Formal Tasks:

    Games.

    Chess.

    Backgammon.

    Checkers.

    Go.

    SOFT COMPUTING Page8

  • 8/3/2019 Soft Computing Uploading

    9/13

    Mathematics.

    Geometry.

    Logic.

    Integral Calculus.

    Proving properties of Programs.

    3. Expert Tasks:

    Engineering.

    Design.

    Fault Finding.

    Manufacturing Planning.

    Scientific Analysis.

    Financial Analysis.

    Medical Analysis.

    Problems, Problem Spaces ad Search.

    1. Define the problem precisely.

    2. Analyze the problem.

    3. Isolate and represent the task knowledge that is necessary

    to solve the problem.

    4. Choose the best problem solving technique(s) and apply

    it to the particular problem.

    SOFT COMPUTING Page9

  • 8/3/2019 Soft Computing Uploading

    10/13

    Defining the problem as a state space search

    A water jug problem:

    Aim to fill 2 gallon water in the 4 gallon water jug using 3 gallon

    water jug, where both 4 and 3 gallon jug does not have any

    marking on it.

    May be on look the answer will be very simple.

    For gods sake, the problem does not mention about the quantity

    of water to be used to fill 2 gallon of water in 4 gallon jug.

    So it is the users choice that by spending n number of gallons of

    water, he can fill 2 gallons of water.

    The steps involved in identifying the same.

    1. There are two jugs without any measurement in it

    but identifying itself as 4 gallons and 3 gallons

    depending on its size [Large 4 gallons and smaller

    3 gallons].

    2. Assuming both the jugs is empty. Let us name the

    bigger jug as x for 4 gallons and smaller jug as y

    for 3 gallons.

    3. Fill 4 gallon jug with water.

    4. Fill 3 gallon jug with water.

    5. Pour all water from 4 gallon jug.

    6. Now, transfer all water from 3 gallon jug to 4 gallon

    jug.

    7. Now, 4 gallon jug has 3 gallons of water and 3 gallon

    jug is empty.

    8. Fill 3 gallon jug full.

    9. Now, 3 gallon jug has 3 gallon water and 4 gallon jugas 3 gallon water.

    10. Pour water from 3 gallon jug carefully to 4 gallon jug

    till it reaches full [Care has to be taken no to drop

    any water down to earth either from 4 gallon jug or 3

    gallon jug].

    SOFT COMPUTING Page10

  • 8/3/2019 Soft Computing Uploading

    11/13

    11. Now 4 gallon jug has 4 gallon water and 3 gallon jug

    after filling the balance 4 gallon jug, now has 2 gallon

    water.

    12. Pour all water from 4 gallon jug.

    13. Now, 4 gallon jug is empty and 3 gallon jug has 2

    gallon water.

    14. Now, transfer the 2 gallon water from 3 gallon jug to

    4 gallon jug so that 4 gallon jug has 2 gallon of

    water.

    The same is represented as table here:

    Gallons in the 4

    Gallon Jug [x] -

    Bigger

    Gallons in the 3

    Gallon Jug [y] -

    Smaller

    Rules applied.

    0 0 Both the jugs are empty.

    4 0Fill jug [x] 4 gallons with

    water.

    4 3Fill jug [y] 3 gallons with

    water.

    0 3 Empty the 4 gallon jug[x].

    3 0Pour all the water from 3gallon jug[y] to 4 gallon

    jug[x].

    3 3Fill 3 gallon jug[y] with

    fresh water.

    4 2

    Pour water from 3 gallon

    jug[y] to 4 gallon jug[x] till

    it is full.

    0 2 Empty the 4 gallon jug[x]

    2 0

    Pour all the water from 3

    gallon jug[y] to 4 gallon

    jug[x] - RESULT

    SOFT COMPUTING Page11

  • 8/3/2019 Soft Computing Uploading

    12/13

    Breadth First Search - How it works

    BFS is an uninformed search method that aims to expand and examine all nodes of

    a graph systematically in search of a solution. In other words, it exhaustively

    searches the entire graph without considering the goal until it finds it. It does not usea heuristic.

    From the standpoint of the algorithm, all child nodes obtained by expanding a node

    are added to a FIFO queue. In typical implementations, nodes that have not yet

    been examined for their neighbors are placed in some container (such as a queue or

    linked list) called "open" and then once examined are placed in the container

    "closed".

    An example map of Germany with some

    connections between cities.

    The breadth-first tree one gets when

    running BFS on the given map and

    starting in Frankfurt.

    Animated example of a breadth-

    first search

    Uninformed search

    An uninformed search algorithm is one that does not take into account the specific

    nature of the problem. As such, they can be implemented in general, and then the

    same implementation can be used in a wide range of problems thanks toabstraction. The drawback is that most search spaces are extremely large, and an

    uninformed search (especially of a tree) will take a reasonable amount of time only

    for small examples. As such, to speed up the process, sometimes only an informed

    search will do.

    SOFT COMPUTING Page12

    http://en.wikipedia.org/wiki/Image:Animated_BFS.gifhttp://en.wikipedia.org/wiki/Image:GermanyBFS.svghttp://en.wikipedia.org/wiki/Image:MapGermanyGraph.svg
  • 8/3/2019 Soft Computing Uploading

    13/13

    Algorithm (informal)

    1. Put the ending node (the root node) in the queue.

    2. Pull a node from the beginning of the queue and examine it.

    If the searched element is found in this node, quit the search and return a result.

    Otherwise push all the (so-far-unexamined) successors (the direct child nodes) of this

    node into the end of the queue, if there are any.

    3. If the queue is empty, every node on the graph has been examined -- quit the search and

    return "not found".

    4. Repeat from Step 2.

    C++ implementation

    This is the implementation of the above informal algorithm, where the "so-far-unexamined" is handled by

    the parent array.

    Suppose we have a struct:

    struct Vertex { ...

    std::vector out; ... }; and an array of vertices: (the algorithm will use the indexes of

    this array, to handle the vertices)

    std::vector graph(vertices); the algorithm starts from start and returns true if there is a

    directed path from start to end:

    bool BFS(const std::vector& graph, int start, int end) {

    std::queue next;std::vector parent(graph.size(), 0);// 0 means filled with zeros.

    parent[start] = -1;

    next.push(start);

    while (!next.empty()) {

    int u = next.front();

    next.pop();

    // Here is the point where you can examine the u th vertex of graph For example:

    if (u == end) return true;

    for (std::vector::const_iterator j = graph[u].out.begin(); j != graph[u].out.end(); ++j) {

    // Look through neighbors.

    int v = *j;

    if (parent[v] == 0) {// If v is unvisited.

    parent[v] = u;

    next.push(v); } } }

    return false;

    }

    SOFT COMPUTING Page13