{isTH ? 'ลอการิทึมฐาน 2 (Binary Logarithm) คืออะไร?' : 'What is Log Base 2 (Binary Logarithm)?'}
{isTH ? 'ลอการิทึมฐาน 2 หรือที่เรียกว่า Binary Logarithm (มักเขียนเป็น log₂(x) หรือ lb(x) หรือ lg(x) ในทางวิทยาการคอมพิวเตอร์) คือการตอบคำถามที่ว่า "เราต้องคูณเลข 2 เข้าด้วยกันกี่ครั้ง เพื่อให้ได้ค่า x" หรือกล่าวอีกนัยหนึ่งคือ 2 ยกกำลังอะไรถึงจะได้ x ยกตัวอย่างเช่น log₂(8) = 3 เพราะว่า 2³ = 2 × 2 × 2 = 8' : 'The base-2 logarithm, also known as the binary logarithm (often written as log₂(x), lb(x), or lg(x) in computer science), answers the question: "To what power must 2 be raised to obtain the value x?" For example, log₂(8) = 3 because 2³ = 2 × 2 × 2 = 8.'}
{isTH ? 'บทบาทสำคัญในวิทยาการคอมพิวเตอร์' : 'Crucial Role in Computer Science'}
{isTH ? 'ในขณะที่มนุษย์นับเลขและคำนวณด้วยเลขฐาน 10 คอมพิวเตอร์ประมวลผลทุกอย่างเป็นเลขฐาน 2 (0 และ 1 หรือ บิต - Bits) ลอการิทึมฐาน 2 จึงเป็นหัวใจสำคัญในการอธิบายระบบดิจิทัลและเทคโนโลยีสารสนเทศ:' : 'While humans count in base-10, computers process everything in base-2 (0s and 1s, or bits). Thus, the binary logarithm is the core of digital systems and information technology:'}
- การวัดปริมาณข้อมูล (Information Theory): {isTH ? 'ตามทฤษฎีสารสนเทศของ Claude Shannon ค่า entropy หรือปริมาณข้อมูลมักวัดเป็น "บิต" ซึ่งหาได้จากการใช้ลอการิทึมฐาน 2 เช่น ถ้าคุณมีทางเลือก 256 ทาง คุณต้องใช้ข้อมูล log₂(256) = 8 บิตในการระบุทางเลือกนั้นๆ' : 'In Claude Shannon\'s information theory, entropy or information content is measured in "bits" using base-2 logarithms. e.g., to specify one of 256 options, you need log₂(256) = 8 bits.'}
- ความซับซ้อนของอัลกอริทึม (Algorithm Complexity): {isTH ? 'คุณสมบัติของ log₂ ปรากฏใน "ความซับซ้อนของเวลา" (Time Complexity) เช่น O(log n) ซึ่งพบได้บ่อยในอัลกอริทึมการค้นหาแบบทวิภาค (Binary Search) หรือต้นไม้ค้นหา (Binary Search Trees) อัลกอริทึมเหล่านี้จะแบ่งข้อมูลออกเป็นครึ่งหนึ่งซ้ำๆ ทำให้ค้นหาข้อมูลนับล้านรายการได้ด้วยการเปรียบเทียบเพียง 20 ครั้ง (เพราะ 2²⁰ ≈ 1,000,000)' : 'The properties of log₂ appear in time complexities like O(log n), common in Binary Search or Binary Search Trees. These algorithms repeatedly halve the dataset, meaning they can search a million items in just about 20 comparisons.'}
- โครงสร้างข้อมูล (Data Structures): {isTH ? 'ใช้คำนวณความสูงของโครงสร้างข้อมูลแบบต้นไม้ (Tree height) และความจุในการอ้างอิงหน่วยความจำ' : 'Used to calculate the height of tree data structures and memory addressing capacities.'}
{isTH ? 'คุณสมบัติทางคณิตศาสตร์' : 'Mathematical Properties'}
{isTH ? 'แม้จะดูผูกพันกับคอมพิวเตอร์ แต่ log₂(x) ก็มีคุณสมบัติพื้นฐานเหมือนลอการิทึมฐานอื่นๆ:' : 'Despite its association with computers, log₂(x) shares the fundamental properties of other logarithms:'}
• log₂(x × y) = log₂(x) + log₂(y)
• log₂(x / y) = log₂(x) - log₂(y)
• log₂(xʸ) = y × log₂(x)
• log₂(1) = 0
• log₂(2) = 1
{isTH ? 'หากเครื่องคิดเลขของคุณไม่มีปุ่ม log₂ คุณสามารถคำนวณได้โดยอาศัยกฎการเปลี่ยนฐาน (Change of Base Formula):' : 'If your physical calculator lacks a log₂ button, you can compute it using the Change of Base Formula:'}
log₂(x) = ln(x) / ln(2) = log₁₀(x) / log₁₀(2)