Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #7873 > unrolled thread
| Started by | Mobius ReX <aoirex@gmail.com> |
|---|---|
| First post | 2012-01-16 11:57 +0000 |
| Last post | 2012-01-16 11:57 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: How to check whether an infinite set is closed under addition? Mobius ReX <aoirex@gmail.com> - 2012-01-16 11:57 +0000
| From | Mobius ReX <aoirex@gmail.com> |
|---|---|
| Date | 2012-01-16 11:57 +0000 |
| Subject | Re: How to check whether an infinite set is closed under addition? |
| Message-ID | <jf13ar$5j5$1@smc.vnet.net> |
Sorry the condition of a set A to be closed under addition should be
`a_i*n + a_j*m =E2=88=88 A` for any positive integers `n` and `m` for any a_i =E2=88=88 A.
On Sun, Jan 15, 2012 at 4:55 PM, Mobius ReX <aoirex@gmail.com> wrote:
> I just realized that there should be a further story here.
> To check whether the set is complete, we should also check whether the
> addition of a_i with itself with multiple times is also included in
> the set.
>
> This means that for a set A to be closed, its elements a_i =E2=88=88 A should satisfy
>
> 1). a_i + a_j =E2=88=88 A for any a_i and a_j;
> 2). a_i * n =E2=88=88 =C2 A for any positive integer n.
>
> Any more tips to quickly check the second condition?
>
> Thanks.
>
> Best,
> Rex
>
>
>
> On Sun, Jan 15, 2012 at 2:57 PM, Mobius ReX <aoirex@gmail.com> wrote:
>> Dear Andrzej,
>>
>> Cool! Thanks a lot.
>>
>> Best,
>> Renjun
>>
>>
>> On Sun, Jan 15, 2012 at 4:22 AM, Andrzej Kozlowski <akoz@mimuw.edu.pl> wrote:
>>>
>>> On 15 Jan 2012, at 12:00, Andrzej Kozlowski wrote:
>>>
>>>> Let
>>>> On 15 Jan 2012, at 10:51, Rex wrote:
>>>>
>>>>> Given k positive numbers a_1<a_2<a_3<...<a_k, and all integers greater
>>>>> than a_k, we want to check whether this set {a_1, a_2, a_3,...a_k, a_k
>>>>> + 1, a_k+2, ......} is closed under addition.
>>>>>
>>>>> Is there any easy way to do this? any functions that we could use in
>>>>> Mathematica?
>>>>>
>>>>> Your help will be greatly appreciated.
>>>>>
>>>>>
>>>>
>>>> Lest's call your set {a1,a2,...,a3} "base". Then:
>>>>
>>>> closedQ[base_List] :=
>>>> Complement[Select[Total[Subsets[base, {2}], {2}], # <= Max[base] &],
>>>> =C2 base] == {}
>>>>
>>>> For example:
>>>>
>>>> closedQ[{1, 2, 3}]
>>>>
>>>> True
>>>>
>>>> closedQ[{1, 4, 6, 7}]
>>>>
>>>> False
>>>>
>>>> Andrzej Kozlowski
>>>>
>>>
>>> The program above does dome unnecessary comparisons since anything added to the largest element of the base will obviously included in the complete set. If the base is ordered, a better program will be:
>>>
>>> closedQ[base_List] :=
>>> =C2 Complement[
>>> =C2 Select[Total[Subsets[Most[base], {2}], {2}], # <= Last[base] &],
>>> =C2 base] == {}
>>>
>>> If it is not ordered we could use Sort[base] in place of base.
>>>
>>> Andrzej Kozlowski
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web