Merge sort on simd register - mergesort

Can anyone think of a way to perform merge sort on 8 elements of an simd register within 3 steps and 4 comparisons in each step?
Thank you in advance!

Related

usage of CP-SAT to forecast 3 Milions of boolean variables

Dears,
I want to understand if I using not properly the CP-SAT algorithm. Basically my code automatically creates a model reading a csv with a dataset. My code creates model.NewBoolVar() for each record of the dataset multiplied for the number of possible decisions to be taken by the optimization problem...
For example if I have a dataset with 1 Milion of records and I have to decide between 3 options, the model will contains 3 Milions of boolean variables. The combination of the 3 Milions of booleans is the solution to my optimizzation problem.
Currently after 100K variables the program is becoming unstable and python crashes. Do you think that I'm trying to use CP-SAT not properly? Do you have experience with this kind of volumes?
Thank you very much.
Cheers
You are aware that this is an NP problem.
Thus potentially, you are creating a search tree of size 2^3000000000.

Is there a 2 or 3-bit checksum algorithm

Is there a 2 or 3 bit checksum algorithm that I can use to check my 6 bits of data for errors which I am reading in from an optical sensor that detects 8 bit patterns? I was not able to find anything.
You can xor the first three bits with the second ones and append the result, then xor them again to check it on the other side.
You could possibly use two 3b/4b codes to validate the result:
https://en.wikipedia.org/wiki/8b/10b_encoding
Not alot you can do with 0, 1, 2 or 3. Maybe get an integer value from your 6 bits and then do mod 4.

Chi-sqaure type-1-error

I have a question about the chi-square test.
I have two between-subject factors, each with two levels (so 4 conditions). Furthermore, I have one dependent variable (qualitative), also consisting of two levels.
Now I want to make pairwise comparisons (so I have 6 chi-sqaure test in total). Is there any way I can control type-1-errors? In the literature I saw they often calculated interaction with a chi-sqaure test. Is this the way to do it, and if so, how do I do it?
I can work with both SPSS and Matlab.
Thank in advance!
Niels

Solving approach for a series

I am having a great trouble on finding the solution of this series.
index 1 2 3 4 5
number 0 1 5 15 35
here say first index is an exception but what is the solution for that series to pick an index & get the number. Please add your Explanation of the solving approach.
I would also like to have some extra example for solving approach of other this kind of series.
The approaches to solve a general series matching problem vary a lot, depending on the information you have about the series. You can start with reading up on time series.
For this series you can easily google it and find out they're related to the binomial coefficients like n!/(n-4)!/4! . Taking into account i, it will be something like (i+3)!/4!/(i-1)!

Choosing between MERGE and SET for combining data in SAS

I have a general question on methodology. How do I know whether match-merging (MERGE) or interleaving (SET) is better for combining datasets? If I have two related datasets, that seem to contain many of the same variables (but not all), but I don't know whether or not the information in said variables is the same, which is better?
Is there some sort of general rule of deciding which is better?
Thanks for your advice.
There really isn't a good answer to this question; there are fundamental differences between what "merging" and "interleaving" do. Take a few minutes and read the example in the SAS Concepts manual, particularly here.
I think that's a question that is very much specific to your data and what you are trying to achieve. You shouldn't combine the datasets at all until you know enough about the data to know whether or not you can combine them (set) or want to match-merge them. There cannot be a general rule because it simply depends on your data - if I had two datasets
data have_1;
input x y;
datalines;
1 2
2 3
3 4
;;;;
run;
data have_2;
input x y z;
datalines;
1 2 3
2 3 4
3 4 5
;;;;
run;
You could guess that have_1 and have_2 are the same observations, just with an additional variable z; but they easily could be different observations as well. If I told you that 'x' was the unique identifier, then you would suspect these are the same records; but if I told you that 'x' and 'y' were qualitative features, then they could easily be different observations that happen to be similar qualitatively.
The point here: know your data before doing anything with it. If you don't know your data you shouldn't be working with it in the first place.