Skip to content

Looking for a sequence of numbers…

December 27, 2012

Is there a sequence of N numbers such that, given a sum and the quantity of numbers that generated it, I can determine how many of each number were used?

A bit of context is probably needed.

One project that is currently on my plate is to capture information about how a search tool is being used in our organization. Specifically, I want to capture the text string being searched for, as well as the state of the form when it was submitted. The form is relatively complex, with about 20 unique configurations that can exist for any search.

By using the event tracking capabilities within Google Analytics, I’ve been able to set up a system that captures the necessary information – but there is a caveat. Events can be classified using three text strings (Category, Action, and Label) and one integer (Value). Because of our long-range plans for using event tracking, I only really have one text string and the integer available to me for this project (the Category designation is used to identify that this is a search event, while the Action designation is used to track form submissions, rather than tab changes or sidebar links being clicked). The text string being searched is obviously taking up the Label designation. This leaves me using the integer to capture the state of the form.

Describing the form state numerically brings a challenge. If a text string is used multiple times, only the sum and counts are shown in the report. Here is an example.

A snippet of an event detail report within Google Analytics

A snippet of an event detail report within Google Analytics

For each text string (not pictured), I see columns for Total Events, Unique Events, and Event Value. I believe that Total Events indicate the raw number of form submissions for all users, while Unique Events indicate the number of unique visitors to search for that string (i.e. if the same visitor searches for a string three times, it shows up under the Total column three times, but only once in the Unique column). The Event Value column is a sum of all the numbers for each form state.

Do you see the challenge? If I pick values of 1, 2, 3, and so forth then I have no way of knowing how many times a given term was searched on any given form state. If the term “foo” shows up with three total events and a value of 12, I cannot determine whether the form states for those searches were “4,4,4” or “3,4,5” or “1,1,10”. All I have is the number of events (three) and their sum value (12).

I believe, however, that there is a sequence of numbers that will allow this reverse engineering. My first thought is to try using a Fibonacci sequence, so instead of “1,2,3,4…20” I would instead assign values of “1,2,3,5,8…” with the 20th value being 10,946. That, however, would lead to some very big sums. We are tracking about 800 searches a day at the moment, and this is between semesters when traffic counts are low.

Another option could be to use a sequence like “1,2,4,7,11…” where the gap between any pair of numbers is unique – but increments as slowly as possible so the maximum number remains high end stays small. This sequence – which appears to be named the lazy caterer’s sequence – has as its 20th value the number 211.

What I need

I am looking for two things. First, is there a sequence of numbers that will allow me to determine – based on a count and a sum – what the original numbers were? If yes, what sequence should I use?

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: