开发者

Inverse Mappings

开发者 https://www.devze.com 2023-01-13 22:21 出处:网络
Saying right now: Yes, this is homework.I\'m not asking for an answer, but I would love any help into a general direction to look at this problem at.I\'ve been working on it now for hours and have not

Saying right now: Yes, this is homework. I'm not asking for an answer, but I would love any help into a general direction to look at this problem at. I've been working on it now for hours and have not made any real progress.

Can a function, with a well defined inverse, be implemented to map 32 bit integers to 64 bit integers. Do a开发者_开发问答ll functions from 32bit to 64bit integers have well defined inverses?


Of course not.

Take the identity function for example. All 32-bit values have an identity in the 64-bit value space (just use 0 in the top 32 bits, using only the bottom 32 bits for the value). However, any 64-bit value where the top 32 bits is not 0, will not have a corresponding value in the 32-bit value space.

The above is a layman's explanation, and is probably not rigorous enough as a homework solution (as intended). You'd do well to read up on the pigeonhole principle.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号