# Random Questions

## How to calculate the sum of 2 sets created by two group datas from a random number generator?

I am trying to make a programming assignment in my school that requires me to create a dice game in c where the winner is determined based on

## Problem with continue instruction after rand() function

I just wanted to solve an exercise that asks me to write a routine to generate a set of even random numbers between 2 to 10. the problem is

## Random number generator with corresponding letter

I have 2 circuits, both made up of a dual seven segment display and a pic16f684 (as shown below) the first circuit uses the code supplied to

## I want to display random images in background but the code is not working

It just displays a blank background, with nothing in it. i have tried the code below, saw this on stackoverflow only, but cannot seem to get it to

## Paginate through a randomized list of blog posts using will_paginate

I want to give users the ability to page through my blog posts in random order. i can't implement it like this: @posts =

## How to detect which random did I chose from only one list with random.choice()?

How can i detect which random number has been chosen from the list? list = [3, 7, 5, 6, 3, 4, 1, 6] random = random.choice(list)

## How to add random action to Python?

I've been coding an adventure game in python myself and through youtube and stuff i found online, but i want to add a part where you gotta get on

## Setting a seed for numpy uniform doesn't result in the same probabilities

Why doesn't the below shown code result in 3 arrays with the same probabilities? how can i generate reproducible probabilities?

## What could cause Math.random() to generate the same "random" number on every page reload?

I'm making an electron app and in the renderer process i have a method that calls math.random(). just a simple return

## a question about "randoms and my question"

Example: import random random.seed(10) n1=random.randint(1,5) n2=random.randint(1,5) print(n1,n2) # => 5,1 i

## Haskell RSA crypto random generator type

My goal is to generate a keypair using generatekeypair from codec.crypto.rsa. this function requires a generator

## How to fix print is not working in python with the random lib

I am creating a rock, paper, scissor game i just try the random lib but this what happens c:\users\timothy\desktop>python

## Generate text from a given template

For example i have a string such as text = '{hello|good morning|hi}{. we|, we} have a {good |best }offer for you.'

## How to generate unique random numbers from a list

I know that i should write a code to random numbers like the code below, but i don't know how to generate unique numbers, for example i want to

## Generate copula-correlated samples with specified marginals in Python

I have n random variables (x1,...,xn) each of which is distributed over a specific marginal (normal, log-normal, poisson...) and i want to

## Generate Random Json data using Python and store in a varaible

My app takes json in this format. how to use for loop to generate data in the mentioned format below, and store it in a variable?

## Random item from the array without repeating elements in Javascript

I don't want the function to repeat elements taken from the array function gen() { let qu = ["yazeed", "ammar", "marwan",

## Reverse an array containing random numbers. How?

My assignment is to create an array with random numbers and then reverse the order in c#. i managed to generate the random array, but

## How do I generate random string array urls without repeating?

I am trying to generate random string array urls in picasso, everything is working fine but it repeats, like i had 28 string array items when i

## Get random sample of items from array, where items (which are also arrays) have things totaling to X

