Showing posts with label Zipf's law. Show all posts
Showing posts with label Zipf's law. Show all posts

Thursday, September 11, 2008

จำนวนครั้งที่คนมาอ่านกระทู้เก่าพันทิพเป็น Power Law? (ภาค 2)

ผมเก็บข้อมูลเพิ่มเติมหลังจากการทดลองครั้งที่แล้ว โดยข้อมูลใหม่อยู่ที่นี่

Plot ของเดือนนี้เป็นอย่างนี้:

เปรียบเทียบกับเดือนที่แล้ว (สีน้ำเงินคือเดือนที่แล้ว) พบว่า slope ตรงกลางๆ จะคล้ายๆกัน:

จำนวนครั้งการอ่านของเดือนนี้มากกว่าเดือนที่แล้วจึงทำให้สีแดงอยู่ข้างบน รวมถึงจำนวนกระทู้ที่ถูกอ่านของเดือนนี้ก็มากกว่าเดือนที่แล้ว (5,458  กระทู้  vs.  3,782 กระทู้) ทำให้สีแดงออกไปทางขวามือมากกว่า

ไว้ผมจะรอดูอีกสักเดือนแล้วเปรียบเทียบอีกที


Wednesday, August 13, 2008

จำนวนครั้งที่คนมาอ่านกระทู้เก่าพันทิพเป็น Power Law?

ผมมาดูว่ากระทู้เก่าๆจาก Pantip.com ที่ Atriumtech.com เก็บไว้มีคนมาอ่านมากไหม เลยไปดูข้อมูลย้อนกลับไปประมาณ 4 อาทิตย์ แล้วลองเอาจำนวนครั้งที่อ่าน และลำดับที่มา plot ดูแล้วได้รูปนี้:


แกนตั้งคือจำนวนครั้งที่กระทู้ถูกอ่าน แกนนอนคือลำดับของกระทู้ (ลำดับที่ 1 คืออ่านมากสุด)

ปรากฎว่าเวลา plot แบบ log-log แล้วดูเหมือนว่าลำดับต้นๆ (1-300) จะเรียงเป็น(ประมาณ)เส้นตรง แปลว่าจำนวนครั้งที่อ่านจะประมาณเท่ากับ ลำดับที่ ยกกำลังอะไรบางอย่างที่เป็นลบ

ผมไม่รู้เหมือนกันว่ามีเหตุผลอะไรหรือเปล่าที่ทำให้เกิดข้อมูลแบบนี้ แต่ Power-law เกิดบ่อยๆในปรากฎการณ์หลายๆแบบ และนี่อาจเป็นอีกตัวอย่างหนึ่ง

Sunday, February 24, 2008

Two Laws That More People Should Know About

I knew about them when I was in my early 20's and I wished I had known about them earlier.

The first is Zipf's law, which "...states that given some corpus of natural language utterances, the frequency of any word is inversely proportional to its rank in the frequency table. Thus the most frequent word will occur approximately twice as often as the second most frequent word, which occurs twice as often as the fourth most frequent word, etc."

It's a special case of the general power law distribution which many natural phenomena seem to exhibit.

The other law is Benford's law, which "...states that in lists of numbers from many real-life sources of data, the leading digit is 1 almost one third of the time, and larger numbers occur as the leading digit with less and less frequency as they grow in magnitude, to the point that 9 is the first digit less than one time in twenty. This is based on the observation that real-world measurements are generally distributed logarithmically, thus the logarithm of a set of real-world measurements is generally distributed uniformly."

Benford's law is applicable to "... a wide variety of figures, including electricity bills, street addresses, stock prices, population numbers, death rates, lengths of rivers, physical and mathematical constants, and processes described by power laws (which are very common in nature). "

Benford's law is also used successfully to detect accounting frauds, scientific frauds, electoral frauds, and other types of frauds. Just google for "fraud detection benford" and you will see a lot of examples.