fantasybei 发表于 2013-1-27 04:45:54

2.5

Show that we can represent pairs of nonnegative integers using only numbers and arithmetic operations if we represent the pair a and b as the integer that is the product 2a 3b. Give the corresponding definitions of the procedures cons, car, and cdr.

恩恩,一个人看sicp真的很郁闷,用2^a*3^b来表示pair,那怎么写car和cdr呢,如果能用来表示pair,哪么用2^a*3^b构造出来的那个数,用2^a*3^b来表示一定只有一种a和b的可能性,假设2^a*3^b = 2^c*3^d,即2^(a-c) = 3^(d-b),2是偶数,他的任何次方都是偶数,3是偶数,任何次方都是奇数,除了a-c=0 d-b =0,所以a=c,b=d只有这么一种情况。
http://www.agoit.com/images/smiles/icon_cry.gif 都是看了网上和问了别人才搞清楚的,郁闷呀,数学学的不好
页: [1]
查看完整版本: 2.5