Binary data


Binary data is data whose unit can take on only two possible states, traditionally labeled as 0 and 1 in accordance with the binary numeral system and Boolean algebra.
Binary data occurs in many different technical and scientific fields, where it can be called by different names:
A discrete variable that can take only one state contains zero information, and is the next natural number after 1. That is why the bit, a variable with only two possible values, is a standard primary unit of information.
A collection of bits may have power of two| states: see binary number for details. Number of states of a collection of discrete variables depends exponentially on the number of variables, and only as a power law on number of states of each variable. Ten bits have more states than three decimal digits. bits are more than sufficient to represent an information that requires decimal digits, so information contained in discrete variables with 3, 4, 5, 6, 7, 8, 9, 10… states can be ever superseded by allocating two, three, or four times more bits. So, the use of any other small number than 2 does not provide an advantage.
: representation of a Boolean algebra as a directed graph
Moreover, Boolean algebra provides a convenient mathematical structure for collection of bits, with a semantic of a collection of propositional variables. Boolean algebra operations are known as "bitwise operations" in computer science. Boolean functions are also well-studied theoretically and easily implementable, either with computer programs or by so-named logic gates in digital electronics. This contributes to the use of bits to represent different data, even those originally not binary.

In statistics

In statistics, binary data is a statistical data type consisting of categorical data that can take exactly two possible values, such as "A" and "B", or "heads" and "tails". As a form of categorical data, binary data is nominal data, meaning they represent qualitatively different values that cannot be compared numerically. However, binary data is frequently converted to count data by considering one of the two values as "success" and representing the outcomes as 1 or 0, which corresponds to counting the number of successes in a single trial: 1 or 0 ; see.
Often, binary data is used to represent one of two conceptually opposed values, e.g:
However, it can also be used for data that is assumed to have only two possible values, even if they are not conceptually opposed or conceptually represent all possible values in the space. For example, binary data is often used to represent the party choices of voters in elections in the United States, i.e. Republican or Democratic. In this case, there is no inherent reason why only two political parties should exist, and indeed, other parties do exist in the U.S., but they are so minor that they are generally simply ignored. Modeling continuous data as a binary variable for analysis purposes is called dichotomization. Like all discretization, it involves discretization error, but the goal is to learn something valuable despite the error: treating it as for the purpose at hand, but remembering that it cannot be assumed to be negligible in general.

Binary variables

A binary variable is a random variable of binary type, meaning with two possible values. Independent and identically distributed binary variables follow a Bernoulli distribution, but in general binary data need not come from i.i.d. variables. Total counts of i.i.d. binary variables follow a binomial distribution, but when binary variables are not i.i.d., the distribution need not be binomial.

Counting

Like categorical data, binary data can be converted to a vector of count data by writing one coordinate for each possible value, and counting 1 for the value that occurs, and 0 for the value that does not occur. For example, if the values are A and B, then the data set A, A, B can be represented in counts as,,. Once converted to counts, binary data can be grouped and the counts added. For instance, if the set A, A, B is grouped, the total counts are : 2 A's and 1 B.
Since there are only two possible values, this can be simplified to a single count by considering one value as "success" and the other as "failure", coding a value of the success as 1 and of the failure as 0. For example, if the value A is considered "success", the data set A, A, B would be represented as 1, 1, 0. When this is grouped, the values are added, while the number of trial is generally tracked implicitly. For example, A, A, B would be grouped as 1 + 1 + 0 = 2 successes (out of tmath|n

Regression

on predicted outcomes that are binary variables is known as binary regression; when binary data is converted to count data and modeled as i.i.d. variables, binomial regression can be used. The most common regression methods for binary data are logistic regression, probit regression, or related types of binary choice models.
Similarly, counts of i.i.d. categorical variables with more than two categories can be modeled with a multinomial regression. Counts of non-i.i.d. binary data can be modeled by more complicated distributions, such as the beta-binomial distribution. Alternatively, the relationship can be modeled without needing to explicitly model the distribution of the output variable using techniques from generalized linear models, such as quasi-likelihood and a quasibinomial model; see.

In computer science

In modern computers, binary data refers to any data represented in binary form rather than interpreted on a higher level or converted into some other form. At the lowest level, bits are stored in a bistable device such as a flip-flop. While most binary data has symbolic meaning not all binary data is numeric. Some binary data corresponds to computer instructions, such as the data within processor registers decoded by the control unit along the fetch-decode-execute cycle. Computers rarely modify individual bits for performance reasons. Instead, data is aligned in groups of a fixed number of bits, usually 1 byte. Hence, "binary data" in computers are actually sequences of bytes. On a higher level, data is accessed in groups of 1 word for 32-bit systems and 2 words for 64-bit systems.
In applied computer science and in the information technology field, the term binary data is often specifically opposed to text-based data, referring to any sort of data that cannot be interpreted as text. The "text" vs. "binary" distinction can sometimes refer to the semantic content of a file. However, it often refers specifically to whether the individual bytes of a file are interpretable as text or cannot so be interpreted. When this last meaning is intended, the more specific terms binary format and text format are sometimes used. Semantically textual data can be represented in binary format ; contrarily, image data is sometimes represented in textual format.