# data[].attributes.body
Dice gif , they are used generally to teach probability to beginner level students

# data[].attributes.body
What does really probability mean ?

# data[].attributes.attachment_link.title
What is PROBABILITY? What does PROBABILITY mean? PROBABILITY meaning, definition & explanation

# data[].attributes.body
What is Combinatorics ?

# data[].attributes.attachment_link.readable_text
Combinatorics is an area of mathematics primarily concerned with counting, both as a means and an end in obtaining results, and certain properties of finite structures. It is closely related to many other areas of mathematics and has many applications ranging from logic to statistical physics, from evolutionary biology to computer science, etc.

The full scope of combinatorics is not universally agreed upon. According to H.J. Ryser, a definition of the subject is difficult because it crosses so many mathematical subdivisions. Insofar as an area can be described by the types of problems it addresses, combinatorics is involved with:

the enumeration (counting) of specified structures, sometimes referred to as arrangements or configurations in a very general sense, associated with finite systems,

the existence of such structures that satisfy certain given criteria,

the construction of these structures, perhaps in many ways, and

optimization: finding the "best" structure or solution among several possibilities, be it the "largest", "smallest" or satisfying some other optimality criterion.

Leon Mirsky has said: "combinatorics is a range of linked studies which have something in common and yet diverge widely in their objectives, their methods, and the degree of coherence they have attained." One way to define combinatorics is, perhaps, to describe its subdivisions with their problems and techniques. This is the approach that is used below. However, there are also purely historical reasons for including or not including some topics under the combinatorics umbrella. Although primarily concerned with finite systems, some combinatorial questions and techniques can be extended to an infinite (specifically, countable) but discrete setting.

Combinatorics is well known for the breadth of the problems it tackles. Combinatorial problems arise in many areas of pure mathematics, notably in algebra, probability theory, topology, and geometry, as well as in its many application areas. Many combinatorial questions have historically been considered in isolation, giving an ad hoc solution to a problem arising in some mathematical context. In the later twentieth century, however, powerful and general theoretical methods were developed, making combinatorics into an independent branch of mathematics in its own right. One of the oldest and most accessible parts of combinatorics is graph theory, which by itself has numerous natural connections to other areas. Combinatorics is used frequently in computer science to obtain formulas and estimates in the analysis of algorithms.

A mathematician who studies combinatorics is called a combinatorialist.

Basic combinatorial concepts and enumerative results appeared throughout the ancient world. In the 6th century BCE, ancient Indian physician Sushruta asserts in Sushruta Samhita that 63 combinations can be made out of 6 different tastes, taken one at a time, two at a time, etc., thus computing all 2 ⁶ − 1 possibilities. Greek historian Plutarch discusses an argument between Chrysippus (3rd century BCE) and Hipparchus (2nd century BCE) of a rather delicate enumerative problem, which was later shown to be related to Schröder-Hipparchus numbers. Earlier, in the Ostomachion, Archimedes (3rd century BCE) may have considered the number of configurations of a tiling puzzle, while combinatorial interests possibly were present in lost works by Apollonius.

In the Middle Ages, combinatorics continued to be studied, largely outside of the European civilization. The Indian mathematician Mahāvīra (c. 850) provided formulae for the number of permutations and combinations, and these formulas may have been familiar to Indian mathematicians as early as the 6th century CE. The philosopher and astronomer Rabbi Abraham ibn Ezra (c. 1140) established the symmetry of binomial coefficients, while a closed formula was obtained later by the talmudist and mathematician Levi ben Gerson (better known as Gersonides), in 1321. The arithmetical triangle-a graphical diagram showing relationships among the binomial coefficients-was presented by mathematicians in treatises dating as far back as the 10th century, and would eventually become known as Pascal's triangle. Later, in Medieval England, campanology provided examples of what is now known as Hamiltonian cycles in certain Cayley graphs on permutations.

During the Renaissance, together with the rest of mathematics and the sciences, combinatorics enjoyed a rebirth. Works of Pascal, Newton, Jacob Bernoulli and Euler became foundational in the emerging field. In modern times, the works of J.J. Sylvester (late 19th century) and Percy MacMahon (early 20th century) helped lay the foundation for enumerative and algebraic combinatorics. Graph theory also enjoyed an explosion of interest at the same time, especially in connection with the four color problem.

In the second half of the 20th century, combinatorics enjoyed a rapid growth, which led to establishment of dozens of new journals and conferences in the subject. In part, the growth was spurred by new connections and applications to other fields, ranging from algebra to probability, from functional analysis to number theory, etc. These connections shed the boundaries between combinatorics and parts of mathematics and theoretical computer science, but at the same time led to a partial fragmentation of the field.

Enumerative combinatorics is the most classical area of combinatorics and concentrates on counting the number of certain combinatorial objects. Although counting the number of elements in a set is a rather broad mathematical problem, many of the problems that arise in applications have a relatively simple combinatorial description. Fibonacci numbers is the basic example of a problem in enumerative combinatorics. The twelvefold way provides a unified framework for counting permutations, combinations and partitions.

Partition theory studies various enumeration and asymptotic problems related to integer partitions, and is closely related to q-series, special functions and orthogonal polynomials. Originally a part of number theory and analysis, it is now considered a part of combinatorics or an independent field. It incorporates the bijective approach and various tools in analysis and analytic number theory and has connections with statistical mechanics.

Graphs are fundamental objects in combinatorics. Considerations of graph theory range from enumeration (e.g., the number of graphs on n vertices with k edges) to existing structures (e.g., Hamiltonian cycles) to algebraic representations (e.g., given a graph G and two numbers x and y, does the Tutte polynomial T G( x, y) have a combinatorial interpretation?). Although there are very strong connections between graph theory and combinatorics, they are sometimes thought of as separate subjects. While combinatorial methods apply to many graph theory problems, the two disciplines are generally used to seek solutions to different types of problems.

Design theory is a study of combinatorial designs, which are collections of subsets with certain intersection properties. Block designs are combinatorial designs of a special type. This area is one of the oldest parts of combinatorics, such as in Kirkman's schoolgirl problem proposed in 1850. The solution of the problem is a special case of a Steiner system, which systems play an important role in the classification of finite simple groups. The area has further connections to coding theory and geometric combinatorics.

Order theory is the study of partially ordered sets, both finite and infinite. Various examples of partial orders appear in algebra, geometry, number theory and throughout combinatorics and graph theory. Notable classes and examples of partial orders include lattices and Boolean algebras.

Matroid theory abstracts part of geometry. It studies the properties of sets (usually, finite sets) of vectors in a vector space that do not depend on the particular coefficients in a linear dependence relation. Not only the structure but also enumerative properties belong to matroid theory. Matroid theory was introduced by Hassler Whitney and studied as a part of order theory. It is now an independent field of study with a number of connections with other parts of combinatorics.

Extremal combinatorics studies extremal questions on set systems. The types of questions addressed in this case are about the largest possible graph which satisfies certain properties. For example, the largest triangle-free graph on 2n vertices is a complete bipartite graph . Often it is too hard even to find the extremal answer f( n) exactly and one can only give an asymptotic estimate.

Ramsey theory is another part of extremal combinatorics. It states that any sufficiently large configuration will contain some sort of order. It is an advanced generalization of the pigeonhole principle.

In probabilistic combinatorics, the questions are of the following type: what is the probability of a certain property for a random discrete object, such as a random graph? For instance, what is the average number of triangles in a random graph? Probabilistic methods are also used to determine the existence of combinatorial objects with certain prescribed properties (for which explicit examples might be difficult to find), simply by observing that the probability of randomly selecting an object with those properties is greater than 0. This approach (often referred to as the probabilistic method) proved highly effective in applications to extremal combinatorics and graph theory. A closely related area is the study of finite Markov chains, especially on combinatorial objects. Here again probabilistic tools are used to estimate the mixing time.

