Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial commit for Pg. 11, NTR-ABCG Eq. 30-32 #50

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

m6keller
Copy link

@m6keller m6keller commented Mar 9, 2022

No description provided.

@ndattani
Copy link
Member

Hi @m6keller!
Thanks for this valliant attempt at verifying NTR-ABCG in MATLAB. Here's a few remarks:

  1. I hope you're aware that your code will not run, because you've never defined bk
  2. I'm surprised you didn't define the k in bk because you did seem to set k=6 elsewhere in the equation.
  3. It looks like your LHS is the RHS of Eq. 31, your RHS is the RHS of Eq. 32, and you don't have Eq. 30 anywhere (other than the fact that you chose k=6 for Eqs. 31-32.

Here's how all these problems can be fixed:
(1-2) Use b6 instead of bk, if k=6.
(3) There's three quadratizations to verify here: Eqs. 30, 31, 32.

  • For Eq. 31, LHS should be the LHS of Eq. 31, and RHS should be the RHS of Eq. 31.
  • For Eq. 32, LHS should be the LHS of Eq. 31, and RHS should be the RHS of Eq. 32.
  • For Eq. 30, you would have to quadratize the RHS of Eq. 30 using the RHS of Eq. 29, 31 and/or 32. Do all three give the same result?
    (4) Once you've quadratized Eq. 30, enter the quadratized version in this file.
    (5) Once you've completed step (4), open your resume, and add "TeX/LaTeX" to it :)
    (6) You will need to use reshape (as you suspected, based on the email you wrote to me). This is because LHS will represent a 6-variable function whereas RHS will represent a 7-variable function. You can't compare two vectors with isequal(LHS,RHS) if they have different lengths. I'd recommend looking at how the reshape process works for for other (simple) examples from earlier in the book, to get a grasp of what's going on here. Basically LHS = min_ba(RHS), meaning that if you minimize over the auxiliary variable, then LHS and RHS are completely equal, for all 2^n possibilities for the n variables. Reshape helps you when trying to verify LHS = min_ba(RHS). In the end, we need LHS=RHS for all three of Eq. 30,31,32 (and I guess Eq. 29 too since it's written slightly differently compared to the rest).

Finally, you might have noticed that there's not many branches in this repository, despite us having 15 contributors including yourself. Preferably, you would have made your own fork rather than creating an entirely new branch for this. This was instruction (6) in my email: "Fork the repo and push your changes". If we created a new branch for every addition, the repository would get a bit messy. Now that you've created this branch, you might as well continue using it, but in the future I would recommend to make your own fork first.

@ndattani
Copy link
Member

ndattani commented Sep 7, 2022

Thank you @m6keller for this update! Have you addressed all of the above comments? Do you have any experience with LaTeX? Only one file has been modified in this pull request (that is the MATLAB file), so it looks like the .tex file still needs work (i.e. writing down the quadratization version). The equation numbers may have changed in the most recent version on Master, but the version in your branch seems like it hasn’t pulled those changes from Master yet, so the Eqs numbers should be consistent with the version in your branch.

I’m hoping to submit an updated version of the book soon, so anyone who wants to have their contributions included in this version is encouraged to try to get their pull requests approved as soon as possible.

Also, good luck with Fall 2022!

@m6keller
Copy link
Author

m6keller commented Sep 7, 2022

Thanks for the feedback @ndattani! I don't have a lot of experience with LaTex, but I updated the .tex file using the same syntax as the other equations and used overleaf to compile the updated file.

@ndattani
Copy link
Member

ndattani commented Sep 9, 2022

Thanks @m6keller! I'm very glad that you didn't push the compiled .pdf file into the repository because Overleaf's PDF would look very different from the in-house PDF we created using pdflatex. This would cause a huge number of "differences" to arise between this branch and the Master branch, which would cause a bit of a disaster. However if you could snip a screenshot of the exact part of the book that you modified (not the whole page, but just the modified part) it would be helpful for me to review the changes before putting them in the final version of the book. This is an example of another student recently doing that.

@ndattani
Copy link
Member

ndattani commented Sep 9, 2022

I have verified that all 4 of the isequal statements in your code give a 1. That's great news!

@ndattani
Copy link
Member

ndattani commented Sep 9, 2022

Good work Matthew! I confirmed that everything that you added to the .m file does match with what's in the book. You did well overall on this task!!!

It just took a long time to verify because there was that delay between my comment on March 12th and your next commit on March 25th (which had us losing some momentum) then 6 month delay in getting the .tex file to contain what was in my March 12th instructions. Looking at this now, I had forgotten the details of what was going on back in March with this Pull Request, so it took me longer than usual to "review" it.

I'm just waiting for that screenshot to be pasted here in this conversation, like I mentioned in my first of today's many comments.

@m6keller
Copy link
Author

m6keller commented Sep 9, 2022

Here is the part of the .tex file that I edited:

Screen Shot 2022-09-09 at 7 18 29 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants