//Viswanath.java //Fibonacci but subtract if coin flip is tails, add if heads. //absolute value of sequence converges to 1.13198824^n //i.e. Nth root of |Fn| converges to 1.13198824 //i.e. exponential growth rate of random Fibonacci sequence is 1.13198824 //cf. exponential growth rate of Fibonacci sequence is phi golden ratio (1+sqrt(5))/2 =1.61803... import javax.swing.*; public class Viswanath { public static void main (String[] args) { int trials, maxF; long Fn, Fn1, Fn2; double sum=0, sumAbs=0; String input; double vis= 1.13198824; input = JOptionPane.showInputDialog("Number of trials","100"); trials = Integer.parseInt(input); input = JOptionPane.showInputDialog("n","100"); maxF = Integer.parseInt(input); maxF++; System.out.printf(" Fn |Fn| |Fn|^(1/n) \n"); for (int i=0; i