Design question

  • I have a dilemma on databasedesign. What I need is a patternrecognition. A user enters up to 500 items in a session, and during this entryprocess a pattern might arise with previous entries. That pattern needs to be recorgnized.

    Now, when using normalization I would create a Table1 with a PatternID, a Table2 with all possible entries(300, EntryID) and a Table3, where PatternID and EntryID would be linked.

    I wonder however if it would be better to make a Table4 with PatternID and 300 attributes EntryNn, where Nn is the entrysequence.

    Would a patternsearching algoritm be quicker the last option, where per session all entries are stored in 1 record? Or would the normalized option first mentioned be as quick or quicker? I am reluctant to go and built something and find out later I choose the wrong option.

    Maybe some more info: I am undecided as yet wheather to check after every entry, or after say 5-10 entries or maybe only on request. This patternchecking will be a huge load, I imagine.

    TIA,

    Greetz,
    Hans Brouwer

  • Hans,

    Can you define what form a pattern may take?  Can you give me some examples?

    -Rob

  • Hi Robert,

    Tnx for responding. An example:

    I receive a box of cards, factory shuffled. This means, that the cards are quasi-randomized put into the box in a certain order. Say you have 500 cards numbered 1-500. First box is entered in the database. Next box is being entered into the database, and here a check for a similar sequence as the first box needs to be taken place. So if for example a sequence 54,77,213,11,98,322,15,... existed in the first box, and this sequence shows up in the second(or Nth) box some alarm needs to go of. This entering into the database is done manually, and no TG not by me..

    I am not sure yet if such a patternsearch is feasable after every card entered, it's an enormous load. Probably the user can request a patternmatching with a commandbutton or such. The load is what makes me wonder about the designquestion.

    Hope this gives some more insight.

     

     

    Greetz,
    Hans Brouwer

  • What defines a pattern?

    As in, what length, how many items?

    If it was all 500, then you would just compare row to row.

    If a pattern is the reoccurance of 2 items in an order, things will be very different.

    Can we assume you are using 'simple' types such as an int?

  • I have the beginnings of a solution to this problem, and I can describe it - altholugh I don't have the time to code the solution.

    Don's questions are deails I'd like to know as well, only that it will make the description clearer if I have actual numbers to work with.

    -Rob

  • Hi guys, tnx for responding.

    Dont't worry, I can code a solution, the question is: what solution would be better.

    The re-occurring sequence is like I gave an example of, and it is always at the same place in the next box! Thus, if the examplesequence I gave previously, 54,77,213,11,98,322,15, started at say position 93, it would not be considered the same sequence in the next box if it started at position 94. A pattern could theoretically be the whole box, 500 cards, but read on. A pattern would probably start at card 1, but I am not sure yet about that.

    While I write this down, I would not be surprised if the user would come up with the idea, that this sequence could occur elsewhere... But let's table that for now.

    You may correctly assume I use integers in the to be compared attributes. A compare of the complete box, 500 cards, would miss the aim of this algoritm: namely, predicting in an early stage, if the sequence of the current box has happened before. If you know after 50 cards, or even 200 cards, that this sequence has happened before, then you can stop checking and use the known pattern to your profit. After you have entered all cards there is no need for that knowledge anymore.

    Currently the user doing this drudgework relies on memory to recognize a sequence.

    To be clear: I try to solve this problem for a friend of mine, who thinks computers can read ppl's mind and then do what a person has on his mind... It is not some professional system I am building. The puzzle intrigued me, I made an Access DB, where I made 1 table for each pattern, before I was told each pattern could be up to 500 cards...

    Hop this makes things a bit more clear, and tnx for the effort.

    Greetz,
    Hans Brouwer

  • Hans,

    I think you need to actually determine how many items are in a pattern.

    Until that's decided then everything else is a waste of time really.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply