Skip to content

Instantly share code, notes, and snippets.

Avatar

Ed Duarte EdDuarte

View GitHub Profile
@EdDuarte
EdDuarte / Prime.java
Last active Aug 4, 2019
Primality tests (Trial division, Fermat and Miller-Rabin) in Java.
View Prime.java
/**
* @author Ed Duarte (<a href="mailto:hi@edduarte.com">hi@edduarte.com</a>)
*/
public class Prime {
private java.security.SecureRandom random;
public Prime() {
this.random = new java.security.SecureRandom();
View keybase.md

Keybase proof

I hereby claim:

  • I am edduarte on github.
  • I am edduarte (https://keybase.io/edduarte) on keybase.
  • I have a public key ASDbP2LiMvtfE-_kgoAsOfg7Nc5bgXzIgNhxLHf0Yxk3Uwo

To claim this, I am signing this object:

View BirthdayProblem.java
// from guava library
import com.google.common.collect.ContiguousSet;
import com.google.common.collect.DiscreteDomain;
import com.google.common.collect.Range;
// change these two variables
final long nPeople = 23;
final long nDays = 365;
ContiguousSet<Long> matrix = ContiguousSet.create(
You can’t perform that action at this time.