Monkey And Banana Problem In Artificial Intelligence Pdf
- and pdf
- Tuesday, May 11, 2021 5:54:22 AM
- 2 comment
File Name: monkey and banana problem in artificial intelligence .zip
However, I'm running into a "Out of local stack" error.
- ★ Monkey and banana problem
- Code Critique: AI and Animal Experimentation reading in Protosynthex III, 'There is a Monkey'
- Monkey’s Revenge: Coordinate Geometry Learning Environment with Game-Like Elements
The monkey is in the room.
★ Monkey and banana problem
We will developthe programin the non-proceduralway, andthenstudyits proceduralbehaviourin detail. The programwill be compactand illustrative. We will usethe followingvariationof the problem. Thereis a monkeyat the door into a room. The monkey is hungry and wants to get the banana,but he cannot stretchhigh enoughfrom the floor. At the window of the room there is a box the monkeymay use. The monkeycan perform the followingactions:walk on the floor, climb the box, push the box around if it is alreadyat the box and graspthe bananaif standingon the box directly under the banana.
Can the monkey get the banana? One importanttask in programmingis that of findinga representation of the problem in terms of conceptsof the programminglanguageused. In our casewe canthink of the 'monkeyworld' asalwaysbeingin somestatethat can changein time. The currentstateis determinedby the positionsof the objects. For example,the initial stateof the world is determinedby: 1 Monkey is at door.
It is convenientto combineall of thesefour piecesof information into one structuredobject. Let uschoosethe word'state' asthe functorto hold the four componentstogether. Figure 2. Our problemcanbe viewedasa one-persongame. Let us now formalize the rules of the game. First, the goal of the gameis a situationin which the monkeyhasthe banana;that is, any statein which the lastcomponentis 'has': state - -, -, has state atdoor onfloor atwindow hasnot Figure2.
The four componentsare: horizontalpositionof monkey,verticalpositionof monkey, positionof box, monkeyhasor hasnot the banana. There are four types of moves: 1 graspbanana, 2 climb box, 3 pushbox, 4 walk around. Not all moves are possiblein every possiblestate of the world. For example, the move 'grasp'is only possibleif the monkeyis standingon the box directly under the banana which is in the middle of the room and doesnot havethe bananayet.
M is the move executed and State2is the stateafter the move. The move 'grasp', with its necessarypreconditionon the statebefore the move, can be definedby the clause: move state middle, onbox, middle, hasnot , Vo Before move grasp, Vo Move state middle, onbox, middle, has. Vo After move This fact says that after the move the monkey has the banana, and he has rernained on the box in the middle of the room.
In a similar way we can expressthe fact that the monkey on the floor can walk from any horizontal position Pl to any position P2. The monkey can do this regardlessof the position of the box and whether it has the bananaor not. The clause actually specifiesa whole set of possible moves because it is applicableto any situationthat matches the specified state before the move.
Sucha specificationis thereforesometimesalso called a move schema. Due to the conceptof Prolog variablessuch schemas can be easily programmed in Prolog. The other two types of moves, 'push' and 'climb', can be similarly specified. The main kind of questionthat our programwill haveto answeris: Can the monkey in someinitial state S get the banana? This can be formulated asa predicate canget S where the argumentS is a state of the monkey world.
The program for canget can be basedon two observations: 1 For any stateS in which the monkeyalreadyhasthe banana,the predi- cate cangetmust certainly be true; no move is neededin this case. This correspondsto the Prolog fact: cange state -, -, -, has. The monkeycan get the bananain any state51 if there is somemoveM from state51 to somestate 52, suchthat the monkeycan then get the bananain state52 in zero or more moves. This principleis illustratedin Figure2. This completesour programwhich is shownin Figure2.
The formulation of canget is recursive and is similar to that of the predecessor relation of Chapter 1 compare Figures 2. I3 and 1. This prin- ciple is usedin Prolog againand again. Vo canget State :monkeycan get bananain State canget state -, -, -, has. Vo Get it now Figure2. Let us now study its procedural behaviour by consideringttre following question to the program:? The processcarriedout by Prologto reachthis answer proceeds,accordingto the proceduralsemantics of Prolog,througha sequence of goal lists.
It involves some searchfor right moves among the possible alternativemoves. At somepoint this searchwill take a wrongmoveleadingto a deadbranch. At this stage,backtrackingwill help it to recover. To answerthe question Prolog had to backtrackonce only.
A right sequenceof moves was found almost straight away. The reason for this efficiency of the program was the order in which the clausesabout the move relationoccurredin the program. The order in our case luckily turnedout to be quite suitable. The searchstartsat the top node and proceedsdownwards, as indicated. Alternative moves are tried in the left-to-risht order.
Backtrackingoccurredonce only. A more thoroughinvestigationwill reveal,asshownin the followingsection,that the ordering of clausesis, in the caseof our program, in fact critical. Thissaysthat 'p is trueif p is true'. In fact, such a clausecan causeproblemsto Prolog. Considerthe question: '! Usingthe clauseabove,the goalp is replacedby the samegoalp; this will be in turn replacedby p, etc.
In sucha caseProlog will enter an infinite loop not noticingthat no progressis beingmade. This example is a simple way of getting Prolog to loop indefinitely. However,similarloopingcouldhaveoccurredin someof our previousexample programsif we changedthe order of clauses,or the order of goals in the clauses.
It will be instructiveto considersomeexamples. In the monkeyand bananaprogram,the clausesaboutthe moverelation were ordered thus: grasp, climb, push, walk perhaps. Theseclausessaythat graspingis possible,climbing is possible,etc. Accordingto the proceduralsemanticsof prolog, the order oi clausesindicatesthat the monkey prefersgraspingto climbing, climbing to pushing,etc. This order of preferencesin fact helpsthe monkeyto solvethe problem.
But what couldhappenif the orderwasdifferent? Let us assumethat the 'walk' clauseappearsfirst. The executionof our original goal of the previoussection?
The first four goal lists with variablesappropriatelyrenamed are the sameas before: 1 canget state atdoor, onfloor, atwindow, hasnot The second clause of canget 'c anz' is applied, producing: 2 move state atdoor, onfloor, atwindow, hasnot , M,, S2, , canget s2' By the move walk atdoor, PZ' we get: 3 canget state Pz', onfloor, atwindow, hasnot using the clause 'can?
The first clause whose head matches the first goal above is now 'walk' and not 'climb' as before. Therefore the goal list becomes: 5 canget state P2", onfloor, atwindow, hasnot Applying the clauseocan? They are the sameapart from onevariable;thisvariableis, in turn, P', P" andP"'. As we know, the success of a goaldoesnot dependon particularnamesof variablesin the goal. This means that from goal list 3 the executiontrace showsno progress. We can see,in fact, that the sametwo clauses,'can2' and 'walk', are usedrepetitively.
The monkey walks around without ever trying to use the box. As there is no progressmade this will theoretically go on for ever: Prolog will not realize that there is no point in continuingalongthis line.
This exampleshowsProlog trying to solvea problem in sucha way that a solutiortis never reached,althougha solutionexists. Suchsituationsare not unusualin Prolog programming. Infinite loopsare, also,not unusualin other progtamming languages.
What l'sunusualin comparisonwith other languages is that the declarativemeaning of a Prolog program may be correct, but the program is at the same time procedurally incorrect in that it is not able to producean answerto a question. In suchcasesPrologmaynot be ableto satisfy a goal becauseit tries to reachan answerby choosinga wrong path. A natural questionto ask at this point is: Can we not make somemore substantialchangeto our programso as to drasticallypreventany dangerof looping?
Or shallwe alwayshaveto rely just on a suitableorderingof clauses andgoals? As it turnsout programs,especiallylargeones,wouldbe too fragile if they just had to rely on some suitableordering. There are severalother methodsthat precludeinfinite loops, and theseare much more generaland robustthan the orderingmethoditself.
Thesetechniqueswill be usedregularly later in the book, especiallyin those chaptersthat deal with path finding, problemsolvirrgand search.
Code Critique: AI and Animal Experimentation reading in Protosynthex III, 'There is a Monkey'
Educational games intend to make learning more enjoyable, but at the potential cost of compromising learning efficiency. Therefore, instead of creating educational games, we have created a learning environment with game-like elements: the elements of games that are engaging. Our approach is to assess each game-like element in terms of benefits such as enhancing engagement as well as its costs such as sensory or working memory overload, with the goal of maximizing both engagement and learning. The tutor basically consists of a series of 8th grade approximately year olds coordinate geometry problems wrapped in a visual cover story. In the narrative, Mike, a boy is thrown out of class for playing a game on his cell phone and encounters a monkey and they become friends. He builds a house for the monkey, but the monkey is not eager to become domesticated and destroys the house, steals his phone and runs away.
Monkey and Banana Example. ▫ There is a monkey at the door of a room. ▫ In the middle of the room a banana hangs Eight Queens Problem (Contd.).
Monkey’s Revenge: Coordinate Geometry Learning Environment with Game-Like Elements
Schwarcz, John F. Burger, Robert F. Year:
Skip to Main Content. A not-for-profit organization, IEEE is the world's largest technical professional organization dedicated to advancing technology for the benefit of humanity. Use of this web site signifies your agreement to the terms and conditions.
Inside the room at the middle a banana is hanging from the ceiling and there is box at the window which can be used by monkey to grasp the banana. Monkey is allowed following actions.
Тут все без обмана. Он стоит десять раз по двадцать миллионов. - Увы, - сказал Нуматака, которому уже наскучило играть, - мы оба знаем, что Танкадо этого так не оставит.
Его голос гремел: - Три. Разница между 238 и 235 - три. Все подняли головы. - Три! - крикнула Сьюзан, перекрывая оглушающую какофонию сирен и чьих-то голосов.
Ты уверена, что мы должны его беспокоить. - Я не собираюсь его беспокоить, - сказала Мидж, протягивая ему трубку. - Это сделаешь .
Это был высокий мужчина крепкого сложения с густыми светлыми волосами и глубокой ямкой на подбородке. Он отличался громким голосом и безвкусно-крикливой манерой одеваться. Коллеги-криптографы прозвали его Галит - таково научное название каменной соли. Хейл же был уверен, что галит - некий драгоценный камень, поэтому считал, что это прозвище вполне соответствует его выдающимся умственным способностям и прекрасному телосложению.
Беккер замахал руками. Ну и порядки. Звук мотора, похожий на визг циркулярной пилы, заставил его повернуться. Парень крупного сложения и прильнувшая к нему сзади девушка въехали на стоянку на стареньком мотоцикле Веспа-250.
Хейл удивленно поднял брови. - Ах какие мы скрытные. А ведь у нас в Третьем узле нет друг от друга секретов. Один за всех и все за одного.