1 / 17

Some problems

This text provides examples of various problem-solving techniques, including Tic Tac Toe, Missionaries and Cannibals, Farmer and Cabbage, Cryptarithmetic, and more.

debose
Download Presentation

Some problems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Some problems Cse-402 K3r20,k3r23

  2. Tic Tac Toe 1 Board Move table  A vector of 19,683 elements

  3. Tic Tac Toe 2 Board turn

  4. Question Answering Example Mary went shopping for a new coat. She found a red one she really liked. When she got it home, she discovered that it went perfectly with her favorite dress.  Q1 : What did Mary go shopping for?  Q1 : What did Mary find that she liked?  Q1 : Did Mary buy anything?

  5. A Structure Representation of a Sentence

  6. A Shopping Script

  7. Missionaries and Cannibals There are 3 missionaries, 3 cannibals, and 1 boat that can carry up to two people on one side of a river. • Goal: Move all the missionaries and cannibals across the river. • Constraint: Missionaries can never be outnumbered by cannibals on either side of river, or else the missionaries are killed. • State: configuration of missionaries and cannibals and boat on each side of river. • Operators: Move boat containing some set of occupants across the river (in either direction) to the other side.

  8. Missionaries and Cannibals Solution Near sideFar side 0 I nitial setup: MMMCCC B - 1 Two cannibals cross over: MMMC B CC 2 One comes back: MMMCC B C 3 Two cannibals go over again: MMM B CCC 4 One comes back: MMMC B CC 5 Two missionaries cross: MC B MMCC 6 A missionary & cannibal return: MMCC B MC 7 Two missionaries cross again: CC B MMMC 8 A cannibal returns: CCC B MMM 9 Two cannibals cross: C B MMMCC 10 One returns: CC B MMMC 11 And brings over the third: - B MMMCCC

  9. State space Representation of Farmer, wolf, goat and cabbage problem: • A farmer with wolf, goat & cabbage come to the edge of river. They want to cross the river. There is a boat at river edge but only the farmer can row, the boat can carry two things at a time. If the wolf is ever left alone with the goat, the wolf will eat the goat, similarly if the goat is left alone with cabbage, the goat will eat cabbage. Schedule the things so that all four characters arrive safely on the other side of the river. • Man →M • Wolf →W • Goat →G • Cabbage →C • Seq. of crossing the river so that all four character arrive safely is • First Man cross the river with goat. • Man come back. • Man either takes cabbage or wolf with him to another side. • Man comes back with goat to first side. • Man taken wolf (or cabbage) with him to another side. • Man comes back. • Man takes goat with him to another back.

  10. Cryptarithmetic • Find an assignment of digits (0, ..., 9) to letters so that a given arithmetic expression is true. examples: SEND + MORE = MONEY and FORTY Solution: 29786 + TEN 850 + TEN 850 ----- ----- SIXTY 31486 F=2, O=9, R=7, etc. • Note: In this problem, the solution is NOT a sequence of actions that transforms the initial state into the goal state, but rather the solution is simply finding a goal node that includes an assignment of digits to each of the distinct letters in the given problem.

  11. CRYPTARITHMET In this method we want result by satisfying all the constraints and get value of each variable. CY2 CY1 O N E O N E O N E O N E -------------------------- T E N SOLUTION: E=2, N=8, CY2=3,CY1=0, O=1, T=7

  12. Different choices of E and corresponding different choices of N will leads to a states of problems and problem will become the state space problem when E=1 N= E+E+E+E = 4 N+N+N+N= 4+4+4+4 = 16 CY2=1 & E-=6(Invalid Result) when E=2 N= E+E+E+E = 8 N+N+N+N=8+8+8+8= 32 CY2=3 AND E = 2( valid choice) when E=3 N= E+E+E+E=3+3+3+3=12 N=2 AND CY1=1 CY1+N+N+N+N=1+2+2+2+2=9 CY2=0 & E=9 (Invalid result)

  13. when E=4 N= E+E+E+E = 4+4+4+4=16 N=6 & CY1=1 N+N+N+N+CY1 = 6+6+6+6+1 =25 CY2=2 & E=5(Invalid choice) when E=5 N= E+E+E+E = 5+5+5+5 = 20 N=0 & CY1=2 N+N+N+N+CY1 = 0+0+0+0+2 = 2 CY2=0 & E=2(Invalid Choice) when E=6 N= E+E+E+E = 6+6+6+6 = 24 N=4 & CY1=2 N+N+N+N+CY1 = 4+4+4+4+2=18 CY2=1 & E=8(Invalid choice)

  14. when E=7 N= E+E+E+E = 7+7+7+7 = 28 CY1=2 & N=8 N+N+N+N+CY1 = 8+8+8+8+2=34 CY2=3 & E=4(Invalid Choice) when E=8 N= E+E+E+E = 8+8+8+8 = 32 CY1=3 & N=2 N+N+N+N+CY1 = 2+2+2+2+3=11 CY2=1 & E=1(Invalid Choice) when E=9 N= E+E+E+E = 9+9+9+9 = 36 CY1=3 & N=6 N+N+N+N+CY1= 6+6+6+6+3= 27 CY2=2 & E=7(Invalid choice) Now This is Confirm that the valid choice of E is 2 and choice of N is 8

  15. we want to know the choice of the O As we see that the T is the summation of Four O and has no carry in result there is a previous carry CY2(3) in O Now T= O+O+O+O+CY2(3) So there is only one choice of O Which is 1 as if we take the choice of greater than 1 it means the result exceeds 10 and there is definitely one carry in the result which is not there in the result so we will take the choice O=1 in the problem and this one leads to the following result T=1+1+1+1+3 =7

  16. Thank You!!!

More Related