Questions
Write a Python program to solve the 8-puzzle problem (and its natural generalizations) using the A*...

Write a Python program to solve the 8-puzzle problem (and its natural generalizations) using the A* search algorithm.

The problem. The 8-puzzle problem is a puzzle invented and popularized by Noyes Palmer Chapman in the 1870s. It is played on a 3-by-3 grid with 8 square blocks labeled 1 through 8 and a blank square. Your goal is to rearrange the blocks so that they are in order, using as few moves as possible. You are permitted to slide blocks horizontally or vertically into the blank square. The following shows a sequence of legal moves from an initial board (left) to the goal board (right).

     1 3            1      3        1 2 3         1 2 3        1 2 3

4 2 5   =>   4 2 5   => 4     5   => 4    5     => 4 5 6

7 8 6          7 8 6          7 8 6        7 8 6         7 8

initial           1 left              2 up               5 left            goal

Best-first search. Now, we describe a solution to the problem that illustrates a general artificial intelligence methodology known as the A* search algorithm. We define a search node of the game to be a board, the number of moves made to reach the board, and the previous search node. First, insert the initial search node (the initial board, 0 moves, and a null previous search node) into a priority queue. Then, delete from the priority queue the search node with the minimum priority, and insert onto the priority queue all neighboring search nodes (those that can be reached in one move from the dequeued search node). Repeat this procedure until the search node dequeued corresponds to a goal board. The success of this approach hinges on the choice of priority function for a search node. We consider two priority functions:

  • Hamming priority function. The number of blocks in the wrong position, plus the number of moves made so far to get to the search node. Intuitively, a search node with a small number of blocks in the wrong position is close to the goal, and we prefer a search node that have been reached using a small number of moves.

Manhattan priority function. The sum of the Manhattan distances (sum of the vertical and horizontal distance) from the blocks to their goal positions, plus the number of moves made so far to get to the search node

Input and output formats. The input and output format for a board is the board size N followed by the N-by-N initial board, using 0 to represent the blank square.

more puzzle04.txt

3

0 1 3

4 2 5

7 8 6

Solver puzzle04.txt

Minimum number of moves = 4

3

0 1 3

4 2 5

7 8 6

3

1 0 3

4 2 5

7 8 6

3

1 2 3

4 0 5

7 8 6

3

1 2 3

4 5 0  

7 8 6

3

1 2 3

4 5 6

7 8 0

more puzzle-unsolvable3x3.txt

3

1 2 3

4 5 6

8 7 0

Solver puzzle3x3-unsolvable.txt

Unsolvable puzzle

Your program should work correctly for arbitrary N-by-N boards (for any 1 ≤ N < 128), even if it is too slow to solve some of them in a reasonable amount of time.

In: Computer Science

Patient is 88 year old female admitted to the hospital with a two day history of...

Patient is 88 year old female admitted to the hospital with a two day history of feeling SOB, lightheaded, dizzy, and chest pain. The patient lives in a single family house, and the bedroom and bathroom are located on the second floor. The patient was brought to the ED by the family. The nurse starts to perform the nursing assessment and finds that the patient is only oriented to person. The patient does not report any pain. The vital signs and the laboratory results are recorded as the following:

Temp. 38.1   pulse 98    resp. 32    Blood pressure 122/80   SpO2 with RA at Pulse Ox 89% , weight at 120 pounds (54.54 Kilograms), height 5.4

Na                   148

Cl                    96

Potassium        3.5

Bicarb             39

BUN               50

Creat             1.78

Glucose         124

Hgb              6.6

Hct              21.5

WBC           24.9

Platelets     145,000

Albumin       3.5

ROS:

Negative

PMH:    CAD, CKD, HTN, COPD

PSH: Bilateral knee replacement

Social hx: lives alone, drinks one glass of wine once a day, denies smoking and drug abuse

Allergies:

NKDA

