How Do You Calculate Probabilities with Non-Coprime Residue Classes?

  • Context: Graduate 
  • Thread starter Thread starter CRGreathouse
  • Start date Start date
  • Tags Tags
    Classes Residue
Click For Summary
SUMMARY

This discussion focuses on calculating probabilities with non-coprime residue classes when determining the likelihood that a random integer, modulo the product of the moduli, falls within at least one of the classes. The traditional method for coprime moduli involves an accumulator formula, but the challenge arises with non-coprime moduli, particularly when dealing with large and smooth moduli. The conversation suggests the need for a method to track products of small primes and hints at the potential use of existing libraries or functions to streamline this process. The probability of hitting a residue class is zero when considering infinitely many integers against finitely many class elements, necessitating a defined range for accurate probability calculations.

PREREQUISITES
  • Understanding of residue classes in modular arithmetic
  • Familiarity with probability theory and counting principles
  • Knowledge of prime factorization and its implications in number theory
  • Experience with programming libraries for mathematical computations
NEXT STEPS
  • Research algorithms for calculating probabilities in non-coprime residue classes
  • Explore libraries such as SageMath or SymPy for modular arithmetic functions
  • Study the concept of covering sets in number theory, referencing Neilsen's preprint
  • Learn about the Chinese Remainder Theorem and its applications in probability calculations
USEFUL FOR

This discussion is beneficial for mathematicians, number theorists, and software developers working on algorithms related to modular arithmetic and probability calculations in complex residue systems.

CRGreathouse
Science Advisor
Homework Helper
Messages
2,832
Reaction score
0
Suppose I had a lot of residue classes and I wanted to find the probability that a random integer (mod the product of the moduli) was in at least one of the classes. How could I calculate that?

If the moduli were pairwise coprime, it would be easy: start an accumulator at 0 and for each class a mod m, calculate
acc <- acc + 1/m - acc/m
and return the accumulator. But what if they're not? And what if there are a whole lot of residue classes, and their moduli are both large and fairly smooth (so they are 'far from' being coprime)?

I'm picturing some kind of solution involving tracking products of small primes separately and using some version of the above algorithm for the large, and so probably coprime to everything else, prime factors. But is there a better way? Is there already a program/function/library that can do this for me?

I'm actually reminded of a recent preprint by Neilsen ('a covering set with minimum modulus 40' or something like that), though this is by no means a covering set.
 
Physics news on Phys.org
The probability is zero, because there are infinitely many integers and only finitely many elements in the classes. I assume you will need to consider only a certain range of integers. Depending on the size of this range you can calculate the probabilities by counting elements and taking the quotient, the relative frequency.

In case your modules or not coprime, you will find integers which fit in more than one class. So you also need a rule of how to proceed (count) in these cases.
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
592
Replies
6
Views
2K
  • · Replies 13 ·
Replies
13
Views
4K
  • Poll Poll
  • · Replies 2 ·
Replies
2
Views
9K
  • · Replies 60 ·
3
Replies
60
Views
13K
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K