combinations Questions
2
Solved
I want to divide array of n elements to given size subarrays with all possible combinations of elements.
For instance:
Array: {1,2,3,4} - can be n elements, 1 < n < 100. It can have duplic...
Bucovina asked 7/12, 2018 at 9:18
2
Solved
I need a predicate to return a list with all combinations of the input list, and the list result size is in the second param, the predicate would be like this
permutInListN( +inputList, +lengthLi...
Chaille asked 7/12, 2018 at 11:43
5
Solved
There are three integers x, y and z (each of them >= 1) and a given upper bound integer n < 10^6. Also, n = x + y + z and output = cos(x) + cos(y) + cos(z).
The exercise is to maximize output.
...
Ranitta asked 1/12, 2018 at 9:36
2
Solved
I'm trying to calculate the nth result for itertools.product()
test = list(product('01', repeat=3))
print(test)
desired_output = test[0]
print(desired_output)
so instead of getting:
[('0', '0'...
Proximity asked 5/12, 2018 at 6:39
0
How to implement combinations of permutation & combination in angular 2+.
Eg. we have 5 nodes. Say a,b,c,d,e. And all are arrays.
So the combination goes like -
5C2 = (5)! / (2)!*(3)! = 10.
N...
Haircut asked 30/11, 2018 at 10:22
1
Solved
Given
[
["blue", "red"],
[1, 2],
[true, false],
]
How can I get the possible combinations in javascript?:
blue, 1, true
blue, 1, false
blue, 2, true
blue, 2, false
red, 1, true
red, 1,...
Nan asked 15/11, 2018 at 6:3
6
Solved
I have several numbers in an array
var numArr = [1, 3, 5, 9];
I want to cycle through that array and multiply every unique 3 number combination as follows:
1 * 3 * 5 =
1 * 3 * 9 =
1 * 5 * 9 =...
Galata asked 30/10, 2010 at 23:12
5
Solved
I've seen a few solutions to similar problems, but they all require iteration over the number of items to be added together.
Here's my goal: from a list of numbers, find all of the combinations (w...
Heliozoan asked 9/11, 2018 at 23:26
1
Despite reading a lot of Q/A about permutation/combination: Finding All Combinations of JavaScript array values + JavaScript - Generating combinations from n arrays with m elements I have not...
Earlearla asked 19/10, 2018 at 6:1
4
Solved
I would like to find the most frequent combination of values in a data.frame.
Here's some example data:
dat <- data.frame(age=c(50,55,60,50,55),sex=c(1,1,1,0,1),bmi=c(20,25,30,20,25))
In th...
Luculent asked 2/9, 2013 at 9:46
2
Solved
I need assistance with Combinations with Repetition. Have searched all over the net and although I found a few examples I can't understand them completely. My goal is simple a function (Combination...
Parotid asked 13/9, 2014 at 14:54
7
Solved
I have a string "ECET" and I would like to create all the possible strings where I substitute one or more letters (all but the first) with "X".
So in this case my result would be:
> result
[1...
Grabowski asked 6/9, 2018 at 9:29
3
Solved
I have spent the whole day (finally) wrapping my head around a permutation algorithm in practice for an admissions application on Friday. Heap's algorithm seemed most simple and elegant to me.
he...
Faculty asked 18/12, 2014 at 4:24
1
I have to find all possible solution from given sequence of integers that is equal to given number.
for example: 1,2,3,4,5,6,7,8,9 that is equal to 100
answer: 1 + 23 - 4 + 56 + 7 + 8 + 9 = 100
My ...
Ogdon asked 29/8, 2018 at 9:1
6
I have pools of values and I would like to generate every possible unordered combination by picking from certain pools.
For example, I wanted to pick from pool 0, pool 0, and pool 1:
>>>...
Unchaste asked 14/8, 2018 at 5:47
1
Solved
How can I check whether 5 given numbers and mathematical operations (+, -, *)could be arranged to get the result of 23?
For instance:
1 1 1 1 1 –– Impossible
1 2 3 4 5 –– Possible
Specificatio...
Intemperate asked 24/2, 2018 at 20:49
2
Solved
I have a dataframe like so:
df<-structure(list(id = c("A", "A", "A", "B", "B", "C", "C", "D",
"D", "E", "E"), expertise = c("r", "python", "julia", "python",
"r", "python", "julia", "python"...
Spiritual asked 20/8, 2018 at 1:24
3
I wonder if someone can help with the following task:
What is the way to get all combinations a list can be split into sublists, when order does not matter?
Let's say I have a list of 4 items:
i...
Domel asked 19/8, 2018 at 8:28
1
Solved
Hi all, I know this question looks similar to some others but I have trawled through them extensively and can't get them to work for me.
I have 16 datasets, let's call them 1 to 16. I would like t...
Hieroglyphic asked 6/8, 2018 at 15:44
1
I have n-elements of this kind
public class Ricerca:IComparable
{
public int id;
public double Altezza;
public double lunghezza;
}
I need to calculate all the possible combination of this...
Cinchonine asked 3/8, 2018 at 8:16
4
Solved
I have a list of possibilities and a desired input:
possibles = [20, 30, 40, 50, 60, 70, 80, 100]
desired = [20, 30, 40]
I want to generate the close by lists. Example:
# Distance of 1 (i.e. 1 ...
Fletcher asked 2/7, 2018 at 9:1
5
Solved
Is there a way to speed up the combn command to get all unique combinations of 2 elements taken from a vector?
Usually this would be set up like this:
# Get latest version of data.table
library(...
Lukash asked 9/11, 2014 at 12:43
1
Solved
I have a very inefficient way of counting the combinations of N/2 items from an array of size N. What I do is sort the array to begin with and then loop through the the permutations of the array, c...
Acuate asked 20/6, 2018 at 13:14
1
Solved
For every row in my dataframe, I need to create every combination of two values of column a from a three-day sliding window ending at that row. My dataframe is like this:
import pandas as pd
df =...
Greta asked 12/6, 2018 at 19:55
3
Ok so, I have a list of lists, like the title says and I want to make combinations of k lists in which every list has different elements than the rest.
Example:
I have the following list of lists...
Septenary asked 1/6, 2018 at 6:3
© 2022 - 2024 — McMap. All rights reserved.