47 questions
1
vote
2
answers
171
views
How to generate a 'glitchy' signal in the systemverilog class
Quite often I have to simulate a situation, where an input signal entering the FPGA is either heavily glitching, or just has very slow rise/fall times, which in the real design might result in ...
0
votes
1
answer
39
views
why when using random in access 2016 I am getting the 7th record always as a start?
enter image description hereI am trying to get a random record from access table but when I first start the app it is always picking record number 7. After that the random is working fine picking ...
2
votes
2
answers
98
views
How to randomize variables per group using R?
In my experiment, I want to randomize treatments.
Grain <- tibble::tibble(
Variety = rep(c("CV1", "CV2"), each = 4L),
`N rate` = rep(c("0N", "50N", "...
0
votes
0
answers
70
views
Randomized Relaxation of Complex Linear Assignment Problem
I am currently working on creating an algorithm to solve a complex assignment problem. The problem is basically as follows: there are d "sessions" each with m "sections" each with ...
2
votes
2
answers
696
views
How to randomize an object: Map<Author, List<Book>> with EasyRandom in Java?
I'm trying to randomize an object: Map<Author, List> with easyRandom for testing.
For the moment I haven't get my code to compile. So my code is something like:
MapRandomizer<Author, List<...
1
vote
1
answer
165
views
I was trying to solve Card flipping problem with randomized algorithm, but I can't get the expectation of each flip
We are given n cards. Each card has front and back side. fi denotes the front
value of a card i. bi denotes the back value of a card i. Each value of the card is a
positive integer. In initial status, ...
1
vote
2
answers
285
views
Shuffling data across rows in a table
I want to update a table to have the data shuffled around. Let's say I have a table with 5 columns. column 1 is the primary key so that'll remain unchanged. columns 2 and 3 will be shuffled to ...
1
vote
2
answers
271
views
Runtime of randomization algorithm to find majority element in an array?
This is for the leetcode problem 169. Majority Element. Given an array of numbers, where there is a guarantee that there is a number that exists in the array greater than floor(n/2), one can find such ...
-2
votes
4
answers
210
views
Creating 5 lists of the 5 same elements in different index order
I'm struggling with a problem that seems so basic and yet drives me crazy as I'm still unable to implement.
Here's the deal:
I have a list with 5 elements, for instance :
['A', 'B', 'C', 'D', 'E']
I ...
0
votes
0
answers
46
views
Random sampling: scanning and selecting in Rust [duplicate]
I'm trying to implement in Rust the scanning and selecting algorithm for random sampling.
So i want to sample m items form an input sequence S (streaming model), assuming the length of the sequence is ...
-1
votes
1
answer
934
views
ValueError: Input contains NaN, infinity or a value too large for dtype('float64') when using randomizedSearch
I am trying to use RandomizedSearchCV from sklearn on an MLPRegressor model, and I have scaled the data using standardScaler. The code for the model is presented below. When I try to run the code I ...
0
votes
3
answers
125
views
How to randomly permute elements from two lists while respecting a non-consecutive ordering constraint?
I am part of a study where subjects are given input from 4 categories (1, 2, 3, 4) and each category has 4 words (a, b, c, d). The order of the words needs to be randomized for each subject, but ...
0
votes
1
answer
641
views
How to shuffle cards - JavaScript
I'm trying to make a card matching game in JavaScript where every time the user starts the game, the cards shuffle. If they flip two of the same cards the get a point added to their score. I have the ...
0
votes
1
answer
44
views
Google Apps Script randomize certain cells function not working
I am trying to create a simple script activated via button to randomise a game names list. I want to enter 6 names under Rounds 1-13 and have them shuffle into certain cells. I am using the script ...
0
votes
1
answer
30
views
Need help on solving this Arrays problem using java
Make an array of integer (score) with 10 members. Randomize the
content with value between 0-100. For each of the member of array,
visualize the value using “-” for each ten. For example: score[0] = ...
2
votes
2
answers
118
views
how to shuffle an array except for the item in the middle?
I´m creating a Bingo board and I need that the one in the middle always stays the same even when shuffleing this array:
const bbb = [
"😋",
"😁",
"🤣",
"😃&...
-1
votes
1
answer
37
views
Attempt to randomize image generation with javascript?
I want to randomly generate images for a project, I'm sure it's something small but on run nothing is changing and I've been scratching my head for a couple of days now. Not too sure where the problem ...
0
votes
2
answers
68
views
Strange behaviour in a Dice Throwing simulation program
I have written this piece of code which is supposed to simulate throwing dice many many times and counting that how many times each face is up. I have attached the output down there and as you can see ...
1
vote
1
answer
59
views
How to randomize or shuffle only one-axis and estimate estimated correlation in R?
I am trying to create a null expectation in R. The dataset has four species and associated sample values of x.real and y.real. I want to create a null expectation by only shuffling the x.real for each ...
0
votes
1
answer
548
views
Why do I get different results with RandomizedSearchCV estimator and a new estimator created with the best parameters?
I have experienced an unexpected behaviour of with the estimator of the RandomizedSearchCV:
I am searching for the best parameter for a random forest. When I determine the accuracy with the resulting ...
1
vote
1
answer
245
views
If A is in RP and there is a polynomial time reduction from B to A then B in RP?
I think it's true because you can reduce B to A and then run the probabilistic algorithm of A and if we got a reject then it's also a reject for B and at least half of the time if the input is in A we ...
0
votes
0
answers
70
views
How to change the image of a button in tkinter
I'm trying to program buttons for a game in tkinter, which change the picture randomly. However, on the one hand I don't know how to randomize the buttons so that a random button changes its layout, ...
2
votes
2
answers
2k
views
How to insert a random element on a Anki card?
On Anki, the front of a card have "X+Y?" and the back shows "Z". For example, front "4+7?" and back "11" But I want next time that I see this card the numbers ...
3
votes
1
answer
2k
views
How can I make randomization automatic on REDCap?
I am running a survey on REDCap where participants need to be assigned to one of three groups before receiving a group-specific intervention to reduce their smartphone use (e.g., 1 - intervention one, ...
1
vote
2
answers
586
views
How to make monthly data to daily data using random techniques in R
I need to transform this monthly data to daily data by using some randomization technique, for example. Here is the dataframe:
library(dplyr)
library(lubridate)
month_year <- c(
"08-2021&...
0
votes
0
answers
45
views
How to make sure that the randomized coordinates will not fall into specific coordinates in a 2D array? The language is C
I am creating a game in C, and I want to randomly place blocks and foods inside a 2d array. I have randomized the x and y coordinates of the blocks and the food into 1d arrays, i.e. foodCol[] and ...
-1
votes
2
answers
41
views
Need an Example of randomizing a grid with characters that have varying amounts
I would like to see peoples examples of how you would randomize a grid with different values.
this is the original board
string[,] board = new string[4, 4];
for (int y = 0; y < 4; y++)
{
for (...
0
votes
1
answer
86
views
Can we optimize randomized quicksort by tail recursion?
I know we can optimize quicksort by leveraging tail recursion by removing more than 1 recursion calls and reducing it to once single recursion call:-
void quickSort(int arr[], int low, int high)
{
...
0
votes
2
answers
142
views
How to randomize without replacement with conditions?
I have a number of embedded images, which I randomize 4 times without replacement (once an image is seen, you cannot see it again). I'd like to add a condition, which suggests that a set of additional ...
1
vote
1
answer
65
views
Replace commas with spaces ? Fisher-Yates randomization
Thanks to @axtck for the help for the Fisher Yates randomization, he helped me to change number into words here :
Since the shuffle functions shuffle the arrays indexes, you can just shuffle the array ...
2
votes
2
answers
3k
views
Why is randomised quicksort considered better than standard quicksort?
In Cormen's own words - "The difference is that with the deterministic algorithm, a particular input can elicit that worst-case behavior. With the randomized algorithm, however, no input can ...
2
votes
0
answers
351
views
Communication of client/server instead returning random numbers is returning random symbols
I need to print random numbers that servers sends, but instead its printing random symbols
Its a program like lottery, that gives me 5 numbers and 2 stars
I search for solution but I didn't find any. ...
2
votes
2
answers
221
views
bipartite network Degree-preserving randomization with constraints
I am working on a sample data containing several papers, the topics they belong to, and the publication years of those papers, it looks like this:
paper_id
topic
pub_year
2031361154
0
1998
2088633475
...
1
vote
1
answer
73
views
Randomly allot values to the rows in python
I have the following input table (y):
parameter1
parameter2
1
12
2
23
3
66
4
98
5
90
6
14
7
7
8
56
9
1
I would like to randomly allot values from A1 to A9. The output table should look like the ...
2
votes
3
answers
1k
views
Block randomization using python?
I have the following input table (df):
ColumnA
ColumnB
Blocks
A
12
1
B
32
1
C
44
1
D
76
2
E
99
2
F
123
2
G
65
2
H
87
3
I
76
3
J
231
3
k
80
4
l
55
4
m
27
5
n
67
5
o
34
5
I would like to perform block ...
2
votes
3
answers
1k
views
Data structure to achieve random delete and insert where elements are weighted in [a,b]
I would like to design a data structure and algorithm such that, given an array of elements, where each element has a weight according to [a,b], I can achieve constant time insertion and deletion. The ...
1
vote
2
answers
2k
views
How to generate uniform single precision floating point random number between 0 and 1 in FPGA?
I am trying to generate single precision floating point random number using FPGA by generating number between 0 and 0x3f80000 (IEEE format for 1). But since there are more number of discreet points ...
0
votes
0
answers
28
views
Index was outside the bounds of the array with randomization function [duplicate]
So I've tried to create a randomization function for a game to randomly generate characters from an array and add the result into another however it hasn't really worked and keeps throwing an "...
1
vote
0
answers
440
views
Printing an array as an ArrayType in Pascal
This program is supposed to sort an array and fill it with random integers from 1 to 1000. It needs to find the maximum value and print the array. It should print the array in two ways: ARRAY OF ...
0
votes
1
answer
138
views
set input values in array and randomize content to display
I can't seem to find any solutions.
I want to create a form that collects 4 nicknames after submit a form and then displays them all randomly in html code using javascript
My 4 input values are now in ...
0
votes
1
answer
780
views
Matthew's Correlation Coefficient and Precision throws errors in RandomizedSearchCV
I keep getting this error:
invalid value encountered in double_scalars: mcc = cov_ytyp / np.sqrt(cov_ytyt * cov_ypyp)
Is there something wrong with how I implemented it in a custom-scorer?
...
1
vote
1
answer
315
views
normal vs randomized quicksort on an array which is 1/3 sorted
I am trying to calculate a time complexity for applying quicksort (randomized or normal) on an array with these properties:
the array is unsorted in the first 2/3 , and the largest element is t
the ...
1
vote
1
answer
35
views
Is exectution time of Skip list different after every run for same input?
I know this question is quiet trivial but I am curious to understand about what is actual impact on execution time of skip list algorithm that is randomized algorithm on time of execution.
Are they ...
0
votes
0
answers
137
views
How to use O(log n) mutually independent random bits to generate n pairwise independent random bits
We motivated this problem by “saving space”, yet then, we went ahead and stored n pairwise
independent random bits ξi
. That pretty much defeats the purpose. Show how to use O(log n)
mutually ...
0
votes
3
answers
2k
views
Select random cell in range
I'm trying to perform an action in VBA on a range of cells. I would like the selection of the cells to be random not in the order of how the range is setup.
Sub Solver_Step_Evo()
Set Rng = ...
0
votes
1
answer
81
views
Probabilistic algorithm, can a best case instance depend on the randomized parameter?
Given this probabilistic algorithm (pseudo code):
p = random(1,n) // 1/n chance for each value ranging from 1 to n
if array[0] = p
{
loop that executes in tetha(n)
}
return 0;
EDIT : possible values ...
-1
votes
1
answer
126
views
How to randomly shuffle pictures in visual basic
I am trying to create a memory game, but I cannot seem to get the pictures to shuffle around everytime I press start. Does anyone know how to help?