Medications at home: Lisinopril 40 mg once a day, ASA 81 mg once a day, Lasix 40 mg once a day, Advair one puff every 12 hours

Physical Exam:

Awake, confused to time and place, oriented to self

Mucous membranes dry, tongue pink

HEENT: AT/NC, PERRLA, neck supple, no JVD

CV: RRR, Normal S1 S2, no m/r/c heard

Lungs:   Breath sounds vesicular with crackles in the posterior bases

ABD: distended with faint bowel sounds, tender to touch

Extremities: upper and lower extremities with strength at 3/5 for all four extremities

Has 3+ edema in lower legs bilaterally

Skin: small open redden area on left thigh

Diagnostic Exam:

ECG: Normal

2D echocardiogram: LV function at 20%

Answer the following questions:

Identify the abnormal lab tests.         

Identify two nursing diagnosis for this patient.

Identify two nursing intervention for each nursing diagnosis with rationale.

Identify one short term goal for each nursing diagnosis.

Identify one outcome for each nursing diagnosis.

List the medications for the patient.

List the diagnosis test ordered for the patient and the results.

In: Nursing

Need Excel Format and screenshot The attached printout of an Excel spreadsheet shows the use of...

Need Excel Format and screenshot

The attached printout of an Excel spreadsheet shows the use of six financial formulas related to the time-value-of-money concepts discussed in Chapter 5. Your task is to reproduce the spreadsheet using Excel financial formulas in the red cells, which have the names shown in blue in the adjacent cells. You can find the financial formulas in Excel by clicking on Formulas at the top of the spreadsheet, and then clicking on Financial.

You will submit your spreadsheet through D2L, and I will check your work by changing one of the input values for each formula to see if your spreadsheet calculates the correct answer.

Note that interest rates in Excel are entered in decimal form, not as a percent as with the TI calculator. For example, in Excel 9.5% is entered in a cell as 0.095. Also, the type variable for each formula defines when the cash flows occur. Setting type equal to 0 means the cash flows occur at the end of each period. Setting type equal to 1 means the cash flows occur at the beginning of each period.

A

B

C

1

Present value

2

Rate

0.11

3

Nper

8

4

PMT

10

5

FV

100

6

Type

0

7

PV

‐94.85

8

9

Number of periods

10

Rate

0.11

11

PMT

10

12

PV

‐94.85

13

FV

100

14

Type

0

15

Nper

8.01

16

17

Payment

18

Rate

0.11

19

Nper

8

20

PV

‐94.85

21

FV

100

22

Type

0

23

PMT

10.00

24

25

Interest rate

26

Nper

8

27

PMT

10

28

PV

‐94.85

29

FV

100

30

Type

0

31

Rate

0.11

32

33

Future value

34

Rate

0.11

35

Nper

8

36

PMT

10

37

PV

‐94.85

38

Type

0

39

FV

99.99

40

41

Net present value

42

Rate

0.11

43

Value 1

100

44

Value 2

200

45

Value 3

300

46

Value 4

400

47

Value 5

500

48

NPV

1031.99

In: Finance

• A MAJOR POTENTIOMETER MANUFACTURER IS CONSIDERING TWO ALTERNATIVES FOR NEW PRODUCTION MACHINES WITH CAPACITY TO...

• A MAJOR POTENTIOMETER MANUFACTURER IS CONSIDERING TWO ALTERNATIVES FOR NEW PRODUCTION MACHINES WITH CAPACITY TO PRODUCE 20 000 UNITS PER DAY. ONE ALTERNATIVE IS FOR A HIGH-CAPACITY AUTOMATED PRODUCTION MACHINE CAPABLE OF PRODUCING 20 000 UNITS PER DAY WHEN OPERATED FOR THREE SHIFTS PER DAY. A QUARTER-TIME EMPLOYEE WOULD BE ASSIGNED TO MONITOR THE MACHINE (EMPLOYEE WOULD MONITOR OTHER MACHINES AT THE SAME TIME). WITH THE THREE-SHIFT SCHEDULE THIS WOULD BE EQUIVALENT TO A THREE-QUARTER-TIME EMPLOYEE.

