惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
O
OpenAI News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog
博客园 - 聂微东
博客园_首页
Latest news
Latest news
Know Your Adversary
Know Your Adversary
雷峰网
雷峰网
Recent Announcements
Recent Announcements
美团技术团队
Microsoft Azure Blog
Microsoft Azure Blog
F
Fortinet All Blogs
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tor Project blog
J
Java Code Geeks
WordPress大学
WordPress大学
L
Lohrmann on Cybersecurity
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
G
GRAHAM CLULEY
腾讯CDC
Vercel News
Vercel News
Engineering at Meta
Engineering at Meta
F
Full Disclosure
The Hacker News
The Hacker News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Spread Privacy
Spread Privacy
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
有赞技术团队
有赞技术团队
K
Kaspersky official blog
Jina AI
Jina AI
Scott Helme
Scott Helme
P
Privacy & Cybersecurity Law Blog
Hugging Face - Blog
Hugging Face - Blog
H
Help Net Security
V2EX - 技术
V2EX - 技术
P
Privacy International News Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 【当耐特】
小众软件
小众软件
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Cloudflare Blog
Forbes - Security
Forbes - Security
S
Securelist
A
About on SuperTechFans

博客园 - 空军

过多边形边上某点的任意直线等分面积 VisualAPL Installer for Visual Studio 2008 [ZT] Create a Microsoft Access Database Using ADOX and Visual Basic .NET 数的分解,据说是清华的一道复试上机题 为System.Windows.Forms.FontDialog类添加Location属性 [zt]〖Math〗构造函数使得任意小的区间所对应的值域都是整个实数域 [zt]鸟巢、水立方:同一个地方,同一梦想 〖Math〗据传,任意锐角等于0° 爱因斯坦的超级问题(谁养鱼)SQL解法 “槑囧圐圙”您认得这些汉字吗? 根据URL提取页面的Title,根据网页的charset自动判断Encoding MSDN“MidpointRounding 枚举”中文翻译有误 C# 2.0 新特性(泛型、可空类型)应用一例 表达式计算器 Google速记 Google中国编程挑战赛第一轮 Google中国编程挑战赛资格赛 数学家 数据库访问模块
f(f(x)) = -x
空军 · 2009-05-26 · via 博客园 - 空军


来源:http://www.cnblogs.com/yinyueyouge/archive/2009/05/25/1488921.html

原题说的自变量是一个 32 比特的有符号整数,这里扩展之,对不同的定义值和值域进行讨论。


设计一个函数 f,使得

f(f(x)) = -x

这里 f(x) 的定义值和值域都是集合 A。


(1)

如果 A 是复数集 C,则令 f(x) = i * x 即可,其中 i 是虚数单位,满足 i * i = -1。


(2)

如果 A 是整数集 Z,则令

f(x) =  0,    当 x = 0,
f(x) =  1 + x,当 x > 0 且为奇数,
f(x) =  1 - x,当 x > 0 且为偶数,
f(x) = -1 + x,当 x < 0 且为奇数,
f(x) = -1 - x,当 x < 0 且为偶数,

易知 f(x) 满足要求。


(3)

如果 A 是除 ±1 以外的实数,即 A = (-∞,-1)∪(-1,1)∪(1,+∞),令

f(x) =  0,    当 x = 0,
f(x) =  1 / x,当 x∈(-1,0)∪(0,1),
f(x) = -1 / x,当 x∈(-∞,-1)∪(1,+∞),

则 f(x) 满足要求。


(4)

如果 A 是实数集 R 或有理数集 Q,则又如何?