CSC325 Artificial Intelligence – Lab Exercise 1 solved

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (5 votes)

Task 1
Write a Python program to play the 24 Game. Please see
https://en.wikipedia.org/wiki/24_Game
for the game description. Specifically, your program needs to do the following:
ˆ Randomly generate 4 integers in the interval [1, 13].
ˆ Use these 4 numbers as input for a 24 Game and solve it in two cases:
1. return a single solution for the input; and
2. return all solutions;
For instance, given numbers (6, 1, 6, 9), your program should find solutions including
((9 − 6) + 1) × 6,
which you can represent as:
Input: [6, 1, 6, 9]
Found Solution: (9sub6); (3add1); (4mul6).
ˆ Record the processing time for both cases.
Task 2
Generalise your program so it takes N (N ≥ 4) integers from the interval [a, b], where 0 ≤ a ≤ b,
and produces an integer M. Analyse the performance of your program with respect to parameters
a, b, N and M.