Hot Topics
Bridgei2i Analytics Solution
Technical Round
- Question 1
(x-a).(x-b)…..(x-z)=?
- Answer
The expression (x-a)(x-b) … (x-z) is the expanded form of a polynomial with degree equal to the number of terms, where each term is of the form (x-k) for some constant value “k”. The result of the expression would be a polynomial with degree equal to the number of terms, whose coefficients and the degree of each term depend on the values of “a”, “b”, …, “z”.
- Question 2
In a dark room, there’s a box with 100 socks. 50 are white and 50 are red. What is the minimum number of socks you have to pick up and come out such that you’re sure that you’ll have a pair?
- Answer
You have to pick up at least 2 socks to be sure that you have a pair. If you pick up 2 socks and they’re the same color, then you have a pair. If they’re different colors, then you have to keep picking socks until you find a pair.
- Question 3
What is the most impactful theory in statistics?
- Answer
It is difficult to identify a single “most impactful” theory in statistics, as the field is broad and encompasses a variety of theories that have each made significant contributions to the understanding of data and its analysis. However, some theories that have had a substantial impact on the field of statistics include:
The Gaussian Distribution (also known as the normal distribution) and its central limit theorem.
Maximum Likelihood Estimation (MLE) which is widely used to estimate the parameters of statistical models.
Bayesian Statistics, which provides a framework for incorporating prior knowledge and uncertainty into statistical analyses.
Hypothesis Testing, which provides a formal framework for making inferences about population parameters based on sample data.
Linear Regression, which is used to model the relationship between a dependent variable and one or more independent variables.
Each of these theories has had a significant impact on the field of statistics and has shaped the way that statistical analysis is conducted.
- Question 4
Unsort a sorted array
import random
def unsort_array(array):
random.shuffle(array)
return array
You can use this function to unsort a sorted list in Python. The random.shuffle
function shuffles the elements of the list in place, so the original list will be modified. The function returns the shuffled list, which is now unsorted.
- Question 5
I was given two more puzzles like there were three persons A, B, C in a room. If A shoots a person the probability of that person getting died is 100%, similarly B shoots it is 90% and C shoots it is 30%. Who will come out of that room?
- Answer
Given the probabilities of death for each person shooting, we cannot determine who will come out of the room. The probabilities given are conditional probabilities, meaning they depend on the event that a specific person shoots.
However, if we had additional information about the likelihood of each person shooting, we could use Bayes’ theorem to find the probability that each person will survive given the shooting probabilities. But without additional information, it is not possible to determine who will come out of the room.
- Question 6
How to calculate mean in R?
- Answer
To calculate the mean of a vector in R we use mean function which takes vector as an input and returns the average as a numeric.
- Question 7
What is the difference between matrix and data frame?
- Answer
Matrix | Data frame |
1. Collection of dataset arranged in a two dimensional rectangular organisation. | Stores data tables that contains multiple datatypes in multiple columns called fields. |
2. Its m*n array with similar data type. | It is a list of vector of equal length. It is a generalised form of matrix. |
3. It has fixed number of rows and columns. | It has variable number of rows and columns. |
4. The data stored in column is of same data type | The data stored must be numeric, character or factor type. |
5. Matrix is homogeneous. | Data frames are heterogeneous |
- Question 8
Real life examples where linear regression can be used and few other related to basic ML
- Answer
Linear Regression is a popular and widely used machine learning technique that models the relationship between a dependent variable and one or more independent variables. Here are a few real-life examples where linear regression can be used:
Sales forecasting: Linear regression can be used to predict future sales based on historical data and other relevant factors such as marketing spend, competition, and consumer trends.
Stock price prediction: Linear regression can be used to predict the future price of a stock based on its historical prices and other financial metrics such as earnings, dividends, and interest rates.
Housing price prediction: Linear regression can be used to predict the price of a house based on its size, location, and other factors such as the average income in the area and the number of schools nearby.
Healthcare: Linear regression can be used to predict the risk of a disease based on patient demographics, lifestyle factors, and medical history.
Other machine learning techniques related to basic ML include:
Logistic Regression: A technique used for binary classification problems, where the goal is to predict one of two outcomes.
Decision Trees: A technique used for both regression and classification problems, where the goal is to build a tree-like model that makes predictions based on the values of the input variables.
K-Nearest Neighbors: A technique used for classification problems, where the goal is to predict the class of an observation based on the classes of its closest neighbors.
Naive Bayes: A technique used for classification problems, where the goal is to predict the class of an observation based on its features and the class probabilities estimated from the data.
These are just a few examples of machine learning techniques that can be used for basic ML tasks. The choice of technique will depend on the specific problem being addressed and the type of data being used.