• A SECOND ALTERNATIVE WOULD BE TO USE TWO MANUALLY OPERATED MACHINES, EACH CAPABLE OF 10 000 UNITS PER DAY ASSUMING THREE-SHIFT OPERATION. HERE, A TOTAL OF SIX EMPLOYEES (2 PER SHIFT, 3 SHIFTS) WOULD BE NEEDED.

• IF LABOR COSTS (INCLUDING WAGES, BENEFITS, ETC.) ARE $40 000 PER EMPLOYEE PER YEAR, RECOMMEND WHICH ALTERNATIVE IS BEST USING THE EQUIVALENT UNIFORM ANNUAL COST METHOD

Alternative 1 Alternative 2
Cost to purchase $500 000 $100 000
Number of machines required 1 2
Number of employees required 2 6
Expected life of machine 10 yr 10 yr
Interest rate 8% 8%
Annual maintenance cost per machine $30 000 $10 000
Salvage value at 10 years per machine $100 000 $20 000

In: Accounting

A travel agent wants to estimate the proportion of vacationers who plan to travel outside the...

A travel agent wants to estimate the proportion of vacationers who plan to travel outside the United States in the next 12 months. A random sample of 130 vacationers revealed that 40 had plans for foreign travel in that time frame. Construct a 95% confidence interval estimate of the population proportion. Make a statement about this in context of the problem

In: Statistics and Probability

The records of ABC Company showed the following: Units Unit Cost Total Cost January 1 Beginning...

The records of ABC Company showed the following:

Units Unit Cost Total Cost
January 1 Beginning 10,000 60 600,000
April 1 Purchase 18,000 50 900,000
October 1 Purchase 22,000 40 880,000

The physical inventory reveals 15,000 units on hand on December 31.
Compute the cost of ending inventory and cost of sales using:

Inventory Cost Flow Ending Inventory Cost of Goods Sold (COGS)
First in, first out (FIFO)
Weighted Average
Last in, first out (LIFO)

In: Accounting

1.-The following data were obtained for a randomized block design involving five treatments and three blocks:...

1.-The following data were obtained for a randomized block design involving five treatments and three blocks: SST = 570, SSTR = 390, SSBL = 95. Set up the ANOVA table. (Round your value for F to two decimal places, and your p-value to three decimal places.)

Source
of Variation
Sum
of Squares
Degrees
of Freedom
Mean
Square
F p-value
Treatments 390 4 97.5
Blocks 95 2 47.5
Error 85 8 10.625
Total 570 14

Find the value of the test statistic. (Round your answer to two decimal places.)___

Find the p-value. (Round your answer to three decimal places.)

p-value = ___

An automobile dealer conducted a test to determine if the time in minutes needed to complete a minor engine tune-up depends on whether a computerized engine analyzer or an electronic analyzer is used. Because tune-up time varies among compact, intermediate, and full-sized cars, the three types of cars were used as blocks in the experiment. The data obtained follow.

Analyzer
Computerized Electronic
Car Compact 51 43
Intermediate 55 44
Full-sized 62 45

Use α = 0.05 to test for any significant differences.

Find the value of the test statistic. (Round your answer to two decimal places.)___

Find the p-value. (Round your answer to three decimal places.)

p-value = ___

In: Statistics and Probability

2. You deposit $1000. How much will you have under each of the following conditions? a)...

2. You deposit $1000. How much will you have under each of the following conditions?

a) 8 percent compounded semi-annually for two years

b) 8 percent compounded quarterly for two years

c) 8 percent compounded monthly for two years

In: Finance

