用mathematica求解数学题!!紧急悬赏!! 70
用1到9这九个数组成等式()/()()+()/()()+()/()()=1用1至9这9个数字怎么组合相加后等于1,不可以重复使用数字Thetitelalreadysays...
用1到9这九个数组成等式( )/( )( )+( )/( )( )+( )/( )( )=1
用1至9这9个数字怎么组合相加后等于1,不可以重复使用数字
The titel already says everything. Given all the numbers (1,2,3,4,5,6,7,8,9) find a sum of fractions that combines to 1. There is no constraint on the number of fractions you use (although 4 is the maximum given the amount of numbers) and you can only use every number once!
Your assignment
- Write a program that gives as many possible solutions as possible
- Try a different number set, for instance hexadecimals
急求啊!!!!!!!!!!
发送至邮箱yinhe_yikongjian@sina.com 追加悬赏哦~~~ 不要打上来 直接发到邮箱! 展开
用1至9这9个数字怎么组合相加后等于1,不可以重复使用数字
The titel already says everything. Given all the numbers (1,2,3,4,5,6,7,8,9) find a sum of fractions that combines to 1. There is no constraint on the number of fractions you use (although 4 is the maximum given the amount of numbers) and you can only use every number once!
Your assignment
- Write a program that gives as many possible solutions as possible
- Try a different number set, for instance hexadecimals
急求啊!!!!!!!!!!
发送至邮箱yinhe_yikongjian@sina.com 追加悬赏哦~~~ 不要打上来 直接发到邮箱! 展开
2个回答
展开全部
三年前的问题……我干嘛还要来答哟……而且这题面不清啊,分母上的那个,是相乘还是两数连接呢?如果是相乘的话:
Select[Permutations@Range@9, Apply[(#1)/((#2) (#3)) + (#4)/((#5) (#6)) + (#7)/((#8) (#9)) &, #] == 1 &]
得到满足条件的解有:
{{1, 3, 6, 5, 8, 9, 7, 2, 4}, {1, 3, 6, 5, 8, 9, 7, 4, 2}, {1, 3, 6, 5, 9, 8, 7, 2, 4}, {1, 3, 6, 5, 9, 8, 7, 4, 2}, {1, 3, 6, 7, 2, 4, 5, 8, 9}, {1, 3, 6, 7, 2, 4, 5, 9, 8}, {1, 3, 6, 7, 4, 2, 5, 8, 9}, {1, 3, 6, 7, 4, 2, 5, 9, 8}, {1, 6, 3, 5, 8, 9, 7, 2, 4}, {1, 6, 3, 5, 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, 4, 2, 5, 9, 8, 1, 3, 6}, {7, 4, 2, 5, 9, 8, 1, 6, 3}}
如果是连接的话:
Select[Partition[#, 3] & /@ Permutations@Range@9,
Total@Apply[(#1)/ToExpression[10 #2 + #3] &, #, {1}] == 1 &]
得到满足条件的解有:
{{{5, 3, 4}, {7, 6, 8}, {9, 1, 2}},
{{5, 3, 4}, {9, 1, 2}, {7, 6, 8}},
{{7, 6, 8}, {5, 3, 4}, {9, 1, 2}},
{{7, 6, 8}, {9, 1, 2}, {5, 3, 4}},
{{9, 1, 2}, {5, 3, 4}, {7, 6, 8}},
{{9, 1, 2}, {7, 6, 8}, {5, 3, 4}}}
Select[Permutations@Range@9, Apply[(#1)/((#2) (#3)) + (#4)/((#5) (#6)) + (#7)/((#8) (#9)) &, #] == 1 &]
得到满足条件的解有:
{{1, 3, 6, 5, 8, 9, 7, 2, 4}, {1, 3, 6, 5, 8, 9, 7, 4, 2}, {1, 3, 6, 5, 9, 8, 7, 2, 4}, {1, 3, 6, 5, 9, 8, 7, 4, 2}, {1, 3, 6, 7, 2, 4, 5, 8, 9}, {1, 3, 6, 7, 2, 4, 5, 9, 8}, {1, 3, 6, 7, 4, 2, 5, 8, 9}, {1, 3, 6, 7, 4, 2, 5, 9, 8}, {1, 6, 3, 5, 8, 9, 7, 2, 4}, {1, 6, 3, 5, 8, 9, 7, 4, 2}, {1, 6, 3, 5, 9, 8, 7, 2, 4}, {1, 6, 3, 5, 9, 8, 7, 4, 2}, {1, 6, 3, 7, 2, 4, 5, 8, 9}, {1, 6, 3, 7, 2, 4, 5, 9, 8}, {1, 6, 3, 7, 4, 2, 5, 8, 9}, {1, 6, 3, 7, 4, 2, 5, 9, 8}, {5, 8,9, 1, 3, 6, 7, 2, 4}, {5, 8, 9, 1, 3, 6, 7, 4, 2}, {5, 8, 9, 1, 6, 3, 7, 2, 4}, {5, 8, 9, 1, 6, 3, 7, 4, 2}, {5, 8, 9, 7, 2, 4, 1, 3, 6}, {5, 8, 9, 7, 2, 4, 1, 6, 3}, {5, 8, 9, 7, 4, 2, 1, 3, 6}, {5, 8, 9, 7, 4, 2, 1, 6, 3}, {5, 9, 8, 1, 3, 6, 7, 2, 4}, {5, 9, 8, 1, 3, 6, 7, 4, 2}, {5, 9, 8, 1, 6, 3, 7, 2, 4}, {5, 9, 8, 1, 6, 3, 7, 4, 2}, {5, 9, 8, 7, 2, 4, 1, 3, 6}, {5, 9, 8, 7, 2, 4, 1, 6, 3}, {5, 9, 8, 7, 4, 2, 1, 3, 6}, {5, 9, 8, 7, 4, 2, 1, 6, 3}, {7, 2, 4, 1, 3, 6, 5, 8, 9}, {7, 2, 4, 1, 3, 6, 5, 9, 8}, {7, 2, 4, 1, 6, 3, 5, 8, 9}, {7, 2, 4, 1, 6, 3, 5, 9, 8}, {7, 2, 4, 5, 8, 9, 1, 3, 6}, {7, 2, 4, 5, 8, 9, 1, 6, 3}, {7, 2, 4, 5, 9, 8, 1, 3, 6}, {7, 2, 4, 5, 9, 8, 1, 6, 3}, {7, 4, 2, 1, 3, 6, 5, 8, 9}, {7, 4, 2, 1, 3, 6, 5, 9,
8}, {7, 4, 2, 1, 6, 3, 5, 8, 9}, {7, 4, 2, 1, 6, 3, 5, 9, 8}, {7, 4, 2, 5, 8, 9, 1, 3, 6}, {7, 4, 2, 5, 8, 9, 1, 6, 3}, {7, 4, 2, 5, 9, 8, 1, 3, 6}, {7, 4, 2, 5, 9, 8, 1, 6, 3}}
如果是连接的话:
Select[Partition[#, 3] & /@ Permutations@Range@9,
Total@Apply[(#1)/ToExpression[10 #2 + #3] &, #, {1}] == 1 &]
得到满足条件的解有:
{{{5, 3, 4}, {7, 6, 8}, {9, 1, 2}},
{{5, 3, 4}, {9, 1, 2}, {7, 6, 8}},
{{7, 6, 8}, {5, 3, 4}, {9, 1, 2}},
{{7, 6, 8}, {9, 1, 2}, {5, 3, 4}},
{{9, 1, 2}, {5, 3, 4}, {7, 6, 8}},
{{9, 1, 2}, {7, 6, 8}, {5, 3, 4}}}
2009-12-29
展开全部
9/12+7/68+5/34=1
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询