Questions tagged [random-numbers]

about the production of document elements involving the creation of random numbers. Affiliated tags could be {tikz-pgf}, {tables}, {letter}, {fonts}.

Filter by
Sorted by
Tagged with
4 votes
1 answer
95 views

How to include EPS in LuaLaTeX multiple times and have the postscript code run each time?

Ahoj, I have an .eps file that does some random number calculations in order to look different on each execution. Now I want to include it into a LuaLaTeX document several times, and each time it is ...
Golar Ramblar's user avatar
4 votes
1 answer
106 views

Dynamically generate values in matrix and calculate using them

I am using the following code to generate a matrix filled with random values. I would like to use this matrix to explain how a convolution is applied to an image (specifically the mean), so that's ...
Dexterous's user avatar
5 votes
1 answer
237 views

Access cryptographic secure random generator

I am writing my Master's Thesis in cryptography at the moment. The main part deals with randomness; therefore, I wanted to make a little Tikz picture in the introduction to show an example of ...
Titanlord's user avatar
  • 521
0 votes
2 answers
110 views

How to type cancel to with a line not an arrow

I want to use cancel to but with just a line instead of an arrow
Mahmoud Tabasi's user avatar
1 vote
0 answers
49 views

Random numbers and further usage

I am designing random excercise sheets for my students. I'm able to get random numbers without repetition using the code from Random number without repetition in an \includegraphics. Now I want to use ...
nurmiUBT's user avatar
0 votes
2 answers
181 views

Random generator for exam class in Physics or Chemistry

I would like to create a exam class such as: I could include random generator of both numbers and units for conversion factors in physics and chemistry. In particular, what I wish is a pseudorandom ...
riemannium's user avatar
1 vote
1 answer
42 views

Overriding nimsticks package not working as desired

nimsticks is a package that makes drawing nim games easier. For example \nimgame{5,3,4} generates three piles of 5,3,4 sticks respectively. \documentclass{article} \usepackage[utf8]{inputenc} \...
stank2196's user avatar
1 vote
1 answer
137 views

creating random numbers in a tikz diagram for use in a formula

I would like to create a worksheet similar to this https://pastebin.com/fSuS4C9f but for circumferences of circles not to bothered about the answers section at the moment but I can't even get the ...
Paul A's user avatar
  • 681
0 votes
1 answer
170 views

A printing quarry

I know this is not a type setting issue, but if anybody could help with directing me to a site that could help or advise me what type of language I need to learn in order for me to do what I want...I ...
Paul A's user avatar
  • 681
1 vote
2 answers
32 views

How to stop Beamer \only overlay regenerating random parameters on parts of frame previously rendered

I have some lcg randomisation in a frame that uses \only. My problem is that the multiple PDF pages that are supposed to make the parts of the frame look like they are slowly appearing next to what ...
Peter Rowlett's user avatar
0 votes
2 answers
158 views

specify a range using random numbers

I am using the following code to illustrate double angle theorem and although it works some of the time, I world like a method to define the random numbers so it always takes the form, as shown in the ...
Paul A's user avatar
  • 681
0 votes
0 answers
286 views

Worksheet generator with random numbers

I would like to implement a worksheet generator in Latex with the following features: It should contain commands to generate addition, subtraction, multiplication and division exercises with random ...
nrf52840's user avatar
2 votes
1 answer
246 views

How to set specific seed for random number generator in expl3 for use with xfp

I am using the xfp package to generate some random numbers, and am trying to figure out how to specify a specific random seed for the pseudo random number generator (so it gives the same results ...
Bob's user avatar
  • 125
5 votes
2 answers
327 views

Evaluating expressions using xfp

I want to generate two integer random numbers for the radius (r) and heigth (h) of a cilinder, in a certain question of my exam. I am using the package xfp to generate the random numbers. However, I ...
Angelo Aliano Filho's user avatar
3 votes
3 answers
285 views

Can a PDFLaTeX file contain a random number based on the end user?

Suppose I want to design a math exam to be posted as a single PDF file, for example one asking students to solve $ax^2+bx+c=0$. But I want each student who gets the PDF file to see a different set of $...
Maesumi's user avatar
  • 8,917
4 votes
1 answer
451 views

Random seed each compilation in XeLaTeX

I've found two answers for ``How to get a new PGF seed each compilation?'' 1 2, and they work wonderfully on PdfLaTeX. However, neither of the methods work on XeLaTeX. I get the error ! Undefined ...
Imp54's user avatar
  • 83
0 votes
2 answers
135 views

Plot a random parabola via standard form and rewrite in expanded form

I have another question in regards to using expl3. I am trying to generate a random parabola and then print a rewritten form of that generated equation. I have a \NewDocumentCommand named \parabola. I ...
David G.'s user avatar
  • 201
4 votes
1 answer
220 views

Sorting a list of randomly generated numbers

This is a part two of a question I asked a few days ago and was answered rather spectacularly by user egreg, which you can find here. I'm now looking to take part of the LaTeX provided to me, and ...
David G.'s user avatar
  • 201
1 vote
4 answers
324 views

Using an alias / variable as an input for a newcommand

I am currently trying to set up a conditional statement that takes a randomly assigned integer, and provides a specific output depending on if the integer is odd or even. I've written this so far \...
David G.'s user avatar
  • 201
1 vote
1 answer
56 views

Randomly order document content at view-time

In economics, author order is traditionally alphabetical. Due to the known bias induced by this ordering, there is small movement to randomly order a paper's authors (example). I can order document ...
kyle's user avatar
  • 449
3 votes
2 answers
301 views

Random numbers and if statements

I want to produce a random number and with this check an if statement. But it does not work. I tried the following: \documentclass{minimal} \usepackage[first=0, last=1]{lcg} \newcommand{\random}{\rand\...
Timo's user avatar
  • 31
1 vote
2 answers
116 views

Obtain a table of non-uniformly-distributed random 0 and 1 draws

I wish to produce a n x m matrix of randomly-drawn 0s and 1s, in which draws are fresh with each compilation. So far, I have achieved this with the following code for a 15 x 10 table. However, 0s and ...
monkey-dart's user avatar
2 votes
1 answer
134 views

Setting variables to random numbers for pgfplots

In the declare function scope, I am trying to set randomized numbers to variables, as shown in the code: \documentclass[12pt]{article} \usepackage{pgfplots} \usepackage{float} \pgfplotsset{compat=1.17}...
Superman's user avatar
  • 1,571
0 votes
1 answer
821 views

Fresh Numbering for theorems and Lemma in new chapter [duplicate]

I am building a report document. I want to start the numbering of lemmas and theorem with 1 in every new chapter. For example, I have 3 Lemmas and 2 theorems in Chapter number 1. Now, in chapter 2 I ...
Kumar's user avatar
  • 107
1 vote
1 answer
201 views

Saving Random Numbers in xsim for Solutions

I'm trying to create exercise sheets with random numbers and xsim. Each time I generate random numbers, though, the variables are overwritten to create new exercises (desired), but also overwritten so ...
WeCanLearnAnything's user avatar
3 votes
1 answer
97 views

TikZ: "escaping" random path

On page 1024 of the PGF manual there is a small code to draw random paths which are "contained", or which don't escape too far from their starting points. I copied part of the code to draw that sort ...
mathbekunkus's user avatar
  • 1,379
0 votes
1 answer
86 views

How do random numbers in expl3 Syntax work?

This is a follow-up to a prior question of mine. The same device is used in a number of other randomness-related questions here though. What exactly is the source of (pseudo)randomness when writing ...
shuhalo's user avatar
  • 2,485
3 votes
2 answers
424 views

Tikz: Randomly drop connections in neural network

I used Tikz to draw a full connected neural network. Now I would like to drop randomly a certain proportion of arrows. How can I do that and is it possible to use my code for that? Here is my code and ...
Gilfoyle's user avatar
  • 1,205
1 vote
2 answers
127 views

Random number generator for case distinctions

I would like to compile a snippet of code using a random case distinction. How can I implement that? No-LaTeX pseudocode: x = rand(1,4) // random number between 1 and 4 if( x == 1 ) Let us talk ...
shuhalo's user avatar
  • 2,485
7 votes
2 answers
361 views

Modeling randomly generated inscribed triangles

The problem I am modeling: Three points are randomly chosen on a circle. What is the probability that the triangle formed by these three points contains the center of the circle? Conceptual ...
Logan Weinert's user avatar
7 votes
2 answers
341 views

How to pass multiple random numbers (generated using lcg package) to a macro?

Inspired from this answer I would like to generate a multi-digit addend using some random numbers. I can generate the random numbers, but I'm unable to use them properly (Tex capacity exceeded). Here ...
lAtExFaN's user avatar
  • 1,151
0 votes
1 answer
115 views

Number section-LaTex

How Can I change the format number section, subsection, and subsubsection? The document put: Section (I.) Subsection (I.1) Subsubsection (I.1.1) But... I want: Section (I.) Subsection (1.1) ...
Josest CO's user avatar
3 votes
2 answers
621 views

How can I assign unique numbers, or a sequence, in LaTeX?

I'm trying to make flashcards to export to Anki, a flashcard program. I'm using the following link: http://reh.math.uni-duesseldorf.de/~zibrowius/LatexNoteImporter/ I'd like to assign each card with ...
electriclady's user avatar
2 votes
2 answers
116 views

switch string/commands based on "random" values to produce random cards

Update Or is there a way to generate random number between 1 and 52 using lcg package, then associate it to one of the 52 cards from the pst-poker package. Which might be easier to achieve? OP ...
CasperYC's user avatar
  • 649
2 votes
2 answers
233 views

tabular environment with random positions

I would like to simulate a simple random cloud of letters using a custom tabular environment, like this: \documentclass{article} \usepackage{lcg} \begin{document} \reinitrand[first=12,last=20,...
e_moro's user avatar
  • 878
8 votes
4 answers
7k views

How to get a random number within a range?

How can I return a random number within a range? Here is a minimal (non-)working example of what I'm after: \documentclass{article} \newcommand{\thecmd}[1]{ % todo, set a to: #1-(#1/4) % todo, set ...
Justapigeon's user avatar
1 vote
2 answers
879 views

How to create a subtraction worksheet with random numbers in each question?

I would like to create a worksheet which looks like the following: Here instead of manually typing every question, I would like to create random questions, where the subtrahend is from a set of ...
Zuriel's user avatar
  • 846
1 vote
0 answers
81 views

randomizer/anti-cheating question generator [duplicate]

It is a rather common practice that teachers prepare multiple versions of a test for the same exam in order to reduce cheating. Can \LaTeX do this? I want to design a math test with a set of ...
Maesumi's user avatar
  • 8,917
1 vote
0 answers
259 views

creating random question paper using probsoln package

I have written code for generating random questions using Probson package. The only problem I face is that It shows the same output again and again when I run the Program. What I want is whenver I ...
user157012's user avatar
1 vote
1 answer
95 views

Evenly distributed random non-stops

I am trying again to recreate some strange images. I am trying to generate hexagons of nonstop with three colors. The distribution of these three should be Color 1 = (N-1)^2 Color 2 = (N-1)*N Color 3 ...
N3buchadnezzar's user avatar
2 votes
2 answers
244 views

How to randomize entries of a table?

Consider the following code. Is such a randomization possible? I have many different tables where the number of letters may vary from table to table. However, within each table, the letters correspond ...
PaulS's user avatar
  • 461
4 votes
1 answer
1k views

Random Numbers and Variables in Latex

Below is my MWE. I understand the gist of tikz and foreachs, but when it comes to variables I don't understand most yet. I want an arrow pointing from each cell to a module, and them from the module ...
Rhynden's user avatar
  • 225
3 votes
2 answers
529 views

Add a randomly generated number to a latex document to discourage cheating on an exam

I am trying to cut down on a particular kind of cheating during my in-class exams. What some students are doing is taking pictures of the exam (while I am looking somewhere else), and uploading them ...
levitopher's user avatar
18 votes
2 answers
2k views

Drawing a constant randomly distorted circle

I am trying to draw a special and contradictive plot : A circle with random distortions which have to remain constant regardless of how many times I build the document. An example of what I am trying ...
Thanos's user avatar
  • 12.3k
2 votes
2 answers
583 views

How can I duplicate a random number in two places on the same page in a latex editor?

I am trying to create a mental math practice sheet generator in a latex editor. For the number of questions intended, I require only half of A4 sheet. So the other half I want to print the same set of ...
rhlchd's user avatar
  • 21
2 votes
1 answer
484 views

Least common multiple of many numbers

I need to make visualization like this: In this case we have 3 numbers I need to make it with 2 or 3. It will be very good if it looks like this - here we have denominating only 1 number. \...
Simeon Simeonov's user avatar
1 vote
0 answers
89 views

"Esami" package: random extraction from a set of elements?

I am trying to give randomness to a test with the "esami" package and the command "randestrai" was promising. I wanted to pick some random prime numbers so I wrote \randestrai{3,5,7,11}{alpha} which ...
Marco Disce's user avatar
4 votes
1 answer
3k views

Tikz picture using random number

I am using currently tikz to describe a law used in a Theory. This method describes the construction of sub-Area by breaking point in different lines. I want to reproduce this picture: In this one, ...
G. Sophys's user avatar
  • 139
9 votes
1 answer
879 views

Random points in a rectangle

I have made a graph as shown in the following figure: For each rectangle I'd like to generate n random points in it, is it possible? My code: \begin{tikzpicture} \begin{axis}[ grid=major, ...
Davide Pisanò's user avatar
1 vote
2 answers
644 views

Help with writing base 10 addition/subtraction formula

I am preparing this small tutorial for addition and subtraction formulas for kids who have a strong understanding of base-10 representation and also have a good enough understanding of addition and ...
barish's user avatar
  • 21