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

Changes for PTR-BCR-2 #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions everything_else/reproducing.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@
RHS = 1/2*(b1 + b2 + b3 + b4 - 2*ba1).*(b1 + b2 + b3 + b4 - 2*ba1 - 1);

%% Pg. 21, PTR-BCR-2

b = dec2bin(2^6-1:-1:0)-'0';
b1=b(:,1);b2=b(:,2);b3=b(:,3);b4=b(:,4);ba1=b(:,5);ba2=b(:,6);
LHS = min(reshape (b1.*b2.*b3.*b4,2,[]));
RHS = min(reshape (1/2*(4 + b1 + b2 + b3 + b4 - ba1 - 2.*ba2).*(3 + b1 + b2 + b3 + b4 - ba1 - 2.*ba2),2,[]));
isequal(LHS,RHS);
Copy link
Member

@ehuan2 ehuan2 Apr 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the super late review! So this right here actually doesn't give us the correct verification because the answer after isequal(LHS, RHS) is actually 0, when we want it to be 1. My suggestion (and what I believe to be the issue, though I'm not 100% on this fact since I'm not an expert) is the fact that we're reshaping the answer. So once we reshape the multiplication, what we're doing essentially is saying that the minimum over every two pairs of answers (ie over ba1, ba2) should give the same answer, though I think it should be over all of them (ie no need to reshape).


%% Pg. 22, PTR-BCR-3 (example appears to be the same as PTR-BCR-1, and may have to be redone)
%% Pg. 23, PTR-BCR-4
%% Pg. 24, PTR-KZ (needs an example!)
Expand Down