-1

I have been tasked with figuring out a state space for a problem based on the area of a rectangle. It seems that I have made my state space far too large and need some feedback.
So far I have an area that has a value fo 600 for a y axis and 300 for an x axis. I determined the number of points to be

(600 x 300) ! or 180,000!

Therefore my robot would need to inspect this many potential spaces, before I apply an algorithm.

This number seems quite high and if that is the case it would make my problem unsolveable before I die especially if I implement the algorithm incorrectly. Any help would be greatly appreciated especially if my math is off in determining the number of points.

EDIT I was under the impression to see how many pairs of points you would have to take the cartesian product of the total available points. Which in turn would be (600x300)! . If this is incorrect please let me know.

Woot4Moo
  • 23,987
  • 16
  • 94
  • 151
  • 1
    @Henk Holterman As the ultimate answer is 42, I guess a (6x7)! is a better answer :) – Dr. belisarius Sep 12 '10 at 16:04
  • i cant use 6x3 as there are 600 x 300 possible points. I suppose the better question is what could I apply to show that it scaled properly? – Woot4Moo Sep 12 '10 at 16:12
  • 2
    @Woot4Moo: If there are 600 X 300 possible points the number of points is unmistakably 180000. Unless you give us some more info about the problem, there's really not much we can do. – Oren A Sep 12 '10 at 16:16
  • Yes that is the number of points I need the number of pairs, which in turn would determine the number of states. Because you must occupy a point (x,y) I would need to have all available pairs – Woot4Moo Sep 12 '10 at 16:28
  • @Henk its quite easy to pick up on sarcasm in the written word =p . Perhaps some feedback as to what extra information is needed would be nice – Woot4Moo Sep 12 '10 at 17:08
  • @Henk a bit hard to produce a piece of code when you don't have the proper assumptions down for an algorithm wouldn't you agree? – Woot4Moo Sep 12 '10 at 17:38
  • What I want to do to those points is moot, my question is purely about the number of potential states based on a a X b board. – Woot4Moo Sep 12 '10 at 17:55
  • 2
    Why is 180000 infeasible? Robots are immortal, so it doesn't matter that you'll be dead long before it figures out the answer. The robot will eventually figure it out, and science will stagger forward! – Cerin Sep 12 '10 at 19:41
  • if its 180,000 factorial we will all be dead =[ – Woot4Moo Sep 13 '10 at 12:30
  • @Woot4Moo: I don't understand where you get the factorial from. From what I understand, your state is a pair rather than a permutation of cells. Can you please clarify? – MAK Sep 13 '10 at 14:10
  • 1
    @MAK I think it was a miscommunication on my part, I did mean pair. Thanks for your clarifications – Woot4Moo Sep 13 '10 at 15:09

1 Answers1

5

First of all, the number of "points" (as defined in mathematics - the only relevant definition) in a rectangle of any size (non-zero area) is infinity. Why? Because a point does not necessarily have to have integer coordinates - there can be a point at (0,0), (0,0.1), (0.001), (0,0.0001) and so on. I think what you mean by points in your question is that all points must have integer coordinates (i.e. lattice points), or alternately, "cells" in a rectangular grid (like cells on a chess board). Please let me know if I misunderstood your question.

There are 600 rows and 300 coloumns. This means that there are 600 * 300 = 180,000 different cells. It follows that there are nCr(180,000,2) = 16,199,910,000 unique pairs in the grid. I am assuming you consider the pair ((1,1),(2,2)) and ((2,2),(1,1)) equivalent. Otherwise, there are 180,000*180,000 = 32,400,000,000 pairs.

MAK
  • 26,140
  • 11
  • 55
  • 86
  • I guess (!) means (factorial) in the question. – Dr. belisarius Sep 12 '10 at 21:03
  • 1
    @belisarius: I thought so too. Doesn't make sense as punctuation :). – MAK Sep 12 '10 at 21:04
  • 1
    @MAK sorry if it was trivial. I just don't understand what is a "state" for the OP. – Dr. belisarius Sep 12 '10 at 21:11
  • @belisarius: From what I understand of the question, the state space is the set of pairs of cells in the grid. Each state is a pair of the form ((x1,y1),(x2,y2)). – MAK Sep 12 '10 at 21:23
  • @MAK: That is what I read too, but how is such a vector/move a 'State' ? – H H Sep 12 '10 at 21:41
  • @Henk Holterman: It appears that the OP wants to run some sort of procedure on this state space (probably a search algorithm like BFS/DFS/Dijkstra etc.). I think the pair represents the state used in the algorithm. Probably something like the position of two objects on the screen, like the 'state' of a chess board is the positions of the pieces. But I think this answer can be best answered by the OP himself. I'm just saying what I thought. – MAK Sep 12 '10 at 22:01
  • @MAK you would be correct in your assumptions. Also (!) was factorial, as I was under the impression that was the only way to really show it. Thanks for the link to lattice points, I will take a look into this and most likely mark this as the answer. – Woot4Moo Sep 13 '10 at 12:29