benfords-law

Benford's Law in Java - how to make a math function into Java

南楼画角 提交于 2020-01-02 05:18:13
问题 I have a quick question. I am trying to make a fraud detection app in java, the app will be primarily based on Benford's law. Benford's law is super cool, it basically can be interpreted to say that in a real financial transaction the first digit is commonly a 1, 2, or 3 and very rarely an 8, 9. I haven't been able to get the Benford formula translated into code that can be run in Java. http://www.mathpages.com/home/kmath302/kmath302.htm This link has more information about what the Benford

How to pick up only integer data from an ArrayList of String

夙愿已清 提交于 2019-12-20 07:48:45
问题 I read a text file and put the data into an ArrayList of String . The data is like China 12351235123 Korea 123532523 USA 12341235123 I just need those integer data as an integer to find the first digit of the integers. I know how to find the first digit, but I don't know how I can pick up only the integer data. 回答1: I am assuming that your ArrayList is of type String . replaceAll() will take out anything that isn't a number(0-9) ArrayList<String> countrys = new ArrayList<String>(); countrys

Benford's Law in Java - how to make a math function into Java

£可爱£侵袭症+ 提交于 2019-12-05 08:40:49
I have a quick question. I am trying to make a fraud detection app in java, the app will be primarily based on Benford's law. Benford's law is super cool, it basically can be interpreted to say that in a real financial transaction the first digit is commonly a 1, 2, or 3 and very rarely an 8, 9. I haven't been able to get the Benford formula translated into code that can be run in Java. http://www.mathpages.com/home/kmath302/kmath302.htm This link has more information about what the Benford law is and how it can be used. I know that I will have to use the java math class to be able to use a

How to pick up only integer data from an ArrayList of String

时光毁灭记忆、已成空白 提交于 2019-12-02 13:34:30
I read a text file and put the data into an ArrayList of String . The data is like China 12351235123 Korea 123532523 USA 12341235123 I just need those integer data as an integer to find the first digit of the integers. I know how to find the first digit, but I don't know how I can pick up only the integer data. ttivedcm I am assuming that your ArrayList is of type String . replaceAll() will take out anything that isn't a number(0-9) ArrayList<String> countrys = new ArrayList<String>(); countrys.add("China 12351235123"); countrys.add("Korea 123532523"); countrys.add("USA 12341235123"); for

Is there a random number distribution that obeys Benford's Law?

北慕城南 提交于 2019-12-01 15:59:49
Python has a number of ways to generate different distributions of random numbers, see the documentation for the random module . Unfortunately they aren't terribly understandable without the appropriate math background, especially considering the required parameters. I'd like to know if any of those methods are capable of producing random numbers with a distribution that obeys Benford's Law , and what parameter values are appropriate. Namely for a population of integers, those integers should start with a '1' about 30% of the time, '2' about 18% of the time, etc. Using Jan Dvorak's answer I

Is there a random number distribution that obeys Benford's Law?

我的未来我决定 提交于 2019-12-01 14:51:26
问题 Python has a number of ways to generate different distributions of random numbers, see the documentation for the random module. Unfortunately they aren't terribly understandable without the appropriate math background, especially considering the required parameters. I'd like to know if any of those methods are capable of producing random numbers with a distribution that obeys Benford's Law, and what parameter values are appropriate. Namely for a population of integers, those integers should