Answer:
Lexical rules that are defined in case of regular grammar are simple and the notation is quite easy to understand.
Regular expression are useful for defining constructs of identifiers or constants. e.g. a|b etc.
In the case of context-free, grammar is not simple and deals with the productions.
Context-free are useful in describing the nested constructs like if-else etc which are not defined by regular expressions.
These produce a higher level of reliability as it provides a medium for generating syntactical as well as semantic data. The grammar is context-free is a little complex.
Explanation:
Answer:
0.125 seconds
Explanation:
The formula for the time taken to transfer the file is = file size / bandwidth
Assuming the computer and server could only transfer data at the speed of 1000 Mbps or more, The time of transmission is;
= 125 MB / 1000 Mbps = 0.125 seconds.
Bayes’ Theorem provides a way that we can calculate the probability of a piece of data belonging to a given class, given our prior knowledge.
P(class|data) = (P(data|class) * P(class)) / P(data)
Where P(class|data) is the probability of class given the provided data.
Explanation:
- Naive Bayes is a classification algorithm for binary and multiclass classification problems.
- It is called Naive Bayes or idiot Bayes because the calculations of the probabilities for each class are simplified to make their calculations tractable.
This Naive Bayes tutorial is broken down into 5 parts:
Step 1: Separate By Class : Calculate the probability of data by the class they belong to, the so-called base rate. Separate our training data by class.
Step 2: Summarize Dataset : The two statistics we require from a given dataset are the mean and the standard deviation
The mean is the average value and can be calculated using :
mean = sum(x)/n * count(x)
Step 3: Summarize Data By Class : Statistics from our training dataset organized by class.
Step 4: Gaussian Probability Density Function : Probability or likelihood of observing a given real-value. One way we can do this is to assume that the values are drawn from a distribution, such as a bell curve or Gaussian distribution.
Step 5: Class Probabilities : The statistics calculated from our training data to calculate probabilities for new data. Probabilities are calculated separately for each class. This means that we first calculate the probability that a new piece of data belongs to the first class, then calculate the second class, on for all the classes.
Selling stock on the stock market