34,594
社区成员
发帖
与我相关
我的任务
分享
我还要反证 答案3和4是不对的
如果两个数是3和4 那么甲知道和为7 (25 34),乙知道积为12(26 34)
那么条件1和2都暂时成立 甲可以根据条件2 得出积不可能为10,因为那样乙不用甲说都知道.那么甲就得出 为3和4 条件3也成立
反过来 乙若猜 和=8(2+6)
甲有 26 35 甲可以根据条件2得出为26 条件3成立 --这里有问题,如果允许两数相等,44也满意条件3
乙若猜 和=7(3+4)
甲有 25 34 甲也可以据条件2得出为34 条件3成立
以上两种可能皆成立 那么条件4就肯定不能成立了
也就是说乙不可能根据条件3猜出数是多少来
也就是说如果是3和4的话 条件4限制,乙绝对不能说"我也猜到了"
因为两种可能都成立,所以结果3和4是不正确的!
select top 8 identity(int,2,1) x into #t2 from syscolumns
go
select t1.x,t2.x ,(t1.x +t2.x),(t1.x *t2.x)
from #t2 t1, #t2 t2
where t1.x>=t2.x --老规矩,先排序
and (t1.x+t2.x )not in (4,5,17,18) --把知道和就能知道组合的去掉
and (t1.x * t2.x ) not in (select t1.x * t2.x from #t2 t1, #t2 t2 --把剩下范围中知道积就能唯一确定的去掉
where t1.x>=t2.x
and (t1.x+t2.x )not in (4,5,17,18)
group by ( t1.x * t2.x) having count(*)=1)
and (t1.x +t2.x) in --把知道何就知道两个值的取出来
(
select t1.x+t2.x
from #t2 t1, #t2 t2
where t1.x>=t2.x --老规矩,先排序
and (t1.x+t2.x )not in (4,5,17,18) --把知道和就能知道组合的去掉
and (t1.x * t2.x ) not in (select t1.x * t2.x from #t2 t1, #t2 t2 --把剩下范围知道积就能唯一确定的去掉
where t1.x>=t2.x --老规矩,先排序
and (t1.x+t2.x )not in (4,5,17,18) --把知道和就能知道组合的去掉
group by ( t1.x * t2.x) having count(*)=1)
group by ( t1.x + t2.x) having count(*)=1
)
and (t1.x *t2.x) not in --在这个结果范围里知道积 有2种以上可能性的干掉
(
select t1.x*t2.x
from #t2 t1, #t2 t2
where t1.x>=t2.x --老规矩,先排序
and (t1.x+t2.x )not in (4,5,17,18) --把知道和就能知道组合的去掉
and (t1.x * t2.x ) not in (select t1.x * t2.x from #t2 t1, #t2 t2 --把剩下范围中知道积就能唯一确定的去掉
where t1.x>=t2.x
and (t1.x+t2.x )not in (4,5,17,18)
group by ( t1.x * t2.x) having count(*)=1)
and (t1.x +t2.x) in --把知道何就知道两个值的取出来
(
select t1.x+t2.x
from #t2 t1, #t2 t2
where t1.x>=t2.x --老规矩,先排序
and (t1.x+t2.x )not in (4,5,17,18) --把知道和就能知道组合的去掉
and (t1.x * t2.x ) not in (select t1.x * t2.x from #t2 t1, #t2 t2 --把剩下范围知道积就能唯一确定的去掉
where t1.x>=t2.x --老规矩,先排序
and (t1.x+t2.x )not in (4,5,17,18) --把知道和就能知道组合的去掉
group by ( t1.x * t2.x) having count(*)=1)
group by ( t1.x + t2.x) having count(*)=1)
group by ( t1.x * t2.x) having count(*)>1
)
1、
select top 36 identity(int,1,1) x into #t from syscolumns
go
select t1.x,t2.x,t3.x
from #t t1,#t t2,#t t3
where t1.x*t2.x*t3.x=36 --和
and t1.x>=t2.x and t1.x>=t2.x and t2.x>=t3.x --按照年龄排序
and (t1.x+t2.x+t3.x) in --只有一重情况在知道和的时候无法确定,就是和有多个
(select (t1.x+t2.x+t3.x) from #t t1,#t t2,#t t3
where t1.x*t2.x*t3.x=36
and t1.x>=t2.x and t1.x>=t2.x and t2.x>=t3.x group by (t1.x+t2.x+t3.x) having count(*)>1)
and t1.x>t2.x --有老大
go
2、我怎么算出两个答案?
4,4 6,3
我还要反证 答案3和4是不对的
如果两个数是3和4 那么甲知道和为7 (25 34),乙知道积为12(26 34)
那么条件1和2都暂时成立 甲可以根据条件2 得出积不可能为10,因为那样乙不用甲说都知道.那么甲就得出 为3和4 条件3也成立
反过来 乙若猜 和=8(2+6)
甲有 26 35 甲可以根据条件2得出为26 条件3成立
乙若猜 和=7(3+4)
甲有 25 34 甲也可以据条件2得出为34 条件3成立
以上两种可能皆成立 那么条件4就肯定不能成立了
也就是说乙不可能根据条件3猜出数是多少来
也就是说如果是3和4的话 条件4限制,乙绝对不能说"我也猜到了"
因为两种可能都成立,所以结果3和4是不正确的!