Combinatorics on words deals with formal languages. It arose independently within several branches of mathematics, including number theory, group theory and probability. It has applications to enumerative combinatorics, fractal analysis, theoretical computer science, automata theory, and linguistics. While many applications are new, the classical Chomsky-Schützenberger hierarchy of classes of formal grammars is perhaps the best-known result in the field.

Geometric combinatorics is related to convex and discrete geometry, in particular polyhedral combinatorics. It asks, for example, how many faces of each dimension a convex polytope can have. Metric properties of polytopes play an important role as well, e.g. the Cauchy theorem on the rigidity of convex polytopes. Special polytopes are also considered, such as permutohedra, associahedra and Birkhoff polytopes. Combinatorial geometry is an old fashioned name for discrete geometry.

Combinatorial analogs of concepts and methods in topology are used to study graph coloring, fair division, partitions, partially ordered sets, decision trees, necklace problems and discrete Morse theory. It should not be confused with combinatorial topology which is an older name for algebraic topology.

Arithmetic combinatorics arose out of the interplay between number theory, combinatorics, ergodic theory, and harmonic analysis. It is about combinatorial estimates associated with arithmetic operations (addition, subtraction, multiplication, and division). Additive number theory (sometimes also called additive combinatorics) refers to the special case when only the operations of addition and subtraction are involved. One important technique in arithmetic combinatorics is the ergodic theory of dynamical systems.

Infinitary combinatorics, or combinatorial set theory, is an extension of ideas in combinatorics to infinite sets. It is a part of set theory, an area of mathematical logic, but uses tools and ideas from both set theory and extremal combinatorics.

Gian-Carlo Rota used the name continuous combinatorics to describe geometric probability, since there are many analogies between counting and measure.

Combinatorial optimization is the study of optimization on discrete and combinatorial objects. It started as a part of combinatorics and graph theory, but is now viewed as a branch of applied mathematics and computer science, related to operations research, algorithm theory and computational complexity theory.

Coding theory started as a part of design theory with early combinatorial constructions of error-correcting codes. The main idea of the subject is to design efficient and reliable methods of data transmission. It is now a large field of study, part of information theory.

Discrete geometry (also called combinatorial geometry) also began as a part of combinatorics, with early results on convex polytopes and kissing numbers. With the emergence of applications of discrete geometry to computational geometry, these two fields partially merged and became a separate field of study. There remain many connections with geometric and topological combinatorics, which themselves can be viewed as outgrowths of the early discrete geometry.

Combinatorial aspects of dynamical systems is another emerging field. Here dynamical systems can be defined on combinatorial objects. See for example graph dynamical system.

There are increasing interactions between combinatorics and physics, particularly statistical physics. Examples include an exact solution of the Ising model, and a connection between the Potts model on one hand, and the chromatic and Tutte polynomials on the other hand.

Björner, Anders; and Stanley, Richard P.; (2010); A Combinatorial Miscellany

Bóna, Miklós; (2011); A Walk Through Combinatorics (3rd Edition). ISBN 978-981-4335-23-2, 978-981-4460-00-2

Graham, Ronald L.; Groetschel, Martin; and Lovász, László; eds. (1996); Handbook of Combinatorics, Volumes 1 and 2. Amsterdam, NL, and Cambridge, MA: Elsevier (North-Holland) and MIT Press. ISBN 0-262-07169-X

Lindner, Charles C.; and Rodger, Christopher A.; eds. (1997); Design Theory, CRC-Press; 1st. edition (1997). ISBN 0-8493-3986-3.

Riordan, John (2002) [1958], An Introduction to Combinatorial Analysis, Dover, ISBN 978-0-486-42536-8