In an array such as: const mylist = [['hi'], ['hello', 'bye'], ['ok'], ['blue', 'green',

## Randomnly select numbers from a list with a condition

I have a list(range(30000)). i need to randomnly select numbers inside it such that, it takes a certain count of numbers say

## How could I fill my second list with zero and one according to the conditions below?

I have a list containing multiple lists. it's full of random numbers between 0 and 1. i need to create another list with the same size of the

## Converting a pandas Interval into a string (and back again)

I'm relatively new to python and am trying to get some data prepped to train a randomforest. for various reasons, we want the data to be

## IndexError when using secrets.choice from dictionary

I have a dictionary of providers, which will contain elements like the one below: { 'p_4_0_0': {'technicians':

## generate more than one random code in laravel and save it to database

I'm a newbie in laravel. i have to generate multiple random characters at once in my laravel project and then save them to database. any example

## Can't get stable result with copying random values from array to an object

So i'm in process of creating a bot for a tournament and i got stuck on the part where i want to split players in pairs for play-off-style

## Need help making my input make a random selection

I need to to figure out how much the viewer spent watching one of the items in my dictionary. first i need to allow them to input how many

## How do i output the probability of a single prediction being correct?

I am using random forest classifier on titanic dataset. instead of outputting whether a passenger survives or not, i would instead like to output

## How to use time-series data in classification in sklearn

I have a time-series dataset as follows where i record 2 time-series for each of my sensors. the label column depicts if the sensor

## Divide a number n into x random parts such that sum of x parts is equal to number n

Here n is the number, p is number of parts: let n = 100; let p = 11; let obj = []; console.log(math.round(n/p)) while (p != 0){

## How to build a deterministic random plot

I have this interesting problem, a simple but (apparently) not easy one: my server is serving a json containing a random plot, in the

## Linear congruential generator - how to choose seeds and statistical tests

I need to do a linear congruential generator that will successfully pass the selected statistical tests. my question is: how to choose

## How to display tasks that are not "checked" on the other screen?

I am looking at my code and wondering for 2 hours now without luck so i will ask for help here. i have a button, when i press it, it

## How to create a random Number Genertor in Flutter?

I wanted to know how i can create a random number generator. but not the usual, i want to build the following: in the app there

## Flutter random Image.asset changes on hovering Button?

I want to show a random picture everytime the user enters the page. i also have a button (the red container with hovering) on this page, and when

## How to get a random value from a string array without repetition?

How to get a random value from a string array in android without repetition? i have array in string.xml file as below -

## How to continuously update the value of a tensor in a loop

So i am trying to continuously update a tensor in my code in a loop by assigning it with a new value in each iteration. genrandmat function

## How to add a random value to many rows in a Pandas Dataframe iteratively?

Suppose i have a pandas dataframe named df, which has the following structure:- column 1 column 2 .........

## How can I take random variables from Array in flutter

I am new to flutter. i have one string array and it has 20 values. however, i want to take 12 random values from this array and create a new array

## Are seeded random numbers not consistent between python versions?

Question: why are seeded random outputs seemingly different across python versions? have i missed something obvious, is it a documented

## How To Random Select A String From List After Tabbing Button

I would like to press a button and pick a random string from my list to display somewhere on the screen. currently, the convotopic variable

## How To Display a Random Item of a List? [Every 9 seconds]

Is there a way to display a randomquote every 9 seconds automatically? below is a truncated portion of the code that matters:

## Selecting a random amount of elements from array in javascript

I have 2 arrays with 4 x-coordinates in each. in total i want to select 3 random values from both arrays. so array1+array2 =3 elements. in the end

## Randomness of Python's random

I'm using python to generate images using dashed lines for stippling. the period of the dashing is constant, what changes is dash/space ratio.

## How to split a set of strings into substrings in Python, making shorter substrings more likely?

I have a set of strings which are some millions of characters each. i want to split them into substrings of random length, and this i can do with

## How to compile a numba jit'ed function with variable input type?

Say i have a function that can accept both an int or a none type as an input argument import numba as nb

## create unique 8 digit number

I am creating an application at the moment that needs to give the user a unique 8 digit code (numbers only) that they can enter to access

## How to select random object from array with React Hooks?

I don't know why my function not working. i won't to display random citites from array? but if i click button then show me error

## Order by random a list of div elements with JS

I have a category that contains more than 200 newsitems, on the homepage i display the last 20 newsitems. <div

## Assign random values equally to pandas dataframe

I have pandas dataframe, say df which looks like region id a 111 a 222 a 333 a 444 b 555 b

## Run a random algorithm mutiple times and average over the results

I have the following random selection script: import random length_of_list = 200 my_list = list(range(length_of_list))

## Flutter Firestore update Documents

I have an app where the user can buy tickets. and in firestore the tickets are represented by documents so each ticket has it's own document. what

## Upload multiple files at the same time without a duplicate in Laravel

I use this code to upload multiple files together in laravel. however, all name files get duplicated. please guide me.

## How to send turtle to random position?

I have been trying to use goto() to send turtles to a random position but i get an error when running the program. i am lost

## How to implement feature selection for categorical variables?

I'm having a problem selecting the important feature. the features for the dataset are categorical and numerical. the target variable is false or

## random to produce duplicated elements

When working with random module in [1]: from random import *

## How to Return a Random Number in an HTTP Call in Firebase Cloud Functions?

My code is this but it doesnt work; const functions = require('firebase-functions'); exports.randomnumber =

## Why does random.uniform(0, float("inf")) always return inf?

I was playing around with the random module in python and i found that this code always returns inf:

## How to use random.seed with random.randn?

I can seed an intenteger random number generator by doing: import random random.seed(9002) random.randint(1, 10)

## How I can check if a string is likely to be generated by a bot?

I have spam issue. some bot (i believe) is getting around google recaptcha and inserting strings like the following into forms on my site:

## Generating a list of random numbers, summing to a fixed amount using SQL

This question is about generating n random numbers whose sum is m(constant) using sql. for example we have a number m=9.754. we need 10

## Conditional sampling by group based on sample mean

I am trying to use r to make a bunch of different trivia quizzes. i have a large dataset (quiz_df) containing numerous questions divided into

## How can we generate Random Salt of 32 bytes in Rhino JS

I am trying to generate a random salt of 32 bytes size. but my js engine rhino 1.7.13 doesn't support securerandom class. below is the code

## Python: Get 6 random numbers with minimum difference

I'm trying to get 6 random generated numbers between 1 and 3600. but i want that the the individual numbers to have a minimum difference of at

## How to Convert Number into Signs (Math) in Python

I am trying to make math quiz that asking with two random numbers (1, 10) with randomly choice with sum, difference or product. i used z =

## Display a row of random pictures in browser from an array using javascript

I want to display 6 pictures in a row. eventually i want to click the picture and have it display full screen like imdb. first though i need to

## Randomly display and store without repeating stored value

I'm struggling to get my code to work. i have a large list of fruits stored on my pc. any time i run the program, i want the program to

## how to change Textview text with button

I have one textview and one button ,i coud change textview text with below code : final textview c_tv_matn; button c_btn_dokme;

## Flutter : how to show next index after complete a specific logic in Swiper, where GridView also set in Swiper?

I'm trying to make a word game. first of all, the index will be white. if user click the correct answer then index will be to green color and go

## How do I return a number of random numbers from this string?

I have converted my string, just_numbers, to an array format with: system.out.println("just_numbers" +

## ValueError: Unknown label type: 'unknown' in RandomForestClassifier

I'm trying to train dataset using randomforestclassifier transformer = tfidfvectorizer(lowercase=true, stop_words=stop,

## How can I update a variable to display some text, have a delay, then update another variable also displaying text?

I'm currently trying to create an app with flutter that helps a user memorize french vocabulary. i want the user to be able to click a button to

## Do a random action after clicking on Flutter

Hello i am new to flutter, i want to program a button which after i click it does a random "void" action. does anybody has an

## how to get prediction from trained random forest model?

I have a dataset with two columns user posts (posts) and personality type (type) , i need personality type according to posts using this dataset

## Random Sample of N Distinct Permutations of a List

Suppose i have a python list of arbitrary length k. now, suppose i would like a random sample of n , (where n <= k!)

## What are use cases to hand over different numbers in random.seed( 0 )

What are use cases to hand over different numbers in random.seed(0)? import random

## Strange numpy random shuffle and seed

I have a question about random of numpy, especially shuffle and seed. 'seed' is used for generating a same random sequence.

## how to get listview button to go to random route onTap

I am trying to use solution from here how

## How to use the constant outcome of a random formed function in python

Let's look at the example blow import numpy as np def test2(t): ran=np.random.randint(5) return

## Cross Platform Random Reproducibility

I need to use a random function, but also have it repeating on different devices (pc / ios / android). i'm running this sample code, to shuffle a

## Select a random file from a directory and send it (Python, MIME)

I am working on a python program that randomly selects a file from a directory and then sends it to you using the email.mimemodule. i

## Delete 90% of random rows by condition pandas

I have a pandas dataframe and want to delete 90% of data which satisfies condition. the condition is very simple. if the value of the

## random loop with jquery on Json data using forEach

I have this code that shows all the images that are in a json file. any way to show only 1 image and randomly with the ones in the .json? i

## Function not returning random integer for variable

I have a very simple problem, when i run the following code: from random import randint def create_random(): x =

## Faster alternatives to using numpy.random.choice in Python?

My goal is to generate a large 2d array in python where each number is either a 0 or 1. to do this, i created a nested for-loop as shown

## Random generator using stack data structure

Class stack: def __init__(self): self.container = [] def isempty(self): return self.size() == 0

## how to display random number in flutter

I need to display a random number in flutter using a function, but when i call it i get error. void generaterandomnumber() {

## JavaScript not randomly selecting names from the specific array list

I am making a random name picker (not a generator), and when i put alex in the textbox it should pick a random name from

## How can I display images from a folder in random order with javascript?

What i want is simple, to have a new image display everytime i refresh the page, that is working right now, my problem is selecting those images,

## storing the name AND value of a numeric object in a data frame

I randomly sample values from the first row of matrix a: #1 2 3 4 5 6 7 8

## Randomly change/mutate one value in a list

I'm writing a genetic algorithm and want to randomly mutate a number within a list. if i had a list, for example:

## Python 3: AttributeError: 'int' object has no attribute 'choice'

Trying to run this python 3 program but it seems it can't run past the first loop. import webbrowser import time import random

## How to get random number list, with fixed sum and size

How to get random number list by give size, and expectd sum, fully support i hava a code

## shuffling all elements between given two elements

I know how to shuffle a list of elements. but hos should i do if i want to shuffle all the elements between two specific elements.

## count zero occurrences by choosing randomly

I have following list with some values, which i retrieved from a json file: def read_json(object): categories_list = []

## Python random.choice same output

I'm trying to random some strings in a variable, mytest = random.choice(["test1","test2","test3"]) print(mytest) print(mytets)

## How do I randomly shuffle an array, containing strings of names?

Have been stuck on this for some time now. working on react project for table tennis game generator. struggling to find a solution to randomly

## Random number generation in python

Is this a valid way to generate n random bytes that are cryptographically random? def