1. Statistical Hypothesis Testing Problem
Given two arrays of data points X and Y, and a confidence level, find whether the means of these sets are significantly different using a t-test. The program should also output the magnitude by which the null hypothesis passes or fails. The magnitude is defined as the minimum of the absolute difference between the means and the t-statistic at the confidence level for the two tests. For example, given X = [44.61, 72.757, 17.317, 41.51] and Y = [89.11, 12.68, 105.93, 17.048] with a confidence level = 0.95, determine if the means are significantly different and the magnitude by which the null hypothesis passes or fails. Return the answers in an array with 2 values: 'Yes' if the means are significantly different, or 'No' if they are not, and the second element contains the magnitude found to 2 decimals. Complete the function testHypothesis in the editor below.
2. Explain the differences between LEFT JOIN, RIGHT JOIN, and JOIN in SQL and discuss the ranking in a relational database.
Explain the differences between LEFT JOIN, RIGHT JOIN, and JOIN in SQL and discuss the ranking in a relational database.
3. Find the Nearest Cake
Assuming each person will always go for the nearest cake, given the index of a person, determine which cake they will be able to eat. Do not consider the case where two people are at the same shortest distance to one cake, and do not consider the case where one person has the same shortest distance to two different cakes.
4. Shortest Distance to Cake
Given an array where 0 represents an empty spot, 1 represents a person, and 2 represents a cake, define the distance as the number of empty spots between a person and a cake (not the index distance). What is the shortest distance between any person and any cake in the array? For example, [1,0,2] -> 1 and [1,1,2] -> 0.
5. Area of Land Locked by Water
In a 2D array, find the area of land that is locked by water, similar to the 'number of islands' problem but with the possibility of having inland lakes within the islands.