Ryser, Herbert John (1963), Combinatorial Mathematics, The Carus Mathematical Monographs(#14), The Mathematical Association of America

Stanley, Richard P. (1997, 1999); Enumerative Combinatorics, Volumes 1 and 2, Cambridge University Press. ISBN 0-521-55309-1, 0-521-56069-1

van Lint, Jacobus H.; and Wilson, Richard M.; (2001); A Course in Combinatorics, 2nd Edition, Cambridge University Press. ISBN 0-521-80340-3

# data[].attributes.attachment_link.description
Combinatorics is an area of mathematics primarily concerned with counting, both as a means and an end in obtaining results, and certain properties of finite structures. It is closely related to many other areas of mathematics and has many applications ranging from logic to statistical physics, from evolutionary biology to computer science, etc.

# data[].attributes.body
Gif about star graph which is a graph type in graph theory

# data[].attributes.body
About Graph theory

# data[].attributes.attachment_link.readable_text
So many things in the world would have never come into existence if there hadn't been a problem that needed solving. This truth applies to everything, but boy, is it obvious in the world of computer science.

Someone needed a way of keeping track of the order of things, so they played around with and created different data structures until they found the one that worked the best for the specific problem that they were trying to solve. Someone else needed a good way of storing data, so they played around with different number systems until they found one that worked best for the kind of information that they wanted to contain. People needed a good way of labeling and processing tasks, so they found a way to build upon the tools they had and created a way to juggle all the things that one single system needed to do, at any given time.

Of course, computer science isn't the only field to innovate and build upon what came before it, but I do think that it's unique in one way: computer science's innovations rely and build upon its own abstractions.

I've talked about abstractions a whole lot in this series, because ultimately, that's what this series is about: finding the joy in the abstractions that lie beneath the things that all of us use, every single day. And, for what it's worth, when I say "us", I'm only partially talking about us as programmers, the producers of technology - I also mean us as users, the consumers of technology.

So, which amazing abstraction shall we learn about next? Well, now that we're experts in tree data structures, it only seems right to understand where trees came from. Trees are actually a subset of something you might have already heard about: graphs. But in order to truly know why we use graphs and what they are, we'll need to go deep down to the very roots of something that stems from discrete mathematics: graph theory.

If this is your very first foray into discrete math, fear not - it's mine, too! Let's tackle it together - and try not to lose our sanity in the process.

Loosey-goosey graphs

When we first started looking at non-linear structures, we learned about their most fundamental characteristic: that their data doesn't follow an order - at least, not an obvious numerical one, like we see in arrays or linked lists. Trees, as we learned, start with a root node, and might connect to other nodes, which means that could contain subtrees within them. Trees are defined by a certain set of rules: one root node may or may not connect to others, but ultimately, it all stems from one specific place. Some trees have even more specific rules, like binary search trees, which can only ever have two links to two nodes at any given time.

But what if we did something kind of crazy and just...threw these rules out the window? Well, as it turns out, we totally can do that! It's just that we wouldn't be dealing with trees anymore - we'd be dealing with something called a graph.

Trees are nothing more than restricted types of graphs, just with many more rules to follow . A tree will always be a graph, but not all graphs will be trees.

So, what is it that makes a tree different from the large umbrella of graphs?

Well, for one thing, a tree can only flow in one direction, from the root node to either leaf nodes or child nodes. A tree can also only have one-way connections - a child node can only have one parent, and a tree can't have any loops, or cyclical links.

With graphs, all of these restrictions go straight out the window. Graphs don't have any concept of a "root" node. And why would they? Nodes can be connected in any way possible, really. One node might be connected to five others! Graphs also don't have any notion of "one-directional" flow - instead, they might have direction, or they might have no direction whatsoever. Or, to complicate matters further, they could have some links that have direction and others that don't! But we won't get into that today.

Let's stick with the simple stuff to start.

Graphs with direction, and graphs without

Okay, so we know that graphs pretty much break all the rules that we know. However, there is one characteristic that every graph must have: every graph always needs to have, at the very least, one single node. Just as how trees need at least one root node in order to be considered a "tree", similarly, a graph needs at least a single node in order to be considered a "graph". A graph with just one node is usually referred to as a singleton graph, although we won't really be dealing with those.

Most of the graphs we'll be dealing with are a bit more complex. But, don't be worried - we won't be diving into the super complicated graphs today. And trust me, some graphs really are complicated!

Instead, let's look at the two types of graphs that are pretty easy to spot, and also pretty common in graph theory problems: directed graphs, and undirected graphs.

As we know, there are no real rules in the way that one node is connected to another node in a graph. Edges (sometimes referred to as links) can connect nodes in any way possible.

The different types of edges are pretty important when it comes to recognizing and defining graphs. In fact, that's one of the biggest and most obvious differentiators between one graph and another: the types of edges that it has. For the most part (aside from one exception, which we won't cover today), graphs can have two types of edges: a edge that has a direction or flow, and an edge that has no direction or flow. We refer to these as directed and undirected edges, respectfully.