Let x be a random variable that represents the level of glucose in the blood (milligrams...

Let x be a random variable that represents the level of glucose in the blood (milligrams per deciliter of blood) after a 12 hour fast. Assume that for people under 50 years old, x has a distribution that is approximately normal, with mean μ = 50 and estimated standard deviation σ = 12. A test result x < 40 is an indication of severe excess insulin, and medication is usually prescribed.

(a) What is the probability that, on a single test, x < 40? (Round your answer to four decimal places.)


(b) Suppose a doctor uses the average x for two tests taken about a week apart. What can we say about the probability distribution of x? Hint: See Theorem 6.1.

The probability distribution of x is not normal. The probability distribution of x is approximately normal with μx = 50 and σx = 8.49.     The probability distribution of x is approximately normal with μx = 50 and σx = 12. The probability distribution of x is approximately normal with μx = 50 and σx = 6.00.


What is the probability that x < 40? (Round your answer to four decimal places.)


(c) Repeat part (b) for n = 3 tests taken a week apart. (Round your answer to four decimal places.)


(d) Repeat part (b) for n = 5 tests taken a week apart. (Round your answer to four decimal places.)


(e) Compare your answers to parts (a), (b), (c), and (d). Did the probabilities decrease as n increased?

Yes No    


Explain what this might imply if you were a doctor or a nurse.

The more tests a patient completes, the stronger is the evidence for excess insulin. The more tests a patient completes, the weaker is the evidence for excess insulin.     The more tests a patient completes, the stronger is the evidence for lack of insulin. The more tests a patient completes, the weaker is the evidence for lack of insulin.

In: Statistics and Probability

Date Close 7/3/2017 898.700012 7/5/2017 911.710022 7/6/2017 906.690002 7/7/2017 918.590027 7/10/2017 928.799988 7/11/2017 930.090027 7/12/2017 943.830017...

Date Close
7/3/2017 898.700012
7/5/2017 911.710022
7/6/2017 906.690002
7/7/2017 918.590027
7/10/2017 928.799988
7/11/2017 930.090027
7/12/2017 943.830017
7/13/2017 947.159973
7/14/2017 955.98999
7/17/2017 953.419983
7/18/2017 965.400024
7/19/2017 970.890015
7/20/2017 968.150024
7/21/2017 972.919983
7/24/2017 980.340027
7/25/2017 950.700012
7/26/2017 947.799988
7/27/2017 934.090027
7/28/2017 941.530029
7/31/2017 930.5
8/1/2017 930.830017
8/2/2017 930.390015
8/3/2017 923.650024
8/4/2017 927.960022
8/7/2017 929.359985
8/8/2017 926.789978
8/9/2017 922.900024
8/10/2017 907.23999
8/11/2017 914.390015
8/14/2017 922.669983
8/15/2017 922.219971
8/16/2017 926.960022
8/17/2017 910.97998
8/18/2017 910.669983
8/21/2017 906.659973
8/22/2017 924.690002
8/23/2017 927
8/24/2017 921.280029
8/25/2017 915.890015
8/28/2017 913.809998
8/29/2017 921.289978
8/30/2017 929.570007
8/31/2017 939.330017
9/1/2017 937.340027
9/5/2017 928.450012
9/6/2017 927.809998
9/7/2017 935.950012
9/8/2017 926.5
9/11/2017 929.080017
9/12/2017 932.070007
9/13/2017 935.090027
9/14/2017 925.109985
9/15/2017 920.289978
9/18/2017 915
9/19/2017 921.809998
9/20/2017 931.580017
9/21/2017 932.450012
9/22/2017 928.530029
9/25/2017 920.969971
9/26/2017 924.859985
9/27/2017 944.48999
9/28/2017 949.5
9/29/2017 959.109985
10/2/2017 953.27002
10/3/2017 957.789978
10/4/2017 951.679993
10/5/2017 969.960022
10/6/2017 978.890015
10/9/2017 977
10/10/2017 972.599976
10/11/2017 989.25
10/12/2017 987.830017
10/13/2017 989.679993
10/16/2017 992
10/17/2017 992.179993
10/18/2017 992.809998
10/19/2017 984.450012
10/20/2017 988.200012
10/23/2017 968.450012
10/24/2017 970.539978
10/25/2017 973.330017
10/26/2017 972.559998
10/27/2017 1019.27002
10/30/2017 1017.109985
10/31/2017 1016.640015
11/1/2017 1025.5
11/2/2017 1025.579956
11/3/2017 1032.47998
11/6/2017 1025.900024
11/7/2017 1033.329956
11/8/2017 1039.849976
11/9/2017 1031.26001
11/10/2017 1028.069946
11/13/2017 1025.75
11/14/2017 1026
11/15/2017 1020.909973
11/16/2017 1032.5
11/17/2017 1019.090027
11/20/2017 1018.380005
11/21/2017 1034.48999
11/22/2017 1035.959961
11/24/2017 1040.609985
11/27/2017 1054.209961
11/28/2017 1047.410034
11/29/2017 1021.659973
11/30/2017 1021.409973
12/1/2017 1010.169983
12/4/2017 998.679993
12/5/2017 1005.150024
12/6/2017 1018.380005
12/7/2017 1030.930054
12/8/2017 1037.050049
12/11/2017 1041.099976
12/12/2017 1040.47998
12/13/2017 1040.609985
12/14/2017 1049.150024
12/15/2017 1064.189941
12/18/2017 1077.140015
12/19/2017 1070.680054
12/20/2017 1064.949951
12/21/2017 1063.630005
12/22/2017 1060.119995
12/26/2017 1056.73999
12/27/2017 1049.369995
12/28/2017 1048.140015
12/29/2017 1046.400024
1/2/2018 1065
1/3/2018 1082.47998
1/4/2018 1086.400024
1/5/2018 1102.22998
1/8/2018 1106.939941
1/9/2018 1106.26001
1/10/2018 1102.609985
1/11/2018 1105.52002
1/12/2018 1122.26001
1/16/2018 1121.76001
1/17/2018 1131.97998
1/18/2018 1129.790039
1/19/2018 1137.51001
1/22/2018 1155.810059
1/23/2018 1169.969971
1/24/2018 1164.23999
1/25/2018 1170.369995
1/26/2018 1175.839966
1/29/2018 1175.579956
1/30/2018 1163.689941
1/31/2018 1169.939941
2/1/2018 1167.699951
2/2/2018 1111.900024
2/5/2018 1055.800049
2/6/2018 1080.599976
2/7/2018 1048.579956
2/8/2018 1001.52002
2/9/2018 1037.780029
2/12/2018 1051.939941
2/13/2018 1052.099976
2/14/2018 1069.699951
2/15/2018 1089.52002
2/16/2018 1094.800049
2/20/2018 1102.459961
2/21/2018 1111.339966
2/22/2018 1106.630005
2/23/2018 1126.790039
2/26/2018 1143.75
2/27/2018 1118.290039
2/28/2018 1104.72998
3/1/2018 1069.52002
3/2/2018 1078.920044
3/5/2018 1090.930054
3/6/2018 1095.060059
3/7/2018 1109.640015
3/8/2018 1126
3/9/2018 1160.040039
3/12/2018 1164.5
3/13/2018 1138.170044
3/14/2018 1149.48999
3/15/2018 1149.579956
3/16/2018 1135.72998
3/19/2018 1099.819946
3/20/2018 1097.709961
3/21/2018 1090.880005
3/22/2018 1049.079956
3/23/2018 1021.570007
3/26/2018 1053.209961
3/27/2018 1005.099976
3/28/2018 1004.559998
3/29/2018 1031.790039
4/2/2018 1006.469971
4/3/2018 1013.409973
4/4/2018 1025.140015
4/5/2018 1027.810059
4/6/2018 1007.039978
4/9/2018 1015.450012
4/10/2018 1031.640015
4/11/2018 1019.969971
4/12/2018 1032.51001
4/13/2018 1029.27002
4/16/2018 1037.97998
4/17/2018 1074.160034
4/18/2018 1072.079956
4/19/2018 1087.699951
4/20/2018 1072.959961
4/23/2018 1067.449951
4/24/2018 1019.97998
4/25/2018 1021.179993
4/26/2018 1040.040039
4/27/2018 1030.050049
4/30/2018 1017.330017
5/1/2018 1037.310059
5/2/2018 1024.380005
5/3/2018 1023.719971
5/4/2018 1048.209961
5/7/2018 1054.790039
5/8/2018 1053.910034
5/9/2018 1082.76001
5/10/2018 1097.569946
5/11/2018 1098.26001
5/14/2018 1100.199951
5/15/2018 1079.22998
5/16/2018 1081.77002
5/17/2018 1078.589966
5/18/2018 1066.359985
5/21/2018 1079.579956
5/22/2018 1069.72998
5/23/2018 1079.689941
5/24/2018 1079.23999
5/25/2018 1075.660034
5/29/2018 1060.319946
5/30/2018 1067.800049
5/31/2018 1084.98999
6/1/2018 1119.5
6/4/2018 1139.290039
6/5/2018 1139.660034
6/6/2018 1136.880005
6/7/2018 1123.859985
6/8/2018 1120.869995
6/11/2018 1129.98999
6/12/2018 1139.319946
6/13/2018 1134.790039
6/14/2018 1152.119995
6/15/2018 1152.26001
6/18/2018 1173.459961
6/19/2018 1168.060059
6/20/2018 1169.839966
6/21/2018 1157.660034
6/22/2018 1155.47998
6/25/2018 1124.810059
6/26/2018 1118.459961
6/27/2018 1103.97998
6/28/2018 1114.219971
6/29/2018 1115.650024
7/2/2018 1127.459961

Project 3 instructions

Based on Larson & Farber: sections 5.2–5.3

Using the provided data. Assume that the closing prices of the stock form a normally distributed data set. This means that you need to use Excel to find the mean and standard deviation. Then, use those numbers and the methods you learned in sections 5.2–5.3 of the course textbook for normal distributions to answer the questions. Do NOT count the number of data points.

Complete this portion of the assignment within a single Excel file. Show your work or explain how you obtained each of your answers. Answers with no work and no explanation will receive no credit.

Show all work

1) If a person bought 1 share of Google stock within the last year, what is the probability that the stock on that day closed at less than the mean for that year? Hint: You do not want to calculate the mean to answer this one. The probability would be the same for any normal distribution. (5 points)

2) If a person bought 1 share of Google stock within the last year, what is the probability that the stock on that day closed at more than $825? (5 points)

3a) If a person bought 1 share of Google stock within the last year, what is the probability that the stock on that day closed within $50 of the mean for that year? (5 points)

3b) If a person bought 1 share of Google stock within the last year, what is the probability that the stock on that day closed at less than $700 per share. (5 points)

3c) At what prices would Google have to close in order for it to be considered statistically unusual? You will have a low and high value. Use the definition of unusual from the course textbook that is measured as a number of standard deviations. (5 points)

4) What are Quartile 1, Quartile 2, and Quartile 3 in this data set? Use Excel to find these values. This is the only question that you must answer without using anything about the normal distribution. (5 points)

5) Is the normality assumption that was made at the beginning valid? Why or why not? Hint: Does this distribution have the properties of a normal distribution as described in the course textbook? Real data sets are never perfect, however, it should be close. One option would be to construct a histogram like you did in Project 1 to see if it has the right shape. Something in the range of 10 to 12 classes is a good number. (5 points)

There are also 5 points for miscellaneous items like correct date range, correct mean, correct SD, etc.

In: Statistics and Probability