Question

In: Computer Science

Write pseudocode to implement the paranoid algorithm. (You vs 2 other players)

Write pseudocode to implement the paranoid algorithm. (You vs 2 other players)

Solutions

Expert Solution

PSEUDOCODE:

Pseudocode is an informal way of programming description that does not require any strict programming language syntax or underlying technology considerations. It is used for creating an outline or a rough draft of a program. Pseudocode summarizes a program’s flow, but excludes underlying details. System designers write pseudocode to ensure that programmers understand a software project's requirements and align code accordingly.

PARANOID ALGORITHM:

The paranoid algorithm does this by reducing a n-player game to a 2-player game.

EXAMPLE OF PARANOID ALGORITHM:

The paranoid algorithm reduces the multi-player game to a two-player game by making the “paranoid” assumption. The algorithm assumes that all opponents have formed a coalition against the root player. By doing so, regular αβ pruning is possible. This leads to a larger search depth.depicts an example of the paranoid algorithm. It is the same tree, but now the leaf nodes are evaluated in a paranoid way.

Here, the sum of the evaluation scores of Player 2 and 3 are subtracted from the evaluation score of Player 1 . A second possibility is that Players 2 and 3 ignore their own score, and only minimize Player 1’s score. In Node (b), the right child is preferred with value -3. After finding -4 as value of the first child of Node (c), all the remaining children can be safely pruned according to the standard αβ rule. The root node (a) receives value -3. In the best case, O(b d/2 ) nodes are expanded for two-player games , where b is the average branching factor and d the search depth. Sturtevant and Korf showed that the paranoid algorithm expands O b d×(n−1)/n nodes in the best case fomulti-player games, which is a generalization of the best case for two-player games. Paranoid may outperform maxn due to the larger lookahead (e.g., for Chinese Checkers or Hearts).

Because of the unrealistic paranoid assumption, suboptimal play can occur [3]. Furthermore, if an infinite amount of time would be available, the root player might assume that all moves are losing, leading to poor play. For the game of RolitTM, Saito and Winands [5] showed that for three players on the 6×6 board, the first and second player cannot gain any points under the paranoid assumption (and the third player only 1 point because he places the last stone). Usually, it is not possible to win when all opponents form a coalition. As a general observation, the deeper the search goes, the more pessimistic the value of the root becomes.


Related Solutions

Implement the following pseudocode in Python Consider the following pseudocode for a sorting algorithm: STOOGESORT(A[0 ......
Implement the following pseudocode in Python Consider the following pseudocode for a sorting algorithm: STOOGESORT(A[0 ... n - 1]) if (n = 2) and A[0] > A[1] swap A[0] and A[1] else if n > 2 m = ceiling(2n/3) STOOGESORT(A[0 ... m - 1]) STOOGESORT(A[n - m ... n - 1]) STOOGESORT(A[0 ... m - 1])
Tasks 2 Write algorithms in pseudocode to implement a LinkedList The following operations must be performed...
Tasks 2 Write algorithms in pseudocode to implement a LinkedList The following operations must be performed on the LinkedList: *Add an element *Insert an element at a given position x. *Retrieve/Read the value of an element at position y. *Delete an element from position z. (x,y and z represent any value in the valid range of indices of the LinkedList).
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the...
Write a Python program that: Create the algorithm in both flowchart and pseudocode forms for the following requirements: Reads in a series of positive integers,  one number at a time;  and Calculate the product (multiplication) of all the integers less than 25,  and Calculate the sum (addition) of all the integers greater than or equal to 25. Use 0 as a sentinel value, which stops the input loop. [ If the input is 0 that means the end of the input list. ]...
Write an algorithm (in pseudocode, with proper indentation for blocks of code in loops or conditional...
Write an algorithm (in pseudocode, with proper indentation for blocks of code in loops or conditional statements) that finds and returns the location of the first negative integer in a sequence of integers.
LargestTwo problem: Based upon the pseudocode code below, implement in C++ a divide-and-conquer algorithm that finds...
LargestTwo problem: Based upon the pseudocode code below, implement in C++ a divide-and-conquer algorithm that finds the largest and second largest value from a vector of ints. void LargestTwo (vector l, int left, int right, int & largest, int & secondLargest) • Please write comment for your functions, similar to the one in the pseudocode, to include both pre- and post-conditions. • Comment on the logic of your code, e.g., what is true after the two recursive calls? • Answer...
1a. Write pseudocode for a divide-and-conquer algorithm for finding the po- sition of the largest element...
1a. Write pseudocode for a divide-and-conquer algorithm for finding the po- sition of the largest element in an array of n numbers. 5. Find the order of growth for solutions of the following recurrences. a . T(n)=4T(n/2)+n,T(1)=1 b. T(n)=4T(n/2)+n2,T(1)=1 c. T(n)=4T(n/2)+n3,T(1)=1
Write an algorithm in pseudocode for the binary search method using a while loop (iterative version)...
Write an algorithm in pseudocode for the binary search method using a while loop (iterative version) The recursive ternarySearch method returns true or false depending if the element was found or not. The ternarySearch method works in a similar manner to a binary search except it uses two mid values that “divide” the array into three portions. So, it needs to consider three recursive scenarios: See sample run: Accounts are: [0] 5658845 [1] 8080152 [2] 1005231 [3] 4520125 [4] 4562555...
Write an algorithm in pseudocode for the binary search method using a while loop (iterative version)...
Write an algorithm in pseudocode for the binary search method using a while loop (iterative version) The recursive ternarySearch method returns true or false depending if the element was found or not. The ternarySearch method works in a similar manner to a binary search except it uses two mid values that “divide” the array into three portions. So, it needs to consider three recursive scenarios: See sample run: Accounts are: [0] 5658845 [1] 8080152 [2] 1005231 [3] 4520125 [4] 4562555...
Write an algorithm (flowchart OR Pseudocode) for the following problem Take input character from the user...
Write an algorithm (flowchart OR Pseudocode) for the following problem Take input character from the user unless he enters '$'. Thereafter display how may vowels were entered by the user. Also display the number of each vowel ('a', 'e', 'i', 'o' and 'u') separately. For example if the user enters B a b e c o o d i u g o a l $ Then we have the output below: #A=2 #E=1 #I=1 #O=3 #U=2
Write pseudocode for an algorithm that calculates the Hamming distance between two strings s1 and s2...
Write pseudocode for an algorithm that calculates the Hamming distance between two strings s1 and s2 of the same length n. What is the complexity of your algorithm?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT