Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
161 views

I have a list d_n of n integers and the results Z_klm of a function fun(dk, dl, dm) for all binom(n, 3) combinations without repetition (k, l, m) out of d_n indices. Now, for all binom(n, 2) ...
Max Pierini's user avatar
  • 2,355
8 votes
3 answers
1k views

I am trying to solve the problem posed in this question. Here the OP asks that given a 15 element set, its 2^15 element power set be generated in a manner such that the elements of the power set are ...
uran42's user avatar
  • 775
2 votes
1 answer
199 views

I'm working on an Excel sheet where I have: A reference combination in cell S4, like 4,D,D,D,D,D,D,D A range of combinations in W3:AH6, where each cell contains a comma-separated string like 3,A,A,A,...
Ari Capote's user avatar
4 votes
2 answers
190 views

Let's say I have a box and there is a bunch of balls in that box. I can label each ball with a character while making sure no two balls get the same character as labels. I get a string this way. Let's ...
uran42's user avatar
  • 775
-1 votes
3 answers
359 views

I'm working on generating all possible combinations from a list of N elements, regardless of the number of elements in the resultant combinations. This is basically the power set without the empty ...
Greg Blair's user avatar
1 vote
2 answers
122 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
-1 votes
1 answer
200 views

What is a scalable way to count the number of n-digit numbers (in mixed radix) that meet a list of different digit criteria? For example, what are the 4 digit numbers that have any of these patterns ...
smichr's user avatar
  • 19.6k
0 votes
1 answer
65 views

In Mathematica I implemented this simple code: n = 8; a0 = Range[0, n - 1]; a1 = Subsets[a0, {2}]; a2 = Subsets[a1, {2}]; a3 = Select[a2, Length[Union[Flatten[#]]] == 4 &]; a4 = Subsets[a3, {n/4}];...
user avatar
3 votes
1 answer
121 views

I have a numpy array of floats and a target sum. I am trying to find all possible combinations of elements that would add up to the target sum. I am struggling to come up with anything computationally ...
Ramon Martin's user avatar
0 votes
1 answer
67 views

Here is my column enter image description here I am looking for a formula to get all combinations separated by "/" Example: SE/XE SE/SX SE/EX XE/EX SE/XE/EX and so on I have so far been able ...
Phani Kalakonda's user avatar
2 votes
1 answer
191 views

Input: a list of m prime numbers (with possible repetition), and integers n and t. Output: all sets of n numbers, where each set is formed by partitioning the input into n parts, and taking the ...
theozh's user avatar
  • 27.3k
5 votes
3 answers
203 views

I have a pandas dataframe which looks like this: 1_2 1_3 1_4 2_3 2_4 3_4 1 5 2 8 2 2 4 3 4 5 8 5 8 8 8 9 3 3 4 3 4 4 8 3 8 0 7 4 2 2 where the ...
Ishigami's user avatar
  • 592
1 vote
1 answer
140 views

The formula below produces permutations of the digits in the array cols - in this case 1 to 6. The perms variable outputs a 2d array of the permutations without repetitions. However, I want to get ...
Ne Mo's user avatar
  • 284
3 votes
2 answers
149 views

The problem is to check if it is possible to get a given targetSum from the elements of a given array. Each element should be included once only (if included). The code is a brute force approach using ...
jack's user avatar
  • 41
1 vote
0 answers
75 views

I'm using python itertools specifically to generate combinations of integer strings. I have already created the loop that will loop through the combinations one at a time. I just need someone to help ...
user27394478's user avatar
-1 votes
2 answers
92 views

Find combinations of 2 different numbers in a list (In python) Input: 1st line: n (length of array) 2nd line: array (the array) ex:(1 7 1) Output: Numbers of combinations of 2 numbers in a list ...
Bá Đình Phạm's user avatar
0 votes
0 answers
43 views

I have an array like this: matrix = [ ['A', 'B', 'C'], ['D'], ['E', 'F'], ['G', 'H'] ] And I need to choose a value from each row in such a way as to get this output ADEG, ADEH, ADFG, ADFH, ...
davo36's user avatar
  • 724
0 votes
2 answers
176 views

I do not know enough about M in PowerQuery to work out how to solve the below. The example is, I have an excel range of over 300 rows, each with 12 columns that may contain strings of meta-data (these ...
user29032702's user avatar
1 vote
1 answer
109 views

A B C D E Key 1 1 -1 Key 2 1 -1 Key 3 1 -1 Key 4 -1 1 Key 5 1 -1 Key 6 1 -1 Key 7 1 -1 Key 8 1 -2 1 Final Result A B C D E 1 -1 suppose we have the above dataframe where each key is an option ...
ChairmanMeow's user avatar
0 votes
1 answer
169 views

I need an assistant with implementing the following question in Python; There is a given list:nums = [1, 1, 4, 2, 3, 3, 2, 5] The request is to write a Python code which gets the maximum number of ...
ollie 's user avatar
  • 19
1 vote
3 answers
85 views

I'm trying to count the number of occurrences of combinations across two variables in a data frame in R. If I have the following dataframe: df <- data.frame(v1 = c("A", "A", &...
decamaramp's user avatar
-2 votes
2 answers
80 views

When running the code below, python aborts and closes the python prompt: >>> import itertools >>> nComb = 2 >>> t = range(nComb) >>> combs = list(itertools.product(...
Memória de Cálculo's user avatar
0 votes
1 answer
119 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
3 votes
6 answers
172 views

I have a list of number-letter pairs like: all_edges_array = [ [1,'a'],[1,'b'],[1,'c'], [2,'c'],[2,'d'], [3,'b'],[3,'c'] ] ...
StrayByteIncarnate's user avatar
0 votes
2 answers
94 views

Let's say I have n dictionaries of different sizes, dictA, ..., dictN (n may be as great as 18). They all have strings as their keys and positive numbers as their values. What I need is a dictionary ...
SD_'s user avatar
  • 11
1 vote
3 answers
115 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,985
1 vote
1 answer
78 views

Given a 2D array of size (W,H), for example (3,4). You can think of each point in that 2D array as a corner of a rectangular patch. I want to divide that array up into its individual patches as shown ...
KyroHere's user avatar
1 vote
3 answers
154 views

I have this data. Lots of people share the same id, but have different details about themselves recorded (name and month are often different). data.frame( id = c("a", "a", "...
fe108's user avatar
  • 531
4 votes
1 answer
69 views

Given a 4D array of size (N,W,H,3), where N is the number of patches, W,H are the width and height of an image patch and 3 is the number of color channels. Assume that these patches were generated by ...
KyroHere's user avatar
1 vote
2 answers
72 views

Due to a memory problem I have decided to download information from EMODnetWCS by rectangles and then merge them. library(EMODnetWCS) ### Script for downloading information from https://github.com/...
adrianmnc's user avatar
-1 votes
1 answer
190 views

Unable to generate desired combination 2 and combination 5 Current OutPut Combination 1: Rutgers (93), Baylor (93), Orlando (96), Dublin (96), Spokane (96) Combination 2: Rutgers (89), Baylor (90), ...
Ravi's user avatar
  • 1
0 votes
0 answers
82 views

Unfortunately this is my first openmp attempt. I have a very rough code, that started out as a proof of concept attempt and has yet to be polished (with 50 grit). I have a container of items and ...
nate's user avatar
  • 281
0 votes
1 answer
70 views

I have a script in python that allows me to get the index that a string is on based on the order of the iterables. It's a short script so I want to be able to use a custom order like a completely ...
user avatar
-1 votes
1 answer
1k views

By default, there is no discount input field on the cart page. I attempted to add a custom input form with the action set to "/discount/YOUR_CODE". However, when I try to apply two different ...
Min05's user avatar
  • 27
1 vote
1 answer
121 views

Assume that I want to assign a color to 5 different balls and have 3 colors r,b and g. I would like to iterate over all these combinations. Preferably I would want to omit combinations that are equal ...
Trailblazer's user avatar
3 votes
2 answers
132 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
2 votes
2 answers
195 views

My input is a list of dicts that correspond to tasks : tasks = [ {'ID': 'ID_001', 'VOLUME': 50, 'STATUS': 'ENDED_OK'}, {'ID': 'ID_002', 'VOLUME': 10, 'STATUS': 'WAITING'}, {'ID': 'ID_003',...
VERBOSE's user avatar
  • 1,085
-1 votes
4 answers
186 views

Is there a way or apache utils function to split a BigDecimal number into random n smaller BigDecimals. I am looking to have this function for creating test data various combinations for a provided ...
dude_in_london's user avatar
0 votes
2 answers
89 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
1 vote
0 answers
65 views

This might be quite a challenging question, so any help is a appreciated. I want to enumerate in a sensible way all bosonic states of n=1,2,...,N particles in L sites with maximal occupation per site ...
Paolo Molignini's user avatar
0 votes
1 answer
56 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
0 votes
1 answer
92 views

I have used Florian's answer to this question to get the unique pairs separately for the one shared (grouping) variable. Can this be extended to the case where there are two grouping variables, and ...
Michelle's user avatar
  • 1,403
1 vote
0 answers
63 views

I have a list made of strings which are not in sorted order. I wish to generate combinations but in such a way that the order of the elements is as in the list. However, Python documentation and its ...
Quiescent's user avatar
  • 1,196
4 votes
1 answer
91 views

I've a dataframe and need to group by two columns from all possible combinations of dataframe columns ['A','B','C','D','E','F','G'] import pandas as pd d = {'A': [0,1,1,0,0,1,0,0], 'B': [1,1,0,0,...
black cat's user avatar
0 votes
4 answers
90 views

I have something like this: {'event1': [2000, 3000, 4000], 'event2': [123, 456]} but with N keys, not only two like the example I need to get something like this: [ {'event1': 2000, 'event2': 123}, {'...
Lomiz's user avatar
  • 9
0 votes
3 answers
141 views

I need to make a list of pairs from several other lists. The pairs will consist of a value from the same position in each list. There could be a varying number of lists, but each list will have the ...
Radie's user avatar
  • 45
1 vote
1 answer
82 views

I'm trying to solve the following problem. I have a set of logical operations and I would like to resolve them into all possible combinations. For example: "((A | X) & B & C) | (C | E) &...
himself's user avatar
  • 88
0 votes
2 answers
105 views

def combination(n,k): combi=[] def backtrack(start,comb): print(comb) if len(comb)==k: combi.append(comb.copy()) return for ...
data_geek's user avatar
-2 votes
1 answer
76 views

My code is working perfectly : const i=['a','e','i','o','u']; let q=[]; for(let t=0,l=i.length;t<l;++t) { for(let e=t+1,l=i.length;e<l;++e) { for(let z=e+1,l=i.length;z<l;++z)...
Hezi-Gangina's user avatar
3 votes
1 answer
112 views

Context: In the multinomial expansion, the valid indices [k1, k2, ... kr] for each term fulfill the equation n = k1 + k2 + ... + kr. Given r and n, I'm trying to iterate over all terms. For that, I ...
haifisch123's user avatar

1
2 3 4 5
130