[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CX5AJ987ZXDSKSADJE6DPS":3,"skill-same:01M6CX5AJ987ZXDSKSADJE6DPS":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":22,"linkOnly":23,"markdownContent":24,"markdownBody":25,"frontMatter":26,"refName":30,"commitSha":31,"skillDirectory":5,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M6CX5AJ987ZXDSKSADJE6DPS","information-theory",null,"Information theory fundamentals","ffsshhttiikk\u002Fopencode-agents-skills","ffsshhttiikk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F226346827?v=4","01M6CWD9RR3Y7VRQX3MXYC8FYH","01M6CWD9WVPYAZW0J82G1VKGHY",3,"MIT","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Finformation-theory\u002FSKILL.md",[],[18,19,20,21],"information theory","science","computer","opencode","2026-11-10 10:12:30",false,"---\nname: information-theory\ndescription: Information theory fundamentals\nlicense: MIT\ncompatibility: opencode\nmetadata:\n  audience: developers\n  category: computer-science\n---\n\n## What I do\n- Calculate entropy and information content\n- Design efficient encodings\n- Analyze channel capacity\n- Implement compression algorithms\n\n## When to use me\nWhen working with data compression, encoding, or communication systems.\n\n## Entropy\n\n### Shannon Entropy\n```python\nimport math\nfrom collections import Counter\n\nclass InformationTheory:\n    \"\"\"Information theory calculations\"\"\"\n    \n    @staticmethod\n    def entropy(probabilities: List[float]) -> float:\n        \"\"\"Calculate Shannon entropy H(X) = -Σ p(x) log₂ p(x)\"\"\"\n        return -sum(p * math.log2(p) \n                   for p in probabilities if p > 0)\n    \n    @staticmethod\n    def entropy_from_frequencies(data: List) -> float:\n        \"\"\"Calculate entropy from data\"\"\"\n        counter = Counter(data)\n        total = len(data)\n        probabilities = [count \u002F total for count in counter.values()]\n        return InformationTheory.entropy(probabilities)\n    \n    @staticmethod\n    def joint_entropy(data: List[tuple]) -> float:\n        \"\"\"Calculate joint entropy H(X,Y)\"\"\"\n        counter = Counter(data)\n        total = len(data)\n        probabilities = [count \u002F total for count in counter.values()]\n        return InformationTheory.entropy(probabilities)\n    \n    @staticmethod\n    def conditional_entropy(data: List[tuple]) -> float:\n        \"\"\"Calculate conditional entropy H(Y|X)\"\"\"\n        # H(Y|X) = H(X,Y) - H(X)\n        return InformationTheory.joint_entropy(data) - \\\n               InformationTheory.entropy([x[0] for x in data])\n    \n    @staticmethod\n    def mutual_information(x: List, y: List) -> float:\n        \"\"\"Calculate mutual information I(X;Y) = H(X) + H(Y) - H(X,Y)\"\"\"\n        data = list(zip(x, y))\n        \n        h_x = InformationTheory.entropy_from_frequencies(x)\n        h_y = InformationTheory.entropy_from_frequencies(y)\n        h_xy = InformationTheory.joint_entropy(data)\n        \n        return h_x + h_y - h_xy\n\n\n# Example: Entropy of English alphabet\nenglish_freqs = {\n    'E': 0.127, 'T': 0.091, 'A': 0.082, 'O': 0.075, 'I': 0.070,\n    'N': 0.067, 'S': 0.063, 'R': 0.060, 'H': 0.059, 'L': 0.040\n}\n\nentropy = InformationTheory.entropy(list(english_freqs.values()))\n# ~3.1 bits per character\n```\n\n### Information Content\n```python\nclass InformationContent:\n    \"\"\"Information content and surprise\"\"\"\n    \n    @staticmethod\n    def self_information(p: float) -> float:\n        \"\"\"Self-information: I(x) = -log₂ p(x)\"\"\"\n        return -math.log2(p) if p > 0 else 0\n    \n    @staticmethod\n    def bits_needed(probability: float) -> int:\n        \"\"\"Minimum bits to encode event\"\"\"\n        return math.ceil(-math.log2(probability))\n```\n\n## Coding\n\n### Huffman Coding\n```python\nimport heapq\nfrom collections import Counter\n\nclass HuffmanCoding:\n    \"\"\"Huffman coding for compression\"\"\"\n    \n    class Node:\n        def __init__(self, char: str, freq: int):\n            self.char = char\n            self.freq = freq\n            self.left = None\n            self.right = None\n        \n        def __lt__(self, other):\n            return self.freq \u003C other.freq\n    \n    def __init__(self):\n        self.codes = {}\n    \n    def build_tree(self, data: str) -> 'HuffmanCoding.Node':\n        \"\"\"Build Huffman tree\"\"\"\n        freq = Counter(data)\n        heap = [self.Node(char, f) for char, f in freq.items()]\n        heapq.heapify(heap)\n        \n        while len(heap) > 1:\n            left = heapq.heappop(heap)\n            right = heapq.heappop(heap)\n            \n            merged = self.Node(None, left.freq + right.freq)\n            merged.left = left\n            merged.right = right\n            \n            heapq.heappush(heap, merged)\n        \n        return heap[0]\n    \n    def build_codes(self, node: 'HuffmanCoding.Node', \n                   prefix: str = \"\"):\n        \"\"\"Build codes by traversing tree\"\"\"\n        if node is None:\n            return\n        \n        if node.char is not None:\n            self.codes[node.char] = prefix\n            return\n        \n        self.build_codes(node.left, prefix + \"0\")\n        self.build_codes(node.right, prefix + \"1\")\n    \n    def encode(self, data: str) -> tuple:\n        \"\"\"Encode data using Huffman coding\"\"\"\n        tree = self.build_tree(data)\n        self.build_codes(tree)\n        \n        encoded = \"\".join(self.codes[char] for char in data)\n        return encoded, tree\n    \n    def decode(self, encoded: str, tree: 'HuffmanCoding.Node') -> str:\n        \"\"\"Decode Huffman-encoded data\"\"\"\n        result = []\n        node = tree\n        \n        for bit in encoded:\n            if bit == \"0\":\n                node = node.left\n            else:\n                node = node.right\n            \n            if node.char is not None:\n                result.append(node.char)\n                node = tree\n        \n        return \"\".join(result)\n```\n\n### Arithmetic Coding\n```python\nclass ArithmeticCoding:\n    \"\"\"Arithmetic coding\"\"\"\n    \n    def __init__(self):\n        self.range_start = 0.0\n        self.range_end = 1.0\n    \n    def encode(self, data: str, frequencies: dict) -> float:\n        \"\"\"Arithmetic encoding\"\"\"\n        total = sum(frequencies.values())\n        cumulative = {}\n        \n        start = 0.0\n        for char, freq in frequencies.items():\n            end = start + freq \u002F total\n            cumulative[char] = (start, end)\n            start = end\n        \n        low = 0.0\n        high = 1.0\n        \n        for char in data:\n            range_size = high - low\n            char_range = cumulative[char]\n            \n            low = low + range_size * char_range[0]\n            high = low + range_size * char_range[1]\n        \n        return (low + high) \u002F 2\n```\n\n## Channel Capacity\n\n### Channel Capacity (Shannon)\n```python\nclass ChannelCapacity:\n    \"\"\"Calculate channel capacity\"\"\"\n    \n    @staticmethod\n    def binary_symmetric_channel(p: float) -> float:\n        \"\"\"Capacity of BSC with crossover probability p\n        C = 1 + p*log₂(p) + (1-p)*log₂(1-p)\n        \"\"\"\n        if p == 0 or p == 1:\n            return 0\n        return 1 + p * math.log2(p) + (1 - p) * math.log2(1 - p)\n    \n    @staticmethod\n    def awgn_channel(snr_db: float) -> float:\n        \"\"\"Capacity of AWGN channel\n        C = B * log₂(1 + SNR)\n        \"\"\"\n        snr = 10 ** (snr_db \u002F 10)\n        return math.log2(1 + snr)\n    \n    @staticmethod\n    def shannon_hartley(snr_db: float, bandwidth: float) -> float:\n        \"\"\"Shannon-Hartley theorem\n        C = B * log₂(1 + S\u002FN)\n        \"\"\"\n        snr = 10 ** (snr_db \u002F 10)\n        return bandwidth * math.log2(1 + snr)\n```\n\n## Compression\n\n### LZW Compression\n```python\nclass LZWCompression:\n    \"\"\"LZW compression algorithm\"\"\"\n    \n    def compress(self, data: str) -> list:\n        \"\"\"Compress data using LZW\"\"\"\n        dictionary = {chr(i): i for i in range(256)}\n        result = []\n        current = \"\"\n        \n        for char in data:\n            combined = current + char\n            \n            if combined in dictionary:\n                current = combined\n            else:\n                result.append(dictionary[current])\n                dictionary[combined] = len(dictionary)\n                current = char\n        \n        if current:\n            result.append(dictionary[current])\n        \n        return result\n    \n    def decompress(self, compressed: list) -> str:\n        \"\"\"Decompress LZW data\"\"\"\n        dictionary = {i: chr(i) for i in range(256)}\n        result = []\n        current = chr(compressed[0])\n        result.append(current)\n        \n        for code in compressed[1:]:\n            if code in dictionary:\n                entry = dictionary[code]\n            elif code == len(dictionary):\n                entry = current + current[0]\n            \n            result.append(entry)\n            \n            dictionary[len(dictionary)] = current + entry[0]\n            current = entry\n        \n        return \"\".join(result)\n```\n","## What I do\n- Calculate entropy and information content\n- Design efficient encodings\n- Analyze channel capacity\n- Implement compression algorithms\n\n## When to use me\nWhen working with data compression, encoding, or communication systems.\n\n## Entropy\n\n### Shannon Entropy\n```python\nimport math\nfrom collections import Counter\n\nclass InformationTheory:\n    \"\"\"Information theory calculations\"\"\"\n    \n    @staticmethod\n    def entropy(probabilities: List[float]) -> float:\n        \"\"\"Calculate Shannon entropy H(X) = -Σ p(x) log₂ p(x)\"\"\"\n        return -sum(p * math.log2(p) \n                   for p in probabilities if p > 0)\n    \n    @staticmethod\n    def entropy_from_frequencies(data: List) -> float:\n        \"\"\"Calculate entropy from data\"\"\"\n        counter = Counter(data)\n        total = len(data)\n        probabilities = [count \u002F total for count in counter.values()]\n        return InformationTheory.entropy(probabilities)\n    \n    @staticmethod\n    def joint_entropy(data: List[tuple]) -> float:\n        \"\"\"Calculate joint entropy H(X,Y)\"\"\"\n        counter = Counter(data)\n        total = len(data)\n        probabilities = [count \u002F total for count in counter.values()]\n        return InformationTheory.entropy(probabilities)\n    \n    @staticmethod\n    def conditional_entropy(data: List[tuple]) -> float:\n        \"\"\"Calculate conditional entropy H(Y|X)\"\"\"\n        # H(Y|X) = H(X,Y) - H(X)\n        return InformationTheory.joint_entropy(data) - \\\n               InformationTheory.entropy([x[0] for x in data])\n    \n    @staticmethod\n    def mutual_information(x: List, y: List) -> float:\n        \"\"\"Calculate mutual information I(X;Y) = H(X) + H(Y) - H(X,Y)\"\"\"\n        data = list(zip(x, y))\n        \n        h_x = InformationTheory.entropy_from_frequencies(x)\n        h_y = InformationTheory.entropy_from_frequencies(y)\n        h_xy = InformationTheory.joint_entropy(data)\n        \n        return h_x + h_y - h_xy\n\n\n# Example: Entropy of English alphabet\nenglish_freqs = {\n    'E': 0.127, 'T': 0.091, 'A': 0.082, 'O': 0.075, 'I': 0.070,\n    'N': 0.067, 'S': 0.063, 'R': 0.060, 'H': 0.059, 'L': 0.040\n}\n\nentropy = InformationTheory.entropy(list(english_freqs.values()))\n# ~3.1 bits per character\n```\n\n### Information Content\n```python\nclass InformationContent:\n    \"\"\"Information content and surprise\"\"\"\n    \n    @staticmethod\n    def self_information(p: float) -> float:\n        \"\"\"Self-information: I(x) = -log₂ p(x)\"\"\"\n        return -math.log2(p) if p > 0 else 0\n    \n    @staticmethod\n    def bits_needed(probability: float) -> int:\n        \"\"\"Minimum bits to encode event\"\"\"\n        return math.ceil(-math.log2(probability))\n```\n\n## Coding\n\n### Huffman Coding\n```python\nimport heapq\nfrom collections import Counter\n\nclass HuffmanCoding:\n    \"\"\"Huffman coding for compression\"\"\"\n    \n    class Node:\n        def __init__(self, char: str, freq: int):\n            self.char = char\n            self.freq = freq\n            self.left = None\n            self.right = None\n        \n        def __lt__(self, other):\n            return self.freq \u003C other.freq\n    \n    def __init__(self):\n        self.codes = {}\n    \n    def build_tree(self, data: str) -> 'HuffmanCoding.Node':\n        \"\"\"Build Huffman tree\"\"\"\n        freq = Counter(data)\n        heap = [self.Node(char, f) for char, f in freq.items()]\n        heapq.heapify(heap)\n        \n        while len(heap) > 1:\n            left = heapq.heappop(heap)\n            right = heapq.heappop(heap)\n            \n            merged = self.Node(None, left.freq + right.freq)\n            merged.left = left\n            merged.right = right\n            \n            heapq.heappush(heap, merged)\n        \n        return heap[0]\n    \n    def build_codes(self, node: 'HuffmanCoding.Node', \n                   prefix: str = \"\"):\n        \"\"\"Build codes by traversing tree\"\"\"\n        if node is None:\n            return\n        \n        if node.char is not None:\n            self.codes[node.char] = prefix\n            return\n        \n        self.build_codes(node.left, prefix + \"0\")\n        self.build_codes(node.right, prefix + \"1\")\n    \n    def encode(self, data: str) -> tuple:\n        \"\"\"Encode data using Huffman coding\"\"\"\n        tree = self.build_tree(data)\n        self.build_codes(tree)\n        \n        encoded = \"\".join(self.codes[char] for char in data)\n        return encoded, tree\n    \n    def decode(self, encoded: str, tree: 'HuffmanCoding.Node') -> str:\n        \"\"\"Decode Huffman-encoded data\"\"\"\n        result = []\n        node = tree\n        \n        for bit in encoded:\n            if bit == \"0\":\n                node = node.left\n            else:\n                node = node.right\n            \n            if node.char is not None:\n                result.append(node.char)\n                node = tree\n        \n        return \"\".join(result)\n```\n\n### Arithmetic Coding\n```python\nclass ArithmeticCoding:\n    \"\"\"Arithmetic coding\"\"\"\n    \n    def __init__(self):\n        self.range_start = 0.0\n        self.range_end = 1.0\n    \n    def encode(self, data: str, frequencies: dict) -> float:\n        \"\"\"Arithmetic encoding\"\"\"\n        total = sum(frequencies.values())\n        cumulative = {}\n        \n        start = 0.0\n        for char, freq in frequencies.items():\n            end = start + freq \u002F total\n            cumulative[char] = (start, end)\n            start = end\n        \n        low = 0.0\n        high = 1.0\n        \n        for char in data:\n            range_size = high - low\n            char_range = cumulative[char]\n            \n            low = low + range_size * char_range[0]\n            high = low + range_size * char_range[1]\n        \n        return (low + high) \u002F 2\n```\n\n## Channel Capacity\n\n### Channel Capacity (Shannon)\n```python\nclass ChannelCapacity:\n    \"\"\"Calculate channel capacity\"\"\"\n    \n    @staticmethod\n    def binary_symmetric_channel(p: float) -> float:\n        \"\"\"Capacity of BSC with crossover probability p\n        C = 1 + p*log₂(p) + (1-p)*log₂(1-p)\n        \"\"\"\n        if p == 0 or p == 1:\n            return 0\n        return 1 + p * math.log2(p) + (1 - p) * math.log2(1 - p)\n    \n    @staticmethod\n    def awgn_channel(snr_db: float) -> float:\n        \"\"\"Capacity of AWGN channel\n        C = B * log₂(1 + SNR)\n        \"\"\"\n        snr = 10 ** (snr_db \u002F 10)\n        return math.log2(1 + snr)\n    \n    @staticmethod\n    def shannon_hartley(snr_db: float, bandwidth: float) -> float:\n        \"\"\"Shannon-Hartley theorem\n        C = B * log₂(1 + S\u002FN)\n        \"\"\"\n        snr = 10 ** (snr_db \u002F 10)\n        return bandwidth * math.log2(1 + snr)\n```\n\n## Compression\n\n### LZW Compression\n```python\nclass LZWCompression:\n    \"\"\"LZW compression algorithm\"\"\"\n    \n    def compress(self, data: str) -> list:\n        \"\"\"Compress data using LZW\"\"\"\n        dictionary = {chr(i): i for i in range(256)}\n        result = []\n        current = \"\"\n        \n        for char in data:\n            combined = current + char\n            \n            if combined in dictionary:\n                current = combined\n            else:\n                result.append(dictionary[current])\n                dictionary[combined] = len(dictionary)\n                current = char\n        \n        if current:\n            result.append(dictionary[current])\n        \n        return result\n    \n    def decompress(self, compressed: list) -> str:\n        \"\"\"Decompress LZW data\"\"\"\n        dictionary = {i: chr(i) for i in range(256)}\n        result = []\n        current = chr(compressed[0])\n        result.append(current)\n        \n        for code in compressed[1:]:\n            if code in dictionary:\n                entry = dictionary[code]\n            elif code == len(dictionary):\n                entry = current + current[0]\n            \n            result.append(entry)\n            \n            dictionary[len(dictionary)] = current + entry[0]\n            current = entry\n        \n        return \"\".join(result)\n```\n",{"name":5,"license":14,"metadata":27,"description":7,"compatibility":21},{"audience":28,"category":29},"developers","computer-science","main","5f7a3e453c98261f93d19a6a7de44ad8f7b72d41",2,"https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk","2026-03-01 06:55:40",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill information-theory",{"tool":42,"command":43},"bunx","bunx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill information-theory",{"tool":45,"command":46},"pnpm","pnpm dlx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill information-theory","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Finformation-theory\u002FSKILL.md",true,[],[51,62,71,80,90,99],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":22},"01M6CXT9TXDF79BWJTMQAPB49G","xamarin","Xamarin cross-platform development","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fxamarin\u002FSKILL.md",[],[53,58,59,60,21,61],"platform","cross-platform","mobile","development",{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":22},"01M6CXT8AD04MFYDA32VW3FKAG","wrangling","Data wrangling fundamentals","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwrangling\u002FSKILL.md",[],[64,69,21,19,70],"data wrangling","data",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":22},"01M6CXT717GCN7SRRNPBDP4508","windows","Windows operating system administration and scripting","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwindows\u002FSKILL.md",[],[73,78,21,79],"system","scripting",{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":22},"01M6CXT54K794NMEM3XAPZZDKT","wide-column","Wide-column data model","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwide-column\u002FSKILL.md",[],[87,88,21,89,70],"wide column","databases","model",{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":22},"01M6CXT28FMT2P4V9GZE67WA8E","wide-column-stores","Wide-column database stores","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwide-column-stores\u002FSKILL.md",[],[97,88,21,98],"wide column stores","database",{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":22},"01M6CXT0D0M0Q4T2N7C2RX7DSN","websockets","WebSocket implementation and best practices","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwebsockets\u002FSKILL.md",[],[101,106,107,108,21,109,110],"websocket","real-time","time","best practices","implementation"]