In a directed edge, two nodes are connected in a very specific way. In the example below, node A connects to node B; there is only one way to travel between these two nodes - only one direction that we can go. It's pretty common to refer to the node that we're starting from as the origin, and the node that we're traveling toas the destination. In a directed edge, we can only travel from the origin to the destination, and never the other way around.

However, it's an entirely different story with undirected edges. In an undirected edge, the path that we can travel goes both ways. That is to say, the path between the two nodes is bidirectional, meaning that the origin and destination nodes are not fixed.

This differentiation is actually pretty important, because the edges in a graph determine what the graph is called. If all of the edges in a graph are directed, the graph is said to be a directed graph, also called digraph. If all of the edges in a graph are undirected, the graph is said to be - you guessed it - an undirected graph! Go figure, right?

This is all very cool, but at this point, I want to know two things - where did all of this graph stuff come from, exactly? And...why should we care?

Let's investigate.

Tread lightly: we're in graph country now

Computer science loves to borrow stuff. More specifically, it has borrowed a lot of concepts from logic and mathematics. As it turns out, this is the case with graphs.

Graph data structures as we know them to be computer science actually come from math, and the study of graphs, which is referred to as graph theory.

In mathematics, graphs are a way to formally represent a network, which is basically just a collection of objects that are all interconnected.

As it turns out, when computer scientists applied graph theory to code (and ultimately implemented graphs as data structures), they didn't change a whole lot. So, a lot of the terms that we use to describe and implement graphs are the exact terms that we'll find in mathematical references to graph theory.

For example, in mathematical terms, we describe graphs as ordered pairs. Remember high school algebra, when we learned about (x,y) ordered pair coordinates? Similar deal here, with one difference: instead of x and y, the parts of a graph instead are: , for vertices, and , for its edges.

The formal, mathematical definition for a graph is just this: G = (V, E). That's it! Really. I promise.

But hang on a second - what if our graph has more than one node and more than one edge! In fact...it will pretty much always have multiple edges if it has more than one node. How on earth does this definition work?

Well, it works because that ordered pair - (V, E) - is actually made up of two objects: a set of vertices, and a set of edges.

Okay, that makes more sense to me now. But it would be a whole lot clearer if I had an example and actually wrote out the definition of a graph! So we'll do just that. In the example below, we have an undirected graph, with 8 vertices, and 11 edges.

So what's going on here?

Well, we wrote out our ordered pair (V, E), but because each of those items is an object, we had to write those out as well. We defined V as an unordered set of references to our 8 vertices. The "unordered" part is really important here, because remember, unlike trees, there is no hierarchy of nodes! Which means that we don't need to order them, since order doesn't matter here.

