ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 07 Nov 2019 09:37:24 +0100maximizing sum over feasible set of vectorshttps://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/Let $[5]$ be the set of the first 5 positive integers. We let $\underline{\alpha} =(\alpha_A)_{A\neq \emptyset, A\subseteq [5]}$ consist of a vector with $31$ real entries, where each $\alpha_A$ is associated with a subset $A \subseteq [5]$.
Define $\displaystyle OBJ(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A \log(|A|)$, $\quad \displaystyle v(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A$, $\quad$ and $\quad \displaystyle E(\underline{\alpha})=\sum_{ {A,B}: A\cap B\neq \emptyset} \alpha_A \alpha_B$,
where the sum for $E(\underline{\alpha})$ is taken over all unordered pairs of disjoint nonempty sets $A$ and $B$, where $A, B \subseteq [5]$.
Also define $FEAS(1/4)$ to be the set of all such vectors $\underline{\alpha}$ with nonnegative real entries such that $v(\underline{\alpha})=1$ and $E(\underline{\alpha})\geq 1/4$.
I want to learn how to program the following optimization problem:
$$\displaystyle OPT(1/4):=\max_{\underline{\alpha} \in FEAS(1/4)} OBJ(\underline{\alpha})$$
I was told that I can do this in SageMath. I have some basic knowledge of how to use Sage. How could I create the set $FEAS(1/4)$? I think that from there I may be able to figure out how to maximize $OBJ(\underline{\alpha})$ over this set.Tue, 05 Nov 2019 22:28:50 +0100https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/Comment by Emmanuel Charpentier for <p>Let $[5]$ be the set of the first 5 positive integers. We let $\underline{\alpha} =(\alpha_A)_{A\neq \emptyset, A\subseteq [5]}$ consist of a vector with $31$ real entries, where each $\alpha_A$ is associated with a subset $A \subseteq [5]$. </p>
<p>Define $\displaystyle OBJ(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A \log(|A|)$, $\quad \displaystyle v(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A$, $\quad$ and $\quad \displaystyle E(\underline{\alpha})=\sum_{ {A,B}: A\cap B\neq \emptyset} \alpha_A \alpha_B$,
where the sum for $E(\underline{\alpha})$ is taken over all unordered pairs of disjoint nonempty sets $A$ and $B$, where $A, B \subseteq [5]$.</p>
<p>Also define $FEAS(1/4)$ to be the set of all such vectors $\underline{\alpha}$ with nonnegative real entries such that $v(\underline{\alpha})=1$ and $E(\underline{\alpha})\geq 1/4$.</p>
<p>I want to learn how to program the following optimization problem:
$$\displaystyle OPT(1/4):=\max_{\underline{\alpha} \in FEAS(1/4)} OBJ(\underline{\alpha})$$</p>
<p>I was told that I can do this in SageMath. I have some basic knowledge of how to use Sage. How could I create the set $FEAS(1/4)$? I think that from there I may be able to figure out how to maximize $OBJ(\underline{\alpha})$ over this set.</p>
https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48637#post-id-48637Homework ?Wed, 06 Nov 2019 04:49:25 +0100https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48637#post-id-48637Comment by Emmanuel Charpentier for <p>Let $[5]$ be the set of the first 5 positive integers. We let $\underline{\alpha} =(\alpha_A)_{A\neq \emptyset, A\subseteq [5]}$ consist of a vector with $31$ real entries, where each $\alpha_A$ is associated with a subset $A \subseteq [5]$. </p>
<p>Define $\displaystyle OBJ(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A \log(|A|)$, $\quad \displaystyle v(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A$, $\quad$ and $\quad \displaystyle E(\underline{\alpha})=\sum_{ {A,B}: A\cap B\neq \emptyset} \alpha_A \alpha_B$,
where the sum for $E(\underline{\alpha})$ is taken over all unordered pairs of disjoint nonempty sets $A$ and $B$, where $A, B \subseteq [5]$.</p>
<p>Also define $FEAS(1/4)$ to be the set of all such vectors $\underline{\alpha}$ with nonnegative real entries such that $v(\underline{\alpha})=1$ and $E(\underline{\alpha})\geq 1/4$.</p>
<p>I want to learn how to program the following optimization problem:
$$\displaystyle OPT(1/4):=\max_{\underline{\alpha} \in FEAS(1/4)} OBJ(\underline{\alpha})$$</p>
<p>I was told that I can do this in SageMath. I have some basic knowledge of how to use Sage. How could I create the set $FEAS(1/4)$? I think that from there I may be able to figure out how to maximize $OBJ(\underline{\alpha})$ over this set.</p>
https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48639#post-id-48639Also, go easy on (pseudo-)formalism: I can't make head or tails of your definition of $\underline{\alpha}$... For another example, you define $A$ as a subset of $[5]$ ; but now, what is $\log(|A|)$ ???Wed, 06 Nov 2019 05:22:56 +0100https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48639#post-id-48639Comment by rburing for <p>Let $[5]$ be the set of the first 5 positive integers. We let $\underline{\alpha} =(\alpha_A)_{A\neq \emptyset, A\subseteq [5]}$ consist of a vector with $31$ real entries, where each $\alpha_A$ is associated with a subset $A \subseteq [5]$. </p>
<p>Define $\displaystyle OBJ(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A \log(|A|)$, $\quad \displaystyle v(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A$, $\quad$ and $\quad \displaystyle E(\underline{\alpha})=\sum_{ {A,B}: A\cap B\neq \emptyset} \alpha_A \alpha_B$,
where the sum for $E(\underline{\alpha})$ is taken over all unordered pairs of disjoint nonempty sets $A$ and $B$, where $A, B \subseteq [5]$.</p>
<p>Also define $FEAS(1/4)$ to be the set of all such vectors $\underline{\alpha}$ with nonnegative real entries such that $v(\underline{\alpha})=1$ and $E(\underline{\alpha})\geq 1/4$.</p>
<p>I want to learn how to program the following optimization problem:
$$\displaystyle OPT(1/4):=\max_{\underline{\alpha} \in FEAS(1/4)} OBJ(\underline{\alpha})$$</p>
<p>I was told that I can do this in SageMath. I have some basic knowledge of how to use Sage. How could I create the set $FEAS(1/4)$? I think that from there I may be able to figure out how to maximize $OBJ(\underline{\alpha})$ over this set.</p>
https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48646#post-id-48646$|A|$ means the number of elements in $A$. To have $\underline{\alpha}$ be a vector one should choose an ordering of the (nonempty) subsets of $[5]$, e.g. by identifying them with binary strings of length 5 (not equal to $00000$).Wed, 06 Nov 2019 12:38:39 +0100https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48646#post-id-48646Comment by rburing for <p>Let $[5]$ be the set of the first 5 positive integers. We let $\underline{\alpha} =(\alpha_A)_{A\neq \emptyset, A\subseteq [5]}$ consist of a vector with $31$ real entries, where each $\alpha_A$ is associated with a subset $A \subseteq [5]$. </p>
<p>Define $\displaystyle OBJ(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A \log(|A|)$, $\quad \displaystyle v(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A$, $\quad$ and $\quad \displaystyle E(\underline{\alpha})=\sum_{ {A,B}: A\cap B\neq \emptyset} \alpha_A \alpha_B$,
where the sum for $E(\underline{\alpha})$ is taken over all unordered pairs of disjoint nonempty sets $A$ and $B$, where $A, B \subseteq [5]$.</p>
<p>Also define $FEAS(1/4)$ to be the set of all such vectors $\underline{\alpha}$ with nonnegative real entries such that $v(\underline{\alpha})=1$ and $E(\underline{\alpha})\geq 1/4$.</p>
<p>I want to learn how to program the following optimization problem:
$$\displaystyle OPT(1/4):=\max_{\underline{\alpha} \in FEAS(1/4)} OBJ(\underline{\alpha})$$</p>
<p>I was told that I can do this in SageMath. I have some basic knowledge of how to use Sage. How could I create the set $FEAS(1/4)$? I think that from there I may be able to figure out how to maximize $OBJ(\underline{\alpha})$ over this set.</p>
https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48653#post-id-48653I didn't ask the question, but yes that's right. The binary ordering was just a (natural) suggestion. Of course the ordering is irrelevant, but probably some ordering is necessary for the implementation.Wed, 06 Nov 2019 20:16:48 +0100https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48653#post-id-48653Comment by Emmanuel Charpentier for <p>Let $[5]$ be the set of the first 5 positive integers. We let $\underline{\alpha} =(\alpha_A)_{A\neq \emptyset, A\subseteq [5]}$ consist of a vector with $31$ real entries, where each $\alpha_A$ is associated with a subset $A \subseteq [5]$. </p>
<p>Define $\displaystyle OBJ(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A \log(|A|)$, $\quad \displaystyle v(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A$, $\quad$ and $\quad \displaystyle E(\underline{\alpha})=\sum_{ {A,B}: A\cap B\neq \emptyset} \alpha_A \alpha_B$,
where the sum for $E(\underline{\alpha})$ is taken over all unordered pairs of disjoint nonempty sets $A$ and $B$, where $A, B \subseteq [5]$.</p>
<p>Also define $FEAS(1/4)$ to be the set of all such vectors $\underline{\alpha}$ with nonnegative real entries such that $v(\underline{\alpha})=1$ and $E(\underline{\alpha})\geq 1/4$.</p>
<p>I want to learn how to program the following optimization problem:
$$\displaystyle OPT(1/4):=\max_{\underline{\alpha} \in FEAS(1/4)} OBJ(\underline{\alpha})$$</p>
<p>I was told that I can do this in SageMath. I have some basic knowledge of how to use Sage. How could I create the set $FEAS(1/4)$? I think that from there I may be able to figure out how to maximize $OBJ(\underline{\alpha})$ over this set.</p>
https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48652#post-id-48652Okay. you want to (pedantly) number the components of $\underline{\alpha}$ in binary. And to ignore $\alpha_0$. Right ?
$A$ is therefore an index of the 31 components of $\underline{\alpha}$,$v(\underline{\alpha})$ is $\sum_{i=1}^{32}\alpha_{i-1}$. Still right ?Wed, 06 Nov 2019 19:46:07 +0100https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48652#post-id-48652Comment by Emmanuel Charpentier for <p>Let $[5]$ be the set of the first 5 positive integers. We let $\underline{\alpha} =(\alpha_A)_{A\neq \emptyset, A\subseteq [5]}$ consist of a vector with $31$ real entries, where each $\alpha_A$ is associated with a subset $A \subseteq [5]$. </p>
<p>Define $\displaystyle OBJ(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A \log(|A|)$, $\quad \displaystyle v(\underline{\alpha})=\sum_{A\subseteq [5], A\neq \emptyset} \alpha_A$, $\quad$ and $\quad \displaystyle E(\underline{\alpha})=\sum_{ {A,B}: A\cap B\neq \emptyset} \alpha_A \alpha_B$,
where the sum for $E(\underline{\alpha})$ is taken over all unordered pairs of disjoint nonempty sets $A$ and $B$, where $A, B \subseteq [5]$.</p>
<p>Also define $FEAS(1/4)$ to be the set of all such vectors $\underline{\alpha}$ with nonnegative real entries such that $v(\underline{\alpha})=1$ and $E(\underline{\alpha})\geq 1/4$.</p>
<p>I want to learn how to program the following optimization problem:
$$\displaystyle OPT(1/4):=\max_{\underline{\alpha} \in FEAS(1/4)} OBJ(\underline{\alpha})$$</p>
<p>I was told that I can do this in SageMath. I have some basic knowledge of how to use Sage. How could I create the set $FEAS(1/4)$? I think that from there I may be able to figure out how to maximize $OBJ(\underline{\alpha})$ over this set.</p>
https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48661#post-id-48661Okay. But there are still contradictions : for example, $E(\underline{\alpha})$ is definded as a sum iover pairs $A,\\,B$ with $A\cap B\neq\emptyset$, but with the "precision";
> **disjoint** nonempty sets $A$ and $B$
which is contradictory (disjoint sets are *defined* by an empty intersection...).
The original poster should attempt to clarify what he's after : we (I, for the least) have limited time to play games...Thu, 07 Nov 2019 09:37:24 +0100https://ask.sagemath.org/question/48630/maximizing-sum-over-feasible-set-of-vectors/?comment=48661#post-id-48661