Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.57 KB | None | 0 0
  1. n-Queens
  2. The table shows the size of the state space for di erent ways of representing an n  n chess board with n queens placed on it.
  3. A. n queens in di erent squares, with no other restrictions, gives
  4. 
  5. n2
  6. n
  7. 
  8. possibilities.
  9. B. Restricting to exactly one queen per row, but no restrictions on columns or diagonals, gives nn possibilities.
  10. C. Restricting to exactly one queen per row and exactly one per column, but no restrictions on diagonals, gives permutations, so
  11. there are n! possibilities.
  12. D. A \solution" is n queens positioned so that no two are in the same row, column, or diagonal.
  13. E{F. The algorithm shown on the back of the page (based on the backtracking algorithm in Chapter 5.1{5.2), constructs space B
  14. described above one row at a time, pruning when the rows already constructed are not promising. The number of (E) promising
  15. and (F) non-promising nodes are as indicated. An upper bound on E + F is to do a depth- rst search without pruning, which
  16. explores n0 + n1 +   +nn = (nn+1 βˆ’ 1)=(n βˆ’ 1) nodes (nk nodes at depths k = 0; : : : ; n).
  17. n A.
  18. τ€€€n2
  19. n
  20. 
  21. B. nn C. n! D. # solutions E. # promising F. # not promising
  22. 1 1 1 1 1 2 0
  23. 2 6 4 2 0 3 4
  24. 3 84 27 6 0 6 13
  25. 4 1820 256 24 2 17 44
  26. 5 53130 3125 120 10 54 167
  27. 6 1947792 46656 720 4 153 742
  28. 7 85900584 823543 5040 40 552 3033
  29. 8 4426165368 16777216 40320 92 2057 13664
  30. 9 260887834350 387420489 362880 352 8394 63985
  31. 10 17310309456440 10000000000 3628800 724 35539 312612
  32. 11 1276749965026536 285311670611 39916800 2680 166926 1639781
  33. 12 103619293824707388 8916100448256 479001600 14200 856189 9247680
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement