Linear regression: confidence interval of the average of 10 slopes, error of propagation and error of the mean

I have 10 regression slopes in one group, each slope has its associated standard error. Now I want to find the average slope of this group and the associated standard error which will be used to find the 95% confidence interval. I know the standard error of the mean is the sum of the squared deviation from the mean divided by the square root of the sample size and the sample size is 10 in this case. I can calculate the average slope and find the deviation of each slope by subtracting the mean. But since each slope has an associated standard error, how do I take into account of this when I calculate the standard error of the mean or actually I don’t need include the error from each slope?

For the confidence range of the average slope of this group, I am using 1.96*standard error of the mean.

Your help will be much appreciated!

How can I find in mathematica if my equation have solution or not on a given interval?

I’m new to mathematica, I usually used wolfram alpha, however since the equation that I’m working with is a long equation I need to use mathematica. This is an example of the problem. So, I want to know if the equation will have solution or not when m>=4 and n>=3.41421m. I don’t know what command to use and when I enter this, it said that m>=4 is not a valid variable. What should I do?

Solve[{Binomial[n-1,2]-2[(Binomial[m-1,2])+(n-m)(m-1)-1]<=0}, {m>=4, n>=3.41421m}, Reals]

Mysql get records more then 3 in interval of 1 minute, return group_concat ID

Currently i have this dataset, i need to return grouped ids that are within the range of 60 seconds and have more than 3.

CREATE TABLE test  (   `id` bigint NOT NULL AUTO_INCREMENT,   created_date TIMESTAMP(1) NOT NULL,   origin_url   VARCHAR (200) NOT NULL,   client_session_id VARCHAR (50) NOT NULL,   PRIMARY KEY (`id`),   UNIQUE KEY `UC_PRE_CHAT_TALKID_COL` (`id`) ); 
INSERT INTO test VALUES (1,'2021-01-18 11:02:24.0', '', 'znkjoc3gfth2c3m0t1klii'), (2,'2021-01-18 11:02:35.0', '', 'znkjoc3gfth2c3m0t1klii'), (3,'2021-01-18 11:02:03.0', '', 'znkjoc3gfth2c3m0t1klii'), (4,'2021-01-18 11:11:28.0', '', 'znkjoc3gfth2c3m0t1klii'), (5,'2021-01-18 11:11:36.0', '', 'znkjoc3gfth2c3m0t1klii'), (6,'2021-01-18 11:11:05.0', '', 'znkjoc3gfth2c3m0t1klii'); 

db<>fiddle here

something like this:

ids     origin_url              client_session_id 1,2,3    znkjoc3gfth2c3m0t1klii 4,5,6     znkjoc3gfth2c3m0t1klii 

List of equally distanced numbers in an interval [a,b] that contains both a and b

I’m writing a program that should split a given interval $ [a,b]$ into a list of $ \sqrt{N}$ equidistant numbers:

N = 27; a = -1; b = 1; p = 3; Range[a, b, RealAbs[b - a]/(N^(1/p) - 1)]  {-1, 0, 1} 

The result should be a list that has $ N^\frac{1}{p}$ numbers, and that contains both $ a$ and $ b$ . The program works when $ N=x^p$ , where $ x$ is an integer, but fails to include $ b$ in the list when this condition is not met.

For example, when $ p=2$ and $ N$ is not a perfect square:

Np = 10; a = -1; b = 1; p = 2;  Range[a, b, RealAbs[b - a]/(Np^(1/p) - 1)] // N  {-1., -0.0750494, 0.849901} 

Is there a way to specify that both ends, $ a$ and $ b$ , should be part of the list, and then equally split the interval into a total of $ \sqrt{N}$ equidistant numbers?

CEO wants to terminate fifty developers (three developers each month with the interval of ten days) based on the lowest test scores

XYZ Soft is facing a big loss in the industry. Therefore, the company has started to offload its software developers. It started to conduct a test of hundred developers on daily basis and store their test scores in a data structure. After ten days, its CEO wants to terminate fifty developers (three developers each month with the interval of ten days) based on the lowest test scores.

Suppose you are working as a most senior developer in the company then which of the following data structure you will recommend to the CEO in the above given scenario.

  1. 1.  AVL Tree 
  2. 2.  Heap 

Justify your answer with solid reason.

Returning random integer from interval based on last result and a seed

Suppose we have an interval of integers [a, b]. I would like to have a function that returns random members from within the interval, without repetitions. Once that all members within the interval are explored, the function would start to return the same first random sequence again, in the same order.

Example: a=1, b=5

3, 1, 4, 5, 2, 3, 1, 4, 5, 2, 3, 1, 4, 5, 2, ... 

This would be easy to achieve by shuffling an array of all elements between a and b, and repeating it once the array is finished. However, this would take too much memory space, and this is not suitable for my case (I might have millions of elements).

Instead, the function I’d like to have would be more or less like this:

f(a, b, n, seed) -> n+1 


a - start of interval b - end of interval n - last element returned from list seed - self-explanatory n+1 - next random element from list, calculated by using the seed and the last element returned (n) 

The trick is knowing some way to get a non-repeated number from the interval based only on the element returned before and the seed. In the end, it would behave like a circular list randomized at its initialization, but without using memory space.

How will Apple and Google provide 5-minute data on Covid exposures using 10-minute interval numbers in the hash?

The goal of COVID-19 exposure notification is to notify people that they were exposed to someone who later tested positive for the virus. Protecting privacy in this process requires some cryptography, and avoiding excessively granular detail on user locations. But providing data useful for disease prevention requires adequate detail in measuring the length of exposures.

There is a new API for such exposure notification from Apple and Google, but it has a tension between 5- and 10-minute numbers that I don’t see how to resolve.

The cryptography specification, v1.2.1, specifies 10-minute intervals as inputs to the hash: “in this protocol, the time is discretized in 10 minute intervals that are enumerated starting from Unix Epoch Time. ENIntervalNumber allows conversion of the current time to a number representing the interval it’s in.”

Meanwhile the FAQ, v1.1, specifies 5-minute increments in the output: “Public health authorities will set a minimum threshold for time spent together, such that a user needs to be within Bluetooth range for at least 5 minutes to register a match. If the contact is longer than 5 minutes, the system will report time in increments of 5 minutes up to a maximum of 30 minutes to ensure privacy.”

How will the system report times in 5-minute increments when the interval numbers are only updated for the hash once every 10 minutes?

Redirect page during a weekly time interval

I have a registration page ‘register’ which sends information to a third party server as part of a dual registration process. The 3rd party have a 2 hr weekly maintenance schedule every Friday 9-11pm CT. I wish to redirect users to a new page that just says you can’t register during this specified maintenance time period.

I am considering using the below added to functions.php. Is this the right approach, does it look like it would work? I don’t want to reset the entire site’s time zone either, as not in America, just for this usage.

add_action ( 'template_redirect', 'redirect_from_registration_maintenance' ); function redirect_from_registration_maintenance(){     date_default_timezone_set('America/Chicago');     $  hour = date('G');     $  minute = date('i');     $  day = date('w');     $  m = $  hour * 60 + $  minute; // Minutes since midnight. if ( !is_user_logged_in() && is_page( 'register' )   && $  day == 5 // Friday...   && $  m >= 1260 // ... after 9pm…   && $  m <= 1380 // ... but before 11pm… ) {     wp_redirect('') ; exit();     } } 


Add on interval, Query for number of elements less than val

We have an array of numbers and we are supposed to do the following queries on it:

  1. Add number x to all elements on the subarray with indices [ L, R ] of the array.
  2. Query for number of elements less than number x of the whole array.

I have a solution with time complexity $ O(q \cdot log(n) \cdot sqrt(n))$ where $ n$ is the size of the array and $ q$ is the number of the queries. However for constraints $ n, q < 1e5$ with time limit of 2 seconds this is not efficient enough. So how to solve it on these constraints?