How Do You Calculate the Reflection of Numbers on a Board of Any Size?

AI Thread Summary
The discussion focuses on finding general functions to calculate the reflection of numbers on a two-row board of varying sizes. For the first case, a proposed equation is f(x) = floor(x/rowsize) * rowsize + (x % rowsize + 3) % rowsize, with a noted exception for when the result equals zero. The second case involves a displacement function where input numbers are adjusted by a fixed amount to yield their corresponding outputs. The solutions aim to be adaptable for any row size, emphasizing the need for generality in the equations. Overall, the thread seeks mathematical clarity on these reflection and displacement calculations.
xeon123
Messages
90
Reaction score
0
Hi,

I've this board, like shown in attachment, that has 2 rows. Each rows have 4 places. I'm trying to find a general function that gives me the reflection of the numbers.

I've 2 questions, so I put each question in a item.

a) Like shown in case a) of the attachment, If I write the number 1, my function must return the number 4. If I write the number 2, the function must return the number 3. If I write the number 5, must return the number 8, and if I write the number 7, it must return the number 6. And the opposite. If I write the number 4, I'll the number 1, etc...

As you can see, I've divided the card in half, and I'm trying to get the number that is on the opposition position of the card. I'm looking for a general equation, that answers me this for any row of any size. In this example, I've use a row with 4 position, but it could have been 7, 10, 15, etc...

Anyone can help me?

b) On the case b) it's a little different. I'm doing a kind of displacement. If I write the number 1, I'll get the number 3. If I write the number 2, I get the number 4, and the opposite. I'm also looking for a general function that returns me the correspondent value for any size of the row.

Any help?

Thanks,
 
Mathematics news on Phys.org
Here is the attachment.
 

Attachments

Here's your function for (a): {(1, 4), (2, 3), (4, 1), (3, 2), (5, 8), (6, 7), (8, 5), (7, 6)}.
 
I was looking for an equation, and not a function full of constants.

Answer for a):
I think the answer for a) is

z=rowsize
f(x)=\underline{x/z}*z+(x\%z+3)\%z

The \underline{} means floor.

The only problem with this equation is that, when (x%z+3)%z == 0, it gives x-1. For this case I've to create an exception.

Ideally, I would like to find a general equation for all the cases, but it's not possible.

Still missing answer for b).
 
Last edited:
The answer in the first row is 5-the input number:

Put in 1, get out 5-1=4
Put in 2, get out 5-2=3

For the second row its the same but the input numbers are 4 higher

Put in 5, minus 4=1, 5-1=4, plus 4=8
Put in 6, minus 4=2, 5-2=3, plus 4=7

This can be extended to any length row and column.
 
Thanks superg33k , your answer is better.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Thread 'Imaginary Pythagoras'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top