Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

I am analyzing a set of flow cytometry data in the online environment of OMIQ. OMIQ has a feature to analyze the data with the Significance analysis of microarrays (SAM) algorithm (https://www.pnas....
Loveforscience's user avatar
3 votes
2 answers
162 views

I do understand I have mistakes in this code #include <stdio.h> #include <stdlib.h> #include <string.h> int diziyi_yazdır(int dizi[], int dizi_uzunluğu) { for (int i ...
Creedance's user avatar
9 votes
2 answers
380 views

Consider an array of a permutation P of length n (n > 2), namely some order of the integers 1 through n. Example of P with length n = 7, [6,5,2,3,7,1,4] A "score" of a permutation is ...
user31824378's user avatar
-2 votes
2 answers
232 views

I have a list of a = [5,6,7,9] I want all the possible permutations, with one or more entry fixed. e.g. If I want to fix third element 7, then in all permutations I want to see 7 in the third place of ...
Zeryab Hassan Kiani's user avatar
4 votes
2 answers
182 views

Does C standard library provide any function that generate a random permutation of consecutive numbers within a range? How to make a function that efficiently does it? I'm thinking of making a random ...
PkDrew's user avatar
  • 2,301
0 votes
1 answer
44 views

I read that a function f is equivariant if f(P(x)) = P(f(x)) where P is a permutation So to check what means equivariant and permutation invariant I wrote the following code import torch import torch....
fenaux's user avatar
  • 47
-3 votes
1 answer
117 views

I have two JavaScript generator functions for permutations. They both provide Heap's enumeration. Question: I would like to know whether one implementation can be derived from the other by some ...
Hubert Kauker's user avatar
8 votes
3 answers
374 views

The problem Let's say you have 4 red balls, 2 blue balls and 1 green ball. That is 7 balls, and considering a ball can't be distinguished from another if it has the exact same color, this makes for a ...
RedStoneMatt's user avatar
  • 1,354
0 votes
0 answers
163 views

I am fairly confident (maybe I should not be) that I have structured my data correctly for PERMANOVA analysis in the vegan package using the adonis2() function. For my study design, I placed paired ...
Amanda Goldberg's user avatar
5 votes
2 answers
129 views

In his classical paper Permutation Generation Methods, Computing Surveys 1977, Robert Sedgewick presents his "Algorithm 1" on page 140 like this: procedure permutations(N); begin ...
Hubert Kauker's user avatar
1 vote
0 answers
60 views

I'm trying to check my understanding of how to determine the appropriate permutation restrictions for a two way anova where one of the variables is nested in the other, and making sure I understand ...
tlyons253's user avatar
  • 117
4 votes
3 answers
138 views

I have a vector of length 100 and I want to get a sample of certain size like 50, from all permutations of length 20 from elements of my original vector My attempt so far is to first to get all ...
Brian Smith's user avatar
  • 1,679
0 votes
1 answer
65 views

A permutations problem (LeetCode), which finds the permutations of an array [1,2,3], is returning an empty array through a backtracking recursive function. The console prints out the following: Input ...
Will Sherman's user avatar
1 vote
2 answers
107 views

I have a long input list, and I want to generate combinations of 3 elements. But each combination's elements should be drawn from a length-5 sublist of the original list, rather than drawing elements ...
tim pain's user avatar
5 votes
5 answers
176 views

I want to make a pandas dataframe with three columns, such that the rows contain all permutations of three columns, each with its own range of values are included. In addition, I want to sort them asc ...
noogrub's user avatar
  • 961
1 vote
1 answer
157 views

Hi I have made this code. Τhe code generates all binary permutations of a string with a given number of zeros and ones, checks for adjacency based on a specific homogeneity condition (differing by ...
Cybercode's user avatar
0 votes
1 answer
76 views

Concerning Javascript, I've been trying to understand backtracking lately and it's really confusing. Specifically, I've been trying to understand the permutation problem, which when given an array, we ...
ContravariantMind's user avatar
3 votes
2 answers
145 views

I would like to efficiently generate a list of "valid" permutations from a given list. By way of simple example, suppose I would like to generate the permutations of [1,2,3] where 3 is in ...
TNoms's user avatar
  • 121
-11 votes
3 answers
309 views

What is an efficient way to get the same result as list(product((0, 1), repeat=n)) without using itertools and any imports? For example, given n=3, the output be: [(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, ...
Ξένη Γήινος's user avatar
-1 votes
1 answer
40 views

Given an increasing identity index on n items [ 0, 1, ..., n-1 ], a value can be calculated by considering each entry as a number in base n and with place value corresponding to it's location (powers ...
Alaric Dobson's user avatar
-4 votes
1 answer
85 views

I have a list of items which can be any length (but will never contain duplicates of the same item), and a set of N bins which can each hold zero or one item. What's the easiest way to get all ...
CWRules's user avatar
  • 87
7 votes
0 answers
215 views

Assume we need to sort using only three operations - left cyclic shift, right cyclic shift, and swap (transposition) of positions 1 and 2. Shifts are only by 1 positions, so shifts by k - counts as &...
Alexander Chervov's user avatar
1 vote
1 answer
138 views

My purpose is to count permutations with certain properties. I first generate the permutations and then remove those that do not satisfy the desired properties. How could I improve the code to be able ...
PatrickT's user avatar
  • 10.6k
-3 votes
1 answer
82 views

Given two lists of length n, I've been trying to find a pythonic way to return a list of a list of n-tuples where each list of tuples is a distinct permutation of the possible values between the two ...
Jeffrey Van Laethem's user avatar
0 votes
0 answers
81 views

How can I print all possible words of a user-specified length "x" in python? I already know how to do it for a specific number of characters like all possible 3 letter words by using for ...
Aarush Ravez's user avatar
0 votes
1 answer
99 views

Determining a combination of selections from a list of sets that would yield the maximum number of unique numbers Consider an array of sets, with each set containing an arbitrary number of integers. A ...
C Ho's user avatar
  • 1
1 vote
3 answers
113 views

I have this coin flip data: library(dplyr) library(knitr) library(kableExtra) set.seed(123) n_flips <- 100 flips <- sample(c("H", "T"), n_flips, replace = TRUE) I manually ...
stats_noob's user avatar
  • 6,845
0 votes
2 answers
162 views

Given some arrays, I'd like to loop over every possible permutation of these arrays: Here's a minimal example: #include <array> #include <iostream> //#include <random> #include <...
haifisch123's user avatar
2 votes
1 answer
47 views

I'm encountering some very weird behaviour in some MATLAB code I've written, and can't quite tell why. If I increment the loop from 0.01 in steps of 0.01 to 0.09, all values are correct. However, if I ...
DRG's user avatar
  • 271
3 votes
2 answers
184 views

#include <iostream> using namespace std; void permute(int arr[],int len){ //if(len==1) cout << arr[fixed]; for(int i=0; i<len; i++){ cout << arr[i] << "...
KeShAw's user avatar
  • 49
1 vote
1 answer
70 views

After sorting an array, Dafny cannot verify an item in the old array exists in the sorted array. The sorted array is a permutation of the old array. What is missing here? var a := new int[][100,2,3,4,...
Anwar's user avatar
  • 11
0 votes
1 answer
138 views

I'm stuck with the following problem which I need to speed up a piece of code I have written in the past. I am programming in python, but this question is more about the algorithm than about the ...
PRT's user avatar
  • 11
1 vote
1 answer
258 views

This question is based around leetcode problem 46: Permutations. copy of the question for convenience: Given an array nums of distinct integers, return all the possible permutations. You can return ...
Tibetje2's user avatar
1 vote
0 answers
114 views

I would appreciate the help of this great community in finding an algorithm (in any programming language, though I have it in Visual Basic) to solve two related problems: Counting permutations with ...
Mencey's user avatar
  • 69
3 votes
2 answers
120 views

I would like to know if there is a simple solution to finding all combination of a vector with repeating elements. The practical application is in combinatorics math. For example: There is an urn with ...
snothaft's user avatar
0 votes
2 answers
88 views

I am new at codding.I have a question.How do I add text to combinations and permutations I've created? Also, is there a way to delete repetitive states in a repetitive permutation, that is, to print ...
Hüseyin's user avatar
0 votes
1 answer
170 views

I have an NxM incomplete chessboard (meaning an NxM chessboard with some tiles missing) and a number k (which is the number of non-attacking rooks I need to place on the board) the inputs of this ...
Nate3384's user avatar
  • 314
1 vote
2 answers
144 views

I want to transform the array [3, 4, 8] → [3, 4, 8, 34, 38, 48, 43, 83, 84, 348, 384, 834, 843, 438, 483] I tried array.permutation but this only returns [348, 384, 834, 843, 438, 483]. Is there a ...
Vessel's user avatar
  • 155
0 votes
1 answer
116 views

I have a pandas data frame with two columns: source and sink. In a simplified form, there are just 5 users (source column) that can owe money to any other user (sink column). I thought the following ...
alexey's user avatar
  • 455
1 vote
1 answer
183 views

I'm conducting a study comparing insect communities in forest canopy gaps and closed-canopy forest in three distinct forested areas. My experimental design is hierarchical and unbalanced. Simplified ...
fre1990's user avatar
  • 177
0 votes
1 answer
42 views

I am looking for the most efficient algorithm for comparing large set of strings that are representing possible amino acid substitutions at various positions of a 9mer peptide. As a toy example, the ...
ThomasW's user avatar
  • 11
0 votes
1 answer
49 views

This will be used for a fairly-ranked team-picking (each team must have exactly one element of each rank). One example of elegibe players would be: Rank 1:'Liam', 'Emma', 'Noah', 'Olivia', 'Ava' Rank ...
Daniel Rodrigues's user avatar
-1 votes
1 answer
82 views

I'm working on a Python3 code challenge where a message is encoded on or decoded from the shuffling order of a 52-card standard playing deck. I have already found how to encode the message, but I am ...
ep84's user avatar
  • 365
-1 votes
3 answers
219 views

I want to generate all possible lists of ["x","y","z",1,2,3] that are ordered in ascending order. "x", "y" and "z" can be any real numbers ...
Erel Segal-Halevi's user avatar
0 votes
1 answer
59 views

I am a bit confused with the definition of the permutation_test function provided by scipy. the following is what I wrote to calculate the p and null distribution x = disease['Theta'] y = nodisease['...
HappyDuppy's user avatar
0 votes
2 answers
49 views

Given the following array in R: x <- 1:24 dim(x) <- c(2, 4, 3) Which gives: > x , , 1 [,1] [,2] [,3] [,4] [1,] 1 3 5 7 [2,] 2 4 6 8 , , 2 [,1] [,2] [,3] [...
dputhier's user avatar
  • 804
3 votes
0 answers
65 views

Consider the following Matlab code: clear rng default A= nchoosek(1:1:10,2); A(:,3)=randn(size(A,1), 1); sA=size(A,1); The first two columns of A list all possible unordered pairs of integers between ...
Star's user avatar
  • 2,289
1 vote
1 answer
51 views

Lets say i have a data table that looks like this: for each combination of index level1 & 2 - a customer could be allocated a price that see's them get the value base column + the addition of any ...
GT1981's user avatar
  • 21
6 votes
3 answers
485 views

I have a rectangular matrix with n rows and m column. All entries of the matrix are natural numbers (including 0). Among the m columns, I'm given some index, j (< m). I'd like the matrix to become ...
Rohit Pandey's user avatar
  • 2,711
1 vote
1 answer
62 views

I am applying a zeroinfl negbin regression to my data. Specifically, my dependent variable is a count variable (centrality measure), while my independent/controls are both binary and continous. I've ...
user23757853's user avatar

1
2 3 4 5
107