combinations Questions

6

I need an algorithm that return all possible combination of all characters in one string. I've tried: $langd = strlen($input); for($i = 0;$i < $langd; $i++){ $tempStrang = NULL; $tempStrang...
Grindelia asked 11/4, 2010 at 12:56

3

Solved

I have trouble solving the following problem concerning the (simplified by limiting number of columns) data frame 'annotations' below. require(irr) # data annotations <- read.table(text = "Obj1...
Youmans asked 9/11, 2016 at 21:8

10

Solved

The R function expand.grid returns all possible combination between the elements of supplied parameters. e.g. > expand.grid(c("aa", "ab", "cc"), c("aa", "ab", "cc")) Var1 Var2 1 aa aa 2 ab aa ...
Hiccup asked 18/6, 2013 at 14:11

8

i'm trying to find a combination for a sum inside a list of integers. the amount of numbers that contain the sum is limited by a variable, so for example in the list - [5,2,3,9,1], i would like t...
Autosome asked 25/10, 2013 at 20:54

11

Solved

I found a link online that shows an algorithm to generate all combinations of a string: http://www.mytechinterviews.com/combinations-of-a-string Algorithm is copied below. void combine(String ins...
Schild asked 23/1, 2012 at 0:7

3

Solved

I have a string with only three words like this: first_string <- c("self", "funny", "nymph") As you can see the words of this vector can all be put together to one...
Error asked 5/7, 2022 at 13:4

3

Solved

I have data of names within an ID number along with a number of associated values. It looks something like this: structure(list(id = c("a", "a", "b", "b"), n...
Monanthous asked 1/7, 2022 at 1:22

3

Solved

I have a vector of integers from 0-9 and need all unique possible combinations of these consecutive vector elements, including the original elements. > vec <- 0:9 > vec [1] 0 1 2 3 4 5 6 ...
Bedeck asked 30/6, 2022 at 10:41

3

Solved

Given two arrays, where array one has variables and array two contains the variable's values, I want to get all possible combinations of those two arrays, for example: String[] arr = {"E"...
Holoblastic asked 6/12, 2020 at 15:23

3

Solved

I have a set of letters with weights, which gives their probability of appearing in a string: a - 0.7 b - 0.1 c - 0.3 ... z - 0.01 As such, the word aaaa has a probability of 0.7*0.7*0.7*0.7 = 0.2...
Schooner asked 4/5, 2022 at 23:14

3

Solved

I am trying to find all possible unique combinations in R. It seems that there have been a lot of similar questions asked, but I was not able to find the same one. My question is to find combinati...
Feverous asked 29/3, 2018 at 19:18

8

Solved

How do I generate all possible combinations of a string with spaces between the characters? [in]: "foobar" [out]: ['foobar', 'f oobar', 'fo obar', 'f o obar', 'foo bar', 'f oo bar', 'fo o bar',...
Erotica asked 10/5, 2013 at 9:12

5

Solved

I would like to generate a list of combinations. I will try to simplify my problem to make it understandable. We have 3 variables : x : number of letters k : number of groups n : number of letters...
Lombok asked 31/3, 2022 at 17:44

5

Solved

..or do I have to give P.nk <- factorial(n) / factorial(n-k) or P.nk <- choose(n,k) * factorial(k) Thank you.
Daedalus asked 20/5, 2010 at 7:30

11

Solved

Given a mapping: A: 1 B: 2 C: 3 ... ... ... Z: 26 Find all possible ways a number can be represented. E.g. For an input: "121", we can represent it as: ABA [using: 1 2 1] LA [using: 12 1] AU [u...
Evoke asked 31/7, 2013 at 5:52

6

Solved

I came across this technical question while preparation. There are K cabs. ith cab takes ki minutes to complete any trip. What is the minimum time it will take to complete N trips with these K cabs...
Showthrough asked 30/9, 2019 at 18:33

5

Solved

I want to generate vectors with all possible combinations of vector elements where a consecutive multiple occurrences of an element is considered as single occurrence of that element. Simple cases ...
Doralyn asked 10/2, 2022 at 16:13

5

Solved

I have been wracking my brains out for 3 hours straight, but I still don't get it, so I am asking here. (I wrote Python in the title, but this could be for pretty much any language) Let's assume I...
Airdrie asked 20/10, 2012 at 7:21

10

Solved

I'im trying to find all combinations of items in several arrays. The number of arrays is random (this can be 2, 3, 4, 5...). The number of elements in each array is random too... For exemple, I ha...
Reformation asked 19/12, 2011 at 20:25

1

Solved

So I have matrix A A = [[0,0,1,-1] [0,0,1,-1] [0,0,1,-1] [0,0,1,-1]] And I want to have all the possible combinations with these elements. This means that rows can change between them and colu...
Adey asked 24/12, 2021 at 22:11

16

Solved

I have been searching for a source code for generating combinations using C++. I found some advanced codes for this but that is good for only specific number predefined data. Can anyone give me som...
Underlie asked 24/2, 2012 at 12:12

2

Solved

I am trying to find a more efficient solution to a combinatorics problem than the solution I have already found. Suppose I have a set of N objects (indexed 0..N-1) and wish to consider each subset ...
Kitts asked 20/10, 2021 at 12:44

2

Solved

I have a df: date category subcategory order_id product_id branch 2021-05-04 A aa 10 5 web 2021-06-04 A dd 10 2 web 2021-05-06 B aa 18 3 shop 2021-07-06 A aa 50 10 web 2021-07-06 C cc 10 15 web 202...
Nestornestorian asked 5/11, 2021 at 13:3

4

Solved

I have a dataframe of 10,000 rows that I am trying to sum all possible combinations of those rows. According to my math, that's about 50 million combinations. I'll give a small example to simplify ...
Berck asked 19/4, 2021 at 11:56

6

Solved

I have quite a tricky question where I currently cannot find an answer to: What I have is an enum with x variants like: public enum Symbol { ROCK, PAPER, SCISSORS; } This enum is supposed to be...
Chary asked 21/10, 2021 at 16:7

© 2022 - 2024 — McMap. All rights reserved.