Jump to content

Hey guys, I've been trying to study for my midterm that is next Tuesday by doing a bunch of problems in the book and I've come across one that is completely stumping me. Basically I'm supposed to find integers that make the given wff false. I was wondering if someone could just give a hint or some method to solve this because I've tried about 50 combinations of numbers with no luck.

The given wff is: {True} if x < y then y := y - x {y > 0} over the domain of integers 

I've basically tried to use logic to narrow it down, because the precondition does not help narrow the integers down at all; so I decided that the integers cannot be the same number because that would not satisfy the operation. I've tried using the assignment axiom to make it {y - x > 0} if x < y then y := y - x {y>0} but that didn't seem to help at all.

i5 4670k| Asrock H81M-ITX| EVGA Nex 650g| WD Black 500Gb| H100 with SP120s| ASUS Matrix 7970 Platinum (just sold)| Patriot Venom 1600Mhz 8Gb| Bitfenix Prodigy. Build log in progress 

Build Log here: http://linustechtips.com/main/topic/119926-yin-yang-prodigy-update-2-26-14/

Link to comment
https://linustechtips.com/topic/898931-make-a-wff-false-applied-logic/
Share on other sites

Link to post
Share on other sites

4 minutes ago, unkn0wn1 said:

it looks like you check if y is larger than x and if so subtract x from y and set it equal to y.

 

so try to make x larger than y?

Wow I was way over thinking that then lol

i5 4670k| Asrock H81M-ITX| EVGA Nex 650g| WD Black 500Gb| H100 with SP120s| ASUS Matrix 7970 Platinum (just sold)| Patriot Venom 1600Mhz 8Gb| Bitfenix Prodigy. Build log in progress 

Build Log here: http://linustechtips.com/main/topic/119926-yin-yang-prodigy-update-2-26-14/

Link to post
Share on other sites

6 hours ago, CJPowell27 said:

Wow I was way over thinking that then lol

Just as an aside, and because you've already figured it out, the output of this function can also be defined as y = y - (n - k) where n < y, and k is the ith term in the set, minus one.
This means that there is a closed form solution to get the ith item in the set. Can you derive it?
Additionally, the goal of the original problem is to find the set that makes the function false. There is also a closed form solution to get the ith term not in the set. Can you derive this function?

ENCRYPTION IS NOT A CRIME

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×