We also had to define E as an object, which contains a bunch of edge objects within it. Notice yet again that our edge objects are also unordered. Why might that be? Well, what type of graph is this? Is there any direction or flow? Is there a fixed sense of "origin" and "destination"?

Nope, there's not! This is an undirected graph, which means that the edges are bidirectional and the origin node and destination node are not fixed. So, each of our edge objects are also unordered pairs.

This particularity, of course, leads us to wonder: what if this were a directed graph? Time for another example! Here's a directed graph, with three vertices and three edges:

The way we define the vertices here doesn't look any different, but let's look more closely at our edge definition. Our edge objects in this case are ordered pairs, because direction actually matters in this case! Since we can only travel from the origin node to the destination node, our edges must be ordered, such that the origin node is the first of the two nodes in each of our edge definitions.

Cool, so that's how we define graphs. But...when would we ever actually use graphs? Well, you probably used one today. You might just not know it yet! Time to change that.

Super social graphs

Graphs are all around us, we just don't always see them for what they are.

In fact, by the very act of reading this post, you are literally on a graph right now. The web is a massive graph structure! When we click between websites and navigate back and forth between URLs, we're really just navigating through a graph. Sometimes those graphs have nodes with edges that are undirected - I can go back and forth from one webpage to another - and others that are directed - I can only go from webpage A to webpage B, and never the other way around.

But there's an even better example that beautifully illustrates our daily interactions with graphs: social networks.

Facebook, a massive social network, is a type of graph. And if we think more about it actually functions, we start to better understand how we can define, and exactly what type of graph it is. On Facebook, if I add you as a friend, you must accept my request. It's not possible for me to be your friend on the network without you also being mine. The relationship between two users (read: nodes or vertices in graph terms!) is bidirectional. There's no concept of an "origin" and a "destination" node - instead, you're my friend and I am yours.

Can you guess what type of graph Facebook is implemented as?

If you guessed undirected graph, then you're right! Well done. Relationships are two-way, so if we were to define Facebook's friend network as a graph, its edges would all end up being unordered pairs when we wrote them out.

Twitter, on the other hand, works very differently from Facebook. I can follow you, but you might not follow me back. Case in point: I follow Beyonce, but she definitely does not follow me back (sadly).

We could represent Twitter as a directed graph. Each edge we create represents a one-way relationship. When you follow me on Twitter, you create an edge in the graph with your account as the origin node, and my account as the destination node.

So what happens when I follow you back? Do I change the edge you created when you followed me? Does it suddenly become bidirectional? Well, no, because I could unfollow you at any given point. When I follow you back on Twitter, I create a second edge, with my account as the origin node and yours as the destination.

The same model applies to Medium, as well, which lets you follow and unfollow authors! In fact, this network model is all over the place. And all it is, once we abstract all the layers away, is a graph. And truly, what a powerful thing it is.

Resources

Lots and lots of entire books have been written about graphs. I certainly didn't cover enough information here to fill a book, but that doesn't mean you can't keep learning about graphs! Fill your mind with more graph theory awesomeness, starting with the great links below.

1. Difference between trees and graphs, Poonam Dhanvani

2. What's the difference between the data structure tree and graph?, StackOverflow

3. Applications of Graph Theory In Computer Science: An Overview, S.G.Shirinivas et. al.

4. Graph Traversal, Professor Jonathan Cohen

5. Data Structures: Introduction To Graphs, mycodeschool

# data[].attributes.attachment_link.description
So many things in the world would have never come into existence if there hadn't been a problem that needed solving. This truth applies to everything, but boy, is it obvious in the world of computer science.

# data[].attributes.body
Topology  concisely is  the mathematical study of the properties that are preserved through deformations, twistings, and stretchings of objects

# data[].attributes.body
Cryptography is a subfield of mathematics dealing with secret messages

# data[].attributes.attachment_link.description
“Secret code” redirects here. For the Aya Kamiki album, see Secret Code.