Artificial Intelligence Programming Assignment
Problem Statements
Eight-Queens Puzzle
Is it possible to place eight Queens on a chessboard, so that none of the Queens occupy the same row, column, or diagonal?
Binary Search
Depth-First & Breadth-First Search
Newton’s Method
Take a number whose square root is to be calculated, any positive number.
Take a guess at the number’s square root.
Calculate the square root by improving on the current guess as indicated:
Next guess = (number/ current guess + current guess)/ 2
Repeat this process until the difference between the next guess and the current is within the accepted level of accuracy. The better your guess, the fewer the number of iterations needed to get the square root. A good first guess is typically half the number whose square root is to be calculated. The process is ten repeated until the desired accuracy is achieved.
Newton-Raphson Method
Determine a root of the equation f(x) = x^3-x^2-9x+9 = 0 using the Newton-Raphson method if the initial guess is x1 = 1.5.
Gauss-Siedel Method
Solve the following set of linear simultaneous equations using the Gauss-Seidel method:
10x1 + 2x2 + 3x3 = 11
X1 + 5x2 + 2x3 = 20
3x1 + 2x2 + 6x3 = -12
Theoretical Solutions
Eight-Queens Puzzle
1. Pick a position for the Queen
2. If legal, go to next row.
3. If illegal, pick the next position.
4. If no legal position is found, back up to one row.
If legal positions are found for all eight rows, the problem is solved.
Binary Search
• Search the current node value to see if it equals the search value.
• If the search value is smaller than the current value, make the current node the
left child node.
• Make the current node the right child node.
Depth-First & Breadth-First Search
Depth-First Search:
• Searches as far down the left side of the binary tree.
• When it encounters, NULL, the search switches to the bottom-most right child and
resumes.
Breadth-First Search:
• Remove a node from the queue. This becomes the current node.
• Place all child nodes of the current node onto the queue.
Newton’s Method
• Get a positive number whose square root is to be calculated from the user.
• Get the desired precision.
• While more numbers remain, calculate firs guess, x0.
• Repeat
Xn = 0.5 * (X (n-1) + Number/ X (n-1))
Until abs (Xn - X (n – 1)) *= Desired precision
Get a positive number whose square root is to be calculated from the user.
Get the desired precision.
End while
Newton-Raphson Method
1. Set number of iterations num_iter to zero.
Step Two: The next step, will be to get rid of the square root. So, to get rid of the square root we must square it. Remember with equations, what you do to one side you do it to the other.
The United States minimum wage is not indexed to inflation. Due to this fact, the purchasing power of minimum wage falls as the price of consumer goods increases. The current hourly minimum wage is set at $7.25, however many states do pay above this rate. One example of this is in Michigan, the current hourly minimum wage is $7.40. The last time a change occurred to raise minimum wage was in 2009. President Obama has put out a proposal that is designed to raise the federally required hourly minimum wage to $10.10 in 2015. The public opinion of this proposal is all over the board ranging from a positive outlook to a negative one. Some of the negative remarks are that it would dampen the economy and shrink the hiring done by small businesses. “The Household Survival Budget for the average New Jersey family of four is $58,500 and for a single adult is $25,368 in 2010. These numbers highl...
Raising the minimum wage to $15 an hour has been extensively debated over the last year or so. Minimum wage is the undermost wage allowed by law to be given to an employee for their services. Introduced in 1939, its purpose was to stabilize the economy, which was healing from the Great Depression. Most importantly, it was designed to protect the health and welling-being of employees. Currently, the Federal Government 's minimum is $7.25 per hour ($14,500 per year). The ones in favor of the increase are saying that it used to be a living wage; however, now it is not and it now needs to be line with changes to the cost of living. In addition, an increase in minimum wage can increase the productivity and decrease income inequality and poverty. On the other spectrum, the ones who are against the increase are saying that the increased labor cost will drive up unemployment, affect small businesses negatively, and cause other workers from different
Minimum wage is a difficult number to decide on because it affects different income earning citizens in different ways. According to Principles of Microeconomics, by N. Gregory Mankiw, minimum wage is a law that establishes the lowest price for labor that and employer may pay (Mankiw 6-1b). Currently, the minimum wage in the United States is $7.25 per hour. For many years politicians and citizens have argued on what should be the minimum wage that would benefit the economy and society in general. A minimum wage was first established in 1938 to increase the standard of living of lower class workers. To discuss what is better for the country and its citizens, people have to understand what is a minimum wage and what are its effects.
The shockingly low minimum wage in America is borderline unethical. Since the minimum wage was established in 1938, there’s been controversy about how much it should be. It was originally set at an amount that would allow workers to maintain a minimal standard of living (30 Days). Since then, the minimum wage has been raised 22 times, but this hasn’t been enough to support the same goal. Not only has inflation made minimum wage worth significantly less, but the cost of living has gone up. Two thirds of American citizens support raising minimum wage again (Mantel, 76), but some still oppose it, saying it would hurt jobs and the economy. Although raising the federal minimum wage would most likely cause some jobs to be lost, it should be raised because of the positive effect it would have on poverty rates, the economy, and the individuals living on it.
The first minimum wage was put in place by Congress in 1938 as part of the Fair Labor Standards Act. It was set at twenty-five cents. Since then minimum wage has continually fluctuated, and currently, it is $7.25, but Congress is now considering the Fair Minimum Wage Act (Whittner) which would, over the course of two years, raise minimum wage to $10.10 (Sherk). Adding almost three dollars to the United State’s minimum wage will most certainly have a large, positive impact on the nation. Congress should raise minimum wage because it would boost the economy, it would create jobs, and it would not be right to let people who work full time to live in poverty.
"My name is Dorothy," said the girl, "and I am going to the Emerald City, to ask the Oz to send me back to Kansas."
Analysts will input the following information into a simple linear regression model provided in Excel QM using a simple linear regression formula Yi =b_0+ b_1 X_1. In FIGURE 1-3 the highlighted Coefficients are provided. The b_0 is -18.3975 and the b_1 is 26.3479, these coefficients are added to the formula that is represented in figure 1-4.
As, shown in the Fig. 8 below, for the 2nd queen we only have one place to put it on the chessboard.
First generation languages are machine level languages which basically consist of 1’s and 0’s. Instructions had to be entered through the front switches and no translators were used. The main advantage was that a code written by a user could run very fast and efficiently because it was executed directly by the CPU. They were introduced in the 1940’s. Even though programs written were small and simple, it was hectic to correct it if an error occurred. Examples are architecture specific binary delivered on switches or tapes.
Generates only a single point solution for each iteration, a sequence of those converging to the optimal solution.
With Taylor’s scientific approach decisions are based on science or exact measurements. Estimations made according to convenience are inaccurate and inefficient. Each job is broken down into smaller functions, intern analyzed and timed to the tenth of a second. Through the use of scientific method the best possible way to perform a function is established and put into practice until a time comes when a better method or tool is devised.
That is, the method of iteration will converge if in each equation of the given system, the absolute value of the largest coefficient is greater than the sum of the absolute values of all the remaining coefficients.
Pascal programming language was designed in 1968, and published in 1970. It is a small and efficient language intended to encourage good programming practices using structured programming and data structuring. Pascal was developed by Niklaus Wirth. The language was named in honor of the French mathematician and philosopher Blaise Pascal. In 1641, Pascal created the first arithmetical machine. Some say it was the first computer. Wirth improved the instrument eight years later. In 1650, Pascal left geometry and physics, and started his focus towards religious studies. A generation of students used Pascal as an introduction language in undergraduate courses. Types of Pascal have also frequently been used for everything from research projects to PC games. Niklaus Wirth reports that a first attempt to merge it in Fortran in 1969 was unsuccessful because of Fortran's lack of complex data structures. The second attempt was developed in the Pascal language itself and was operational by mid-1970. A generation of students used Pascal as an introductory language in undergraduate courses. Pascal, in its original form, is a Procedural language and includes the traditional like control structures with reserved words such as IF, THEN, ELSE, WHILE, FOR, and so on. However, Pascal has many data structuring and other ideas which were not included in the original, like type definitions, records, pointers, enumerations, and sets. The earliest computers were programmed in machine code. This type of programming is time consuming and error prone, as well as very difficult to change and understand. Programming is a time-consuming a process. More advanced languages were developed to resolve this problem. High level languages include a set of instruction...