Skip to main content

Questions tagged [sampling]

Creating samples from a well-specified population using a probabilistic method and/or producing random numbers from a specified distribution.

0 votes
1 answer
67 views

Consider an algorithm that generates random numbers in the range [1, 50000] with the following distribution: The specific value 12345 should have a 40% probability of being selected The remaining 60% ...
VEDANG AGRAWAL's user avatar
0 votes
1 answer
105 views

I'm currently studying enumeration algorithms and random order enumeration algorithms (enumeration results in random order) and trying to understand their downstream applications in real-world ...
Chen Pengyu's user avatar
1 vote
1 answer
91 views

Is there a way that I can space efficiently sample $k$ elements from $\mathcal{P}(\{1,2,\ldots, n\})$ without replacement? For instance, the naive approach would be as follows in Python: ...
Dair's user avatar
  • 349
1 vote
1 answer
64 views

Let $[0,100]$ denote the interval of real numbers between $0$ and $100$. Given a function $f:[0,100]^n \rightarrow \mathbb{R}^+$, I want to implement the following simple algorithm to search for the ...
EXPTIME-complete's user avatar
3 votes
1 answer
202 views

I'm looking for a data structure that would allow storing samples (in O(1)) from a data stream in a fixed-size buffer while the stream length isn't known in advance. Once the buffer size is exhausted ...
Eugene's user avatar
  • 133
3 votes
0 answers
82 views

Assume I have $n$ random variables $x$ which need to obey a set of inequality constraints that are linear and can be written as $Ax \leq 0$. Is there a method to sample effectively from these for ...
Dan's user avatar
  • 61
1 vote
0 answers
71 views

How to use importance sampling identity to obtain the Chernoff bounds as given below? Let X have moment generating function $\phi(t)= E[e^{tX}]$. Then, for any c > 0 , $P[X\geq c ]\leq e^{-tc} \phi(...
Winodd Dhamnekar's user avatar
1 vote
2 answers
156 views

I have sequence of integers $a_1, a_2, .., a_n$, let $S_a = \sum_{i=1}^{N}{a_i}$, for any $k \in (0; 1)$ I need an algorthim to that maps every $a_i$ into another integer $b_i$ with 2 requirements: $...
Andrey Godyaev's user avatar
1 vote
1 answer
72 views

I want to generate spatial scale-free networks for my project. Are there any python libraries that enable it? I read about the BA model (https://www.science.org/doi/pdf/10.1126/science.286.5439.509) ...
Criticalola's user avatar
1 vote
1 answer
209 views

Let $M$ be a collection of elements given in the form of the array such that membership of any element can be done in $O(1)$ time. Which means elements of array $M$ are $\{1,2,\cdots,n\}$ such that $1$...
Rma's user avatar
  • 163
8 votes
3 answers
2k views

Let's say we want to find the smallest positive integer x for which some property A holds. We know that such an integer exists. However, we have no knowledge about the scale of x (i.e. x could be 7 or ...
Blupper's user avatar
  • 183
1 vote
1 answer
72 views

This naïve sampling algorithm I am talking about is fairly simple: create a set for storing chosen items first, randomly select an item from the array, and examminate if it is in the set. If it isn't, ...
Stephen.W's user avatar
  • 111
2 votes
1 answer
143 views

Here's my problem: I have $N$ sets of integers $S_i$ where $|S_i| = n_i \forall i \in [1,N]$ each with non-uniform weights $W_i = \{w_{i,1}, ..., w_{i,n_i}\}$ such that $\sum_{j}{w_{i,j}} = 1$. I want ...
Montspy's user avatar
  • 23
1 vote
2 answers
164 views

I have an array $a$ with $n$ elements, all of which have an associated weight. For example: $a = \{ (A,2), (B,5), (C,9), ..., (Z,1) \}$, such that element $A$ has weight $w_A=2$, element $B$ has ...
Maltus's user avatar
  • 11
0 votes
0 answers
77 views

Context I have an array of objects (or a list of dictionaries), sorted in order based on a property of each object, say, time. In JSON, it would look something ...
Seth Lutske's user avatar

15 30 50 per page
1
2 3 4 5
8