I came across something I find interesting while researching fun little mathematical topics. I came across a video called "The Wrong Way To Reduce Fractions. But It Works Sometimes."

https://youtube.com/watch?v=fQl040dANZw

From looking this up, I realized it has a name: anomalous cancellation. I decided to make a program to detect and generate these fractions.

For purposes of the program, a fraction is anomalously cancellable if it evaluates to a number less than 1, and it results in an equal fraction if you remove all like digits from the numerator and denominator. Leading zeroes are not allowed, nor are trailing zeroes if they cancel with other trailing zeroes.
As one example, 163/326 is anomalously cancellable, because if you "cancel" the 6s and 3s, you end up with 1/2, which is indeed equal to 163/326.

I have a rudimentary program in CE BASIC to detect these kinds of fractions (CE because I used toString() for many things), and a similar one to "generate" by checking every rational number (up to a point) and seeing if they fit this definition. I'm sure there are faster and better ways to do it, though. Razz

Before I start speeding up my program (partly because I now have no way of uploading my program until I get a new computer), I wanna see how you would tackle this, checking if some fraction is anomalously cancellable. I also wonder if, through some math, someone could somehow find out some properties of these fractions so I can avoid checking some rational numbers.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement