Pages

2021-09-15

What is an Enrichment Platform?

An Enrichment Platform:  

The place for Knowledge workers. 

In my book the Enrichment Game, available from Technics Publications, I write about the players, processes, tools and techniques to create an Enrichment Platform for knowledge workers to create data products. 

The book is available from Technics Publications

While I wrote about what an Enrichment Platform could do, I never properly defined what an Enrichment Platform actually is. 

An Enrichment Platform will be different things to meet different needs. However, the essence of an Enrichment Platform will always be consistent. 

  • Separate your operational data from your analytical and reporting data. 
  • Provide for easily accessible tools to create reports that are not created by application developers. 
  • Knowledge workers like Data Scientists have the tools they are familiar with to create new data products. 
  • Data Operations are managing the flow of data throughout the organization. 
  • Data Governance rules define how and where data is used. 

An Enrichment Platform looks like this: 

An Enrichment Platform


The Value proposition of the Enrichment Platform consists of: 

  • Focusing Application Developers on creating, maintaining, or updating existing products. 
  • Focusing Data Flows through a common organization. 
  • Focuses Data Scientists to be able to work with high quality data. 
  • Increasing Innovation, and reducing the time to new data products. 

This focus gives your organization the ability to adapt to change while having a stable, reliable, and repeatable environment for the knowledge workers to be able to make your organization more innovative. 





2021-02-23

Visualizing tasks in Snowflake.

 I have created a number of tasks in snowflake that are have a various dependencies. 


I wanted a simple way to document these tasks, and the graph nature of how they run. 


Using a few simple queries, you can feed the output of the show tasks command into another query, and that query can be used to format the output to feed it into a tool called graphviz

Graphviz has a very simple notation for creating sophisticated images of different types of graphs. 

In this case we will use a the digraph option for a dot file to create a simple image. 

The dot notation is very simple especially when visualizing hierarchical graphs. 


Create a file in your favorite editor (notepad++) with this syntax: 


digraph G { 


Run the following queries: 

show tasks;

with task_table as (
select split_part("predecessors", '.',  3) as parent,"name" as child from (select * from table(result_scan(last_query_id(-1))))
)
select parent||'->'||child||';' from task_table where parent is not null;

The output from this command you can copy from the worksheet editor and paste between the brackets of your dot file so that the dot file will now look like this: 

 digraph G {
TASKD->TASKE;
TASKB->TASKC;
TASKA->TASKB;
TASKA->TASKI;
TASKC->TASKL;
TASKA->TASKM;
TASKG->TASKH;
TASKA->TASKN;
TASKH->TASKJ;
TASKI->TASKK;
TASKA->TASKD;
TASKE->TASKF;
TASKJ->TASKO;
TASKK->TASKP;
}

 

Save your file as something meaningful like Blog_demo.dot 

So long as you have graphviz installed correctly, once you save the file you can convert the .dot file to a png you can use for documentation like this: 

dot -Tpng Blog_demo.dot > blog_demo.png

 

And here is my anonymized graph visualization. 


Graphviz is a powerful tool for visualization, it is not so much a graph analysis tool like gephi, but it is quite sufficient for documentation, and sharing images that represent the graphs we work with every day. 


.

 

 


2021-02-07

Wordcloud your resume

Word Cloud your resume.

 I am working with more text now than I normally do, and I had an idea for helping people get noticed on LinkedIN. Word Cloud your resume. 

 Getting noticed on LinkedIN is largely a matter of timing, luck, and who you know. I make no claim that creating an image out of the words that make up your resume will guarantee to get you noticed, but humans tend to be more visual creatures.

Popping up an image that summarizes your expertise cannot hurt, and there is a possibility that going through this process you may learn something about how to express yourself. 

 I create an R notebook located at:   https://github.com/dougneedham/WCYR

This is a simple R notebook that anyone can download and run with the latest version of RStudio. 

The notebook walkthrough. 

For this section, you should download the R code and follow along. 

There are a few packages we need to load first. 

These are the packages for reading word documents, text processing, creating a wordcloud, and letting wordcloud  choose various colors. 

The first Cell reads in a resume document. In this case, this is my most recent resume. 

 Using the readtext package reads a word document, then puts all of the text into the variable named text for the result. 

Passing this variable to the original wordcloud package and specifying we want to only display words with a minimum frequency of 2 we get a basic wordcloud image that could be used. However, I want to create something a little more colorful. 

In order to use the wordcloud2 package, the data must be munged a bit into a data frame that lists the words and their frequency rather than just a raw bag of words. 

Using the Corpus function from the tm package gives us just what we are looking for. 

In the next couple of steps we want to lower case all of our words, then remove the standard stopwords from the list of words we are displaying. 

Based on some early displays, I found a few words that kept showing up, so I added them to the standard stopword list to keep them from showing up in our display. 

Now that we have a TermDocumentMatrix we convert that to a standard matrix, then do a summary of the words for some metrics. 

Finally we create a data frame that the wordcloud2 package is expecting. A list of words along with their frequencies. 

Now we run the actual wordcloud command with some color and shape options. I chose the Star shape since I am from Texas.

Displaying a wordcloud on my RStudio screen is cool, but I need a file to attach to postings. The HTMLWidgets and webshot packages allow me to create files based on web pages.Since the wordcloud2 package actually creates an interactive wordcloud that you can hover over, and actually get counts associated with each word we will need to do a few transforms in order to get a proper image out of it. 

In the final cell of the notebook, we save the wordcloud as an image to be manipulated. Then using that image we create an HTML file that can be referenced for later. And finally the webshot function saves the generated HTML as a PNG for attaching to posts, or emailing to your friends. :) 

 

This is an interesting way of enriching your resume, don't you think? 

 

If you want to give this a go, please reach out and let me know if you have any trouble. 

 

 

Code found at github 

 

 

 

 

 

2020-12-22

JSON in Snowflake

 Snowflake is an amazing database. It has auto-scaling capabilities, the ability to separate workloads, and automatically recover data using its time-travel capabilities. 

However, one of the most amazing things that I like about Snowflake is its ability to directly query JSON data stored in a variant column Query JSON Data 

Combine this with some other tools like Kakfa and Dbezium and you have some very rapid prototyping capabilities for doing analysis of your application database. 

 Dbezium monitors the transaction logs of your application database, and publishes change events to Kafka. 

Using the Snowflake Kafka Connector, you can capture these events and store the data in what would otherwise be called staging tables. 

The Kafka Connector stores the data as JSON, but Snowflake's ability to query JSON data is simple enough that any SQL developer can extract the pertinent data from the JSON Structure. 

An example from their documentation is:

SELECT src:device_type
  FROM raw_source
The src column of the raw_source table is where the JSON is stored. Once you know the JSON structure you want to query the :COLUMNAME is all that is needed to query the data from the variant column where the JSON data is stored. 
 
For more complicated JSON structures you may need to use some of the flattening technique in order to get all of the data from the JSON structure. 

With tools like this rapid prototyping is a breeze, the more complicated ETL jobs may not be necessary if the goal is to rapidly create a dimensional data model from your source application, then expose that data model with your favorite reporting tool (like Tableau

Combining data from multiple sources using this technique is also very straightforward so long as there are common keys in the systems that relates the data together. 

This allows architects to rapidly play The Enrichment Game, by combining data from  multiple sources, rationalizing the data, enriching one application with the data of another, then expose that data through a reporting tool. 

There are a number of problems I had to solve in different ways without having this capability. Using this particular combination of tools to rapidly create reports and respond to business needs drives more conversations about using Data to solve problems. 
 
These conversations are much more valuable rather than the conversations about how complicated a Data Ecosystem is, and the need to either write more Data Munging code in order to get data migrated from one system to another. 
 
 

2020-06-21

No Response?

Does No Response mean: Yes, No, or Piss off? 


I am an old guy. I know this means I have certain expectations for the way things should be done. Please and Thank you never go out of style. Sorry is a sign of weakness, but if you make a mistake or miscommunication you should acknowledge that. 

One of the earliest lessons in protocol I learned in Marine Corps boot camp. Our platoon was waiting on something (which is a good portion of what boot camp is all about learning to be prepared for your next set of instructions.) Our Drill Instructor told us to watch something. 

There were a group of officers some distance away waiting for their next set of instructions, and a lone recruit was walking towards them. 

The recruit stopped, saluted,and requested permission to walk by. 

Every officer in the group of about 8 returned the salute. 

The Drill Instructor then got our attention and in words I don't quite recall said something to this affect. 

The Salute is a sacred duty. Every Marine has to salute superior officers. But here is the duty behind the salute. Every officer must acknowledge and return the salute. 

The lowliest Private can Salute the commandant of the Marine Corps, the Commandant will return the Salute. It is an acknowledgement of our shared duty and heritage as Marines. 

This may be a touching story, but what does this have to do with anything? 

For those who are a Director, Vice President, or C-level executive, if one of your people in your reporting structure communicates something to you. You should at the very least acknowledge the communication. 

Something as simple as, "I have received your message, I need to think about it.", a thumbs up on Slack, or even a simple OK is better than nothing. 

Communication goes both ways. 

We are flooded with communication today. Slack, Teams, email, Text, alerts, etc. 

Many of these are automated and do not stop until they are acknowledged. 

Should we not have enough professionalism to at least give a little: 


2020-06-17

Poor Planning

Poor Planning on your part does not constitute an Emergency on my part.  

(Except when it does.)


Recently I was involved in a major hardware failure at work.

There had been indications our disk storage was under duress for quite some time. It had been in my status reports for months, I finally quit reporting on it since none of our leadership team even acknowledged the concern.

They would say, yeah we know we need to do something there. Or even better: Your predecessor complained about that as well. 

Over a long weekend involving most of my team, teams from other groups, vendors from infrastructure support and hardware vendors we fought for our customers not management.

War room calls were set up to run around the clock with people stepping in and out of the meeting we finally were able to get things ironed out. 

But at what cost? 

To proactively take care of this issue would have required potentially spending a bit of money up front to either get new infrastructure or upgrade it.

However to be down for the amount of time that we were down we broke faith with our customers.

I don't know the long term impacts of that on our organization. 

In cases like this it is never a good idea to say "I told you so."

A current joke going around says: "At the start of every disaster movie there's a scientist being ignored"

When you are in the middle of a disaster even if you were the one that could have prevented it, the only thing that you can do is to work hard on the recovery.

There is a tendency to shoot the messenger when dealing with issues, but that should be the last thing on anyones mind. The messenger is the one who knew about the problem the longest. Usually they are the person that has been kept up at night stressing over what to do.

The messenger probably has the most ideas about how to solve the problem.

Knee-jerk reactions do not create long term solutions. Careful design, planning, testing, and proactively building in resiliency and stability create long term solutions.

None of these are cheap, but as the saying goes: "Pay me now, or pay me later."

Proactive "pay me now" situations appear to be expensive.

Reactive "pay me later" situations make the proactive look like nickels and dimes.

When you are getting warnings about things that need to be addressed, don't ignore them. If you are the ones giving the warnings, don't give up.

Keep warning.

Keep telling.

Above all, Keep planning.

When the disaster strikes, someone has to be the voice of reason.







2020-06-12

Question The Answers.

Some time ago I wrote an entry on the difference between Data Science and Business Intelligence: https://bit.ly/DataSciencevsBusinessIntelligence

I recently came across this quote:

Advances are made by answering questions. Discoveries are made by questioning answers” —Bernard Haisch.

I think there is a relationship between this quote and that previous post.

In essence what I was attempting to say was that Business Intelligence is generally a process that your data flows through that enriches application Data and prepares it such that it can be used to answer questions. These questions may be simple:

  1. How many widgets did this business unit produce last quarter? 
  2. How many did that business unit sell last quarter? 
  3. Which sales person sold what percentage last quarter? 
  4. What is the recurring cost of this Customer? 

These are all important questions. However, this same data should be used as part of any predictive effort. If you are using different data for your data science efforts and your business intelligence efforts then as you chart new territory through Data Science, your Business Intelligence platform will assist in showing the value of the Data Science effort. 

These two sides of a similar coin can and should be complementary. 

Business Intelligence will drive your business forward, Data Science will show you the direction you should go. 





2020-05-26

How to create a mathemaical model

One day I was speaking to a friend of mine we were telling stories about some of the previous jobs we had held. He had been a teller at a bank. He asked me how they train tellers to recognize counterfeit money. It's really easy, he said, they never give them counterfeit money to work with. They always work with real bills when they practice counting and such. Then when you get a counterfeit it feels funny.

I recently recalled this conversation when I was looking for a pattern in some numbers.
As I copied the numbers into excel, I realized the progression kinda looked like a logistic progression with a base of 20. This tiny insight allowed me to do some further searches and find that there is a mathematical model that already represents the data I was looking at: Watts & Strogatz_model

By no means does this make me an expert in this area, but it did drive home for me the value of studying formal mathematical models.

I think the more that one studies formal models, whether they are in your current domain or not,  the more familiar you become with various types of models the better you will be at creating models yourself.

After all, a mathematical model is a set of rules that describe the behavior of data. Understanding how data behaves in various scenarios will improve your ability to recognize a pattern.


2019-05-28

Manifesto for Stable Infrastructure and Data Management

Our goal should be Stability, not Agility. 

There has been much written about Agile Software Development techniques. Some even say people are overdoing the use of the Agile name (https://www.infoq.com/presentations/agile-2018).

There is a time and a place for everything. A time for Agile, a time for Stability. Stability is simply the act of making your ecosystem S.T.A.B.L.E. Everyone should want to have achieve a stable environment that is a Scalable Technology Architecture By Layering Everything

In light of this, I propose the following Manifesto for Stable Infrastructure and Data Management.


We are uncovering better ways of growing business operations by doing it and helping others do it.
Through this work we have come to value:

Steady over explosive change.
Individual expertise over title or position.
Shared responsibility over admonishment.
Ecosystem availability over new applications.



 We follow these principles:

Our highest priority is to keep the business working while ensuring that we maintain a foundation of high quality tools and technology.

The modern business is built around a wide variety of software and applications.

No one application is more important than the holistic environment.

Not all applications will be built and maintained by our organization.

Treating all projects as if they were a software development project diminishes the value of the project itself.

Projects will come and go, new applications will join our ecosystem, old applications will be shutdown, but the data should be available forever.

The stability of the Enterprise, and the ability to fulfill the mission is paramount; this takes precedence over new needs.

Use out of the box tools and applications to drive using data for a different purpose than originally captured in a custom application.

Business continuity takes precedence over deployment of new applications.

Adopting new tools and technologies should be done with adequate time, training, and trials such that the original adopters are not the only ones capable of supporting it.

A minority of technologists are software developers; the Data of the organization is co-equal in importance to any algorithm that may be developed.


2018-06-12

Practical Text for the Data Professional.


Recently, I have been having conversations about text analysis. 



Before we get into the details, why would you want to do Text analysis?  Do you
  • Collect survey data?  
  • Customer feedback? 
  • Complaint forms? 
  • Market Content?
  • Solicit feedback through Social platforms?
  • Perform SEO?
These are just the tip of the iceberg when it comes to analyzing the text you deal with every day.

Text analysis, by itself, can be a little intimidating. So, I put together a small R notebook using some off the shelf CRAN packages to parse PDF files, and create some metrics that can be analyzed by Tableau and Gephi. The PDF files are a collection of books that I have downloaded from various sources over the years. Many of these are the PDF companions of hardback books I have purchased for my own learning of a given topic. Some are PDF conversions of Power Points from presentations I have attended.


The R notebook can be found on  RPubs, and the Tableau workbook can be found on Tableau Public.

Each cell of the R notebook can be a topic in and of itself. The process I followed for this outline is to
·         Simply (emphasis on simply) parse the document
·        Break the document into sections (not chapters)
·         Calculate the lexical score for each section
·         Calculate the Sentiment for each section
·         Annotate the text
·         Pull out the most frequently used Nouns, adjectives, Verbs, and Keyword phrases.

In the notebook I only show a single PDF that I parsed, I also create a “batch” process to create CSV’s for each of these. In addition to the csv files I also prepped the data into files that could be loaded into Gephi for Graph analysis. 

The individual CSV files, I loaded into Tableau for some different visualizations. 

This is an example graph of the smaller Automatic Keyword Extraction Graph created.

This shows the relationship between Documents and Sections that have the same keywords.

 If two documents use the same keyword that has been extracted from the raw text, there is a line or edge between the nodes which are the documents and sections.



The code I wrote is stored on my Github

Any of these features that are generated from the text could also be considered a feature to be used in a Machine Learning application as well depending on your use case for the text analysis.

I will be writing and speaking in much more detail about this process in the coming months, I will update this page when I have a link to where you can get more information. 

In the meantime, if you have questions, please comment below, and I will both answer and incorporate your questions into future work.

Enjoy!

2017-10-22

That is a Graph Problem!

English: A 4-node graph for illustrating conce...
English: A 4-node graph for illustrating concepts in transportation geography and network science. (Photo credit: Wikipedia)

Recently at the Data Modeling Zone conference I was asked how to identify a problem as something that should be solved with graph tools.

The difficulty, I think, for data modelers is that many of us with a relational background tend to think about the relationships of our data structures.

This table is related to this other table with a one-to-one relationship, or one-to-many, or many-to-one, or even many-to-many relationship.

There are whole books devoted to discussing how to create relational data models that support these relationships.

I wrote a little about Graph fundamentals here: http://bit.ly/GraphFundamentals, but applying these atomic definitions to a real world problem can be a bit of a stretch.

There are, however, a few words to key in on.

Path:

What is the path that a customer takes through our store?

English: Precedence graph Based on :Image:Dire...
English: Precedence graph Based on :Image:Directed.svg (Photo credit: Wikipedia)
This is clearly a graph type problem. It could also be a time-series type problem. If you want to look at an individual you would see one thing. If you take large sampling of your customer base and load that into a network visualization tool like Gephi then you may learn some new things, and gain additional insight into the layout of your store.

A path is about more than just the relationship between two things. It is about the relationship of many things, and how something (like a customer, or some data ) flows through the graph.

Learning the optimal path through a set of obstacles would require some iterative path analysis work.

These types of path questions are common in the human resource domain from the perspective of career path.

A segment of a social network
A segment of a social network (Photo credit: Wikipedia)
People:

Social Network Analysis is one of the practical applications of graph theory.

Milgrams experiments are key touch-points that are commonly mentioned trying to understand the degrees of separation of two items. How often do people speak to one another? Does Ann talk to Bob, then speak to Charlie all the time?

If Ann says something positive about your brand, will Bob and Charlie both like your product?

If Ann says something negative will your stock price go down?

Who is talking about your products and who is listening to them?


English: Example of the Shared Shortest Path P...
English: Example of the Shared Shortest Path Problem (Photo credit: Wikipedia)

Data Itself:

My thoughts about understanding how data movement, and data structures themselves can be thought of as a graph, I have written about previously: http://bit.ly/DataStructureGraph

Some other terms in similar context are Data Lineage, and Data Pipeline.

How does data flow through your organization?
How does it flow into your organization?

How does it flow out of your organization?

Once in your organization how many systems does the same data flow into and out of without enrichment?

Does this data really need to go into those systems?


Movement:

How does a thing (Package, Product, Person, or Participant) move that your company interacts with? Rarely does it move from only one place to another.

Each step in the thing moving from one place to another is part of a path mentioned above.

You may think that a product moving from a shelf, to a box, then on to a truck for delivery to a customer can all be handled by individual applications. This is entirely possible. the value to doing graph analysis is new insight into existing data.


I would never suggest that Graph Analysis or Network Science is the only way to look at a problem.
I would suggest hat these tools can provide new or unique insight into the problems where businesses are trying to solve problems related to :Paths, people, Data, or Movement.

After all, Data Science  applies a fresh perspective on our existing world.

We should all be trying to achieve more with our data.

2017-10-21

Sentiment Text ETL.

English: Robert Plutchik's Wheel of Emotions
English: Robert Plutchik's Wheel of Emotions (Photo credit: Wikipedia)
I attended a presentation by Bill Inmon where he spoke of the value to various businesses of his product called TextualETL.

There was a question in the audience about trying some of these text techniques ourselves, is there anything he could teach us.

The answer was less that satisfying to a do it yourself-er like some of us in the audience.

I have had some reason to do basic sentiment analysis at work recently and I was really looking forward to his talk.

Since the question was raised about how to get started in this area without totally going overboard, I will share some of my experiences.

I use R and SQL for the majority of my work, so the sentiment work will be some basic R code.

If there is some interest, please post a comment, and I will add this to my github for sharing.

Here is a small sample for doing sentiment:

library(syuzhet)
# Get sentiment on the comments of the source data set
sentiment_data <- get_nrc_sentiment(as.character(source_data_frame$Comments))
# Transpose rows to columns
transposed_sentiment_data<-data.frame(t(sentiment_data))
# Summarize the data so we have a single row per sentiment.
transposed_sentiment_data_summary <- data.frame(rowSums(td[1:length(transposed_sentiment_data)]))
# change the name of the result set
names(transposed_sentiment_data_summary)[1] <- "count"
transposed_sentiment_data_summary <- cbind("sentiment" = rownames(transposed_sentiment_data_summary), transposed_sentiment_data_summary)
rownames(transposed_sentiment_data_summary) <- NULL
# only get the emotional data into the subset.
subset_sentiment_data<-transposed_sentiment_data_summary[1:8,]
# display a quick plot
qplot(sentiment, data=subset_sentiment_data, weight=count,fill=sentiment) +ggtitle(plot_title)
# display a plot that is just positive or negative data.

qplot(sentiment, data=transposed_sentiment_data_summary[9:10,],weight=count,fill=sentiment)+ggtitle('Positive/Negative')


So long as your source data set has some business key stored in it, this data frame can be written out to a data base (I use snowflake), as a staging table, that is then transformed to a Fact table.

I created a small dimension table for sentiment like this:

Example of a database star schema. A central f...
INSERT INTO dim_sentiment VALUES
(1,'ANGER'),
(2,'ANTICIPATION'),
(3,'DISGUST'),
(4,'FEAR'),
(5,'JOY'),
(6,'NEGATIVE'),
(7,'POSITIVE'),
(8,'SADNESS'),
(9,'SURPRISE'),
(10,'TRUST');



These are the sentiments available using the get_nrc_sentiment() function from the syuzhet package.

There are some much more sophisticated techniques that could be done with R and text analysis, but this is just a small taste of what can be done.

As a suggestion, I could see how doing some Topic Modeling of your comment data could lead to new dimensions you would want to incorporate into your data warehouse. Another thought is to record the timestamps of comments mad that are transcribed from a customer service call.

Does the sentiment change over time of the customer that is being helped? You would hope so.

Which one of your customer service agent consistently has the largest swing from negative to positive?
Don't know the answer to this question?

Maybe you should think about Text analytics.


Translating Textual data into data that can be used in a data warehouse is only one way of leveraging text data, but if you have powerful self service tools like Tableau, Looker, or Microstrategy, having your data in this structure makes it easy for some quick analysis on what people are thinking in the feedback they are giving to you.

Always,  when doing this type of text analysis, ensure that you have some type of business key that associates the voice of this customer to the summation of what they are saying.

Narrowing down the positive or negative comments can be invaluable for finding the needle in the haystack for the feedback you are interested in.



2017-09-25

Equally Incremented Sequential Numbers



I have been studying an interesting pattern of numbers recently. 

It is related to a comment I have heard said repeatedly by statisticians, that seems like it should not be true. 

The comment is: “If you play the lottery why not just pick the number 1,2,3,4,5 or 2,3,4,5,6? They are just as likely to show up as any other number.” 

However, if they are just as likely to show up why do they so seldom appear in the random number generator that is the lottery? 

Let us see if we can determine why this is the case. 

But first we must create some narrow definitions, and a formula. 

The above sequence fits the definition of five consecutive numbers equally incremented by some number. In this case the number one. 


When defining the odds for winning the lottery the total number of possibilities is referenced. Your odds of winning are 1/(N choose K). The number you have chosen must match the 1 set of numbers that come out of the drawing based on the selection of K numbers form N possibilities.

Do equally incremented sequential numbers appear to behave differently? To be able to count how many equally incremented sequential number sets of length K could be selected from a set of size N the mathematical notation becomes: 

N-S(K-1)

In human readable terms this yields the total number of equally incremented sets of K items from the set size N, with a sequential increment of S.

This expression gives the results it does based on the following: 

By the nature of consecutive numbers the maximum first number in the set produced will be the product of the increment and the length of the selection set minus one. 

Since these are consecutive numbers this maximum first number is also the total number of all equally incremented consecutive numbers that can be drawn from the set of size N.

Let us do a small demonstration. 
Setting N to 8, and K to 3 the total number of selections we could get out of this combination is 8 choose 3  which is 56.  To get the total number of possible equally incremented sequential numbers we must increment count the number numbers produced by each increment of S




The colors represent the counts.

Purple: 8-1(3-1) = 6 {(1,2,3)(2,3,4)(3,4,5)(4,5,6)(5,6,7)(6,7,8)}
Green : 8-2(3-1) = 4 {(1,3,5)(2,4,6)(3,5,7)(4,6,8)}
Blue  : 8-3(3-1)  = 2 {(1,4,7)(2,5,8)}


 
 



The summation is: 

The sum of these individual calculations is 12.


Now that we have this number the question we want to ask is: 

What is the probability that 3 numbers chosen from the set of 8 will be equally incremented sequential numbers ? 

The probability is 12/56. 

What is the probability that 3 numbers chosen from the set of 8 will not be equally incremented sequential numbers ?
44/56. 

Reducing the results, we have 3/14, and 11/14 respectively.

There are 11 to 3 odds against choosing three equally incremented sequential numbers from a set of 8 numbers. 

This is one way of determining the odds of equally incremented sequential numbered sets of numbers coming out of a random number generator like a lottery drawing.

There are a few other use cases for this formula related to path length calculations for graphs that I will continue to research. More to come on this interesting formula.