Jump to content

zak100

Senior Members
  • Posts

    233
  • Joined

  • Last visited

Everything posted by zak100

  1. Hi, Thanks. If I get time, I would come back to your post. God blesses you for giving me more explanation. Surely this would help others. Zulfi.
  2. Hi, "On sunny days weddings are sometimes held in the garden and sometimes not.” The above is a good answer. God blesses you. If there is problem I would state again. Zulfi.
  3. Hi, I am reading a tutorial which translates the following sentence into logic: The translation is: Sunny_days => garden_weddings The "implies" formula is given by: P => Q is given by: ~P V Q I can't understand this translation. According to the formula we should have: not sunny_days V garden_wedding which can be stated in English as: On sunny days weddings are held in the garden However the tutorial translates it into: "Either not sunny days weddings are held in the garden" I can't understand this, why we have 'not" before sunny_days. Original sentence does not use 'not' with sunny_days. I have attached the tutorial file. Somebody please guide me. Zulfi. Watson_proposition logic.pdf
  4. Hi, Can I unify the following arguments? p(X, X) and p(a, Z) Here 'X' is a variable and 'a' is a constant. We can unify them but can we unify 2nd argument which is again 'X' with a variable 'Z'. Previously we unified 'X' with a constant and now we have to unify 'X' with a variable, I think its not allowed. Similarly for: p(X, X) and p(a,b) Now we have to unify 'X' with two different constants. I don't think this is possible. Somebody please guide me. Zulfi.
  5. Hi, I have got the formula for conditional probability: Above is the formula for conditional probabilities. I don’t know how to read it: P(A|B) = conditional probability of occurring A if B has occurred. Am I write? Zulfi. Hi, I have got the following slide related to probability axiom from the following site: http://www.eecs.qmul.ac.uk/~norman/BBNs/BBNs.htm I have following questions about the probability axiom slide: Q1. What is op? I think its op = opposite. But in the equation: 1 = P(a op -a) Are they considering op same as “or” What does Pi(alpha) represents in the last equation? Some body please guide me. Zulfi.
  6. Hi, I am trying to understand the Bayesian network. I understand it is based upon conditional probabilities. I need a quick tutorial for it. I found an example on Wikepedia: https://en.wikipedia.org/wiki/Bayesian_network, but the mathematical formulae are creating problem. Somebody please guide me the example discussed in the wikepedia. I want to understand the 3 tables and the graph. Zulfi.
  7. Hi, I am following the syntax of our teacher and he says that "U" is for union and it is same as "+" or logical "or" operator. I don't know what you mean by union. Sorry for not specifying this earlier. Please tell me what you guys mean by "U" in the context of regular expression? Sensei: I would try the calculator and then let you know. Zulfi.
  8. Hi, "Maybe you could clarify if actually wish to discuss regular expressions* or something else? " I am discussing about regular expressions. Its not programming/logic, its automata theory course. In my opening post "U" means the union, its same as "+" and I am talking about regular expression. "*" means zero or more repititions. I don't know about negative. "Also, just a friendly reminder; we are on a discussion forum, your short questions "please tell me", "please give examples" etc does not, in my opinion, promote fruitful discussions." Whatever information, I have I used to provide, i.e. code, images and expressions. If you need more information please let me know. Zulfi.
  9. Hi, Thanks for your response. Sorry ALine this is automata theory. Ghideon: Please tell me what you ean by one and two capturing groups? Sensei: Please give mme some example how the online debugger can help me to differentiate? (bba U aab)*= bba, aab, aab, bba ... or empty Can't we not have bbabbaabaab in the above regular expression? (bba)* U (aab)* = bba, bbabba, bbabbabba, empty, aab, aabaab Please tell me is my answer correct? Zulfi.
  10. Hi, I have got following regular expression: (bba U aab)* Is this similar to: (bba)* U (aab)* I think they are same, please guide me. Zulfi.
  11. Hi, Thanks all, I had a very short time but appreciate your efforts. Any other would definitely benefit from it. However, I used only : print("\a"). This was a great experience. I have once developed cross and zero game but 8-board game proved very lengthy for me and I did it using Python. Definitely this experience woul help me if I learn some ML skills also in Python. God blesses you all. Zulfi.
  12. Hi, Kindly guide me some code for producing sound or music which I can use for indicating that a computer piece has been killed or the computer has killed the piece. Small file just executable for 2 or 3 secs. I am working in text mode. Zulfi.
  13. Hi, Thanks a lot. I would try with my approach right now because time is too short for submission. But I want to learn how we can apply heuristic based upon minimax or HCA (Hill climbing Alg). Hope we may continue this discussion. I have example of Tic Toe but can't understand how minimax works for it. Zulfi.
  14. Hi, I am getting the same error at other place. This time I am using the "return" statement also. The error occurs at this statement. result = [] result = self.checkTheBelow_Squeeze(curr_row, col) resOfChkBelowSqueeze, cntOfBelowSqueezed = result The complete function code is given below: def checkTheBelow_Squeeze(self, curr_row, col): print("CheckTheBelow Squeeze 1:Entered the function") if (curr_row >= 2): found = False opp_piece_found = False for row in range(curr_row-1,-1, -1): #loop will run downwards to 0 not -1 if (Board.Matrix[row][col] == -1): # next above location is empty so no squeeze possible print("CheckTheBelow Squeeze 2:Not possible b/c space found") found = False cntOfBelowSqueezed = 0 break elif (Board.Matrix[row][col] >= 0 and Board.Matrix[row][col] <= 7): # opp_piece_found if (row == 0): # we have reached the bottom row but comp piece not found only sequeces of opp piece, so no squeeze print("CheckTheBelow Squeeze 3:Not possible b/c row zero reached") found = False cntOfBelowSqueezed = 0 break else: if (opp_piece_found == False): # current element is opp_piece and we have not reached the end row, so squeeze maybe found opp_piece_found = True cntOfBelowSqueezed = 1 else: if (cntOfBelowSqueezed < 7): #Another opponet piece found cntOfBelowSqueezed = cntOfBelowSqueezed + 1 print("CheckTheBelow Squeeze 4:Another opp piece found, count =" + str(cntOfBelowSqueezed)) else: print("This is trouble: cnt is more than 7") elif (Board.Matrix[curr_row][col] >= 8 and Board.Matrix[curr_row][col] <= 15): if (opp_piece_found == True): found = True print("CheckTheBelow Squeeze 5:Computer piece found, squeeze successful, count =" + str(cntOfBelowSqueezed)) break; else: print("CheckTheBelow Squeeze 6:Not possible b/c computer piece found before opp piece") found = False cntOfBelowSqueezed = 0 break if (cntOfBelowSqueezed==0): return False, cntOfBelowSqueezed else: return True, cntOfBelowSqueezed Somebody please guide me. Zulfi. Hi, I found the error, problem was again the return statement. I was using "if condition" and return statement was inside "if" but "if condition' got false so return did not execute
  15. Hi, I have already provided the solution, please tell me your comments if its wrong or right, if its wrong, I would search more. Zulfi.
  16. Hi, findComputerMove(....): Above function is not returning values, Thanks a lot. To any one of my classmates: This is my assignment, if anybody copies my logic, he is the copier, I am not because I am using my name and logic is mine. Zulfi.
  17. Okay. Good response. I would check Zulfi Hi, Thanks a lot, I solved the problem. God blesses you. Zulfi.
  18. Hi, Thanks for your response. Ghideon: I have written more than 700 lines of code but now I want to do testing of the board so I created this small code. In my original program, I am not getting this error. I can't understand what to do? I would integrate this code with my original program but now I am stuck. FragmentedCurve: findComputer(....) is returning 3 values and this code is working fine in original program. Please guide me. Please guide me. Zulfi.
  19. Hi, I am creating a two board game. Kindly guide me about a simple technique related to Heuristics.If possible kindly tell me about pruning. I have 8 pieces on both sides. I am thinking to move 3 pieces of both ends together and keep two pieces fixed. Is this a good idea for Heuristics Zulfi.
  20. Hi, I have written code, I am presenting a portion of it. I want to modify my original code for inputting, so I have created this portion for testing. My code is: import numpy as np class Board: #Matrix = np.empty((8, 8)) #Matrix.fill(0) #create a 8 * 8 matrix, each entry is -1, indicating no activity on the board Matrix = np.array( [[-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1]]) def __init__(self, n): # runs from 0 to n-1. So there is no need for subtracting -1 from the range argument. # str(INT) converts integer to string self.n=n def findComputerMove(self, row, column, pieceStr): print("Inside find Computer Move") def computerModule(self, pieceStr): n = 8 row = -1 column = -1 pName = "" row, column, pName = self.findComputerMove(row, column, pieceStr) return True def main(self): n = 8 row = -1 column = -1 pName = "" moveCount = 0 # self.display(n) # self.displayBDMatrix(n) #self.createInitialBoard(n) userMove = True compMove = True draw = False while (userMove and compMove and not draw): if (moveCount % 2 == 0): pieceStr = "Y" compMove = self.computerModule(pieceStr) print("compMove=", compMove) else: pieceStr = "X" userMove, draw = self.userModeule(pieceStr, draw) moveCount = moveCount + 1 if (draw): print("Game drawn, nobody wins") return if (userMove == True): print("User wins the game") else: print("Computer wins the game") if __name__ == "__main__": objBoard = Board(8) objBoard.main() I am getting following error message: Somebody please guide me. Zulfi.
  21. Hi, I read the following post: https://stackoverflow.com/questions/8060028/what-is-the-difference-between-hill-climbing-and-greedy-algorithms It says that Hill Climbing will generate the solution randomly whereas Gradient Search will always use the smallest value. That looks fine with me. Zulfi.
  22. Hi, In the attached image why we don't go to ABHK? Please guide me. Zulfi.
  23. Hi, I am just interested in Simple Hill climbing, This is what I have to do. I am just telling you the problem which the original posted faced in the stack Exchange link. If you please read the question asked by the poster at the stack exchange link which I have provided and then kindly tell me how can I solve that problem, it would be helpful to me. Local minima is related to current segment but global minima is related to the whole tree. Zulfi.
  24. Hi, Thanks for your response. God blesses you. They are saying that if I got stuck at 'g' , I can select 'j' or 'c', for selecting 'j' I have to go back to 'a' which is backtracking and they are saying that backtracking not possible. Please guide me how to seect 'j' or 'c' without back tracking. Please guide me' Zulfi.
  25. Hi, I am trying to understand the Hill Climbing algorithm. I found a question at: https://stackoverflow.com/questions/8946719/hill-climbing-algorithm-simple-example Somebody please guide me. Zulfi.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.