Utente:Grasso Luigi/sandbox4/Parte intera

In matematica, la funzione parte intera, nota anche come funzione floor (dalla parola inglese floor che significa "pavimento"), è la funzione che associa ad ogni numero reale il più grande intero minore o uguale a . La funzione parte intera è solitamente indicata con o .
La funzione mantissa, definita come , anche scritta come mod 1, oppure , è chiamata la parte frazionaria di . Ogni frazione può essere scritta come un numero misto, cioè la somma di un intero e una frazione propria. La funzione floor e la funzione parte frazionaria estendono questa decomposizione a tutti i numeri reali.
Proprietà
modificaQualche proprietà della funzione parte intera.
- Si ha
- con l'uguaglianza nella parte sinistra che vale se e solo se è un intero.
- La funzione parte intera è idempotente:
- Per ogni intero e ogni numero reale ,
- Per ogni e reali,
- Per ogni intero e ogni numero reale ,
- Per ogni e reali,
- Per ogni numero reale non intero si ha:
- L'ordinario arrotondamento di un numero all'intero più vicino può essere espresso come .
- La funzione parte intera non è continua, ma è semi-continua. Essendo una funzione costante a tratti , la sua derivata è zero quando esiste, cioè per tutti i valori che non sono interi.
- Se è un numero reale e un intero, si ha se e solo se In linguaggio ricercato, la funzione parte intera fa parte di una connessione di Galois; è l'aggiunta superiore della funzione che immerge gli interi nei reali.
- Usando la funzione floor, si possono produrre diverse formule per calcolare i numeri primi che sono esplicite ma non utilizzabili nella pratica.
- Il teorema di Beatty afferma che ogni numero irrazionale partiziona i numeri naturali in due sequenze tramite la funzione floor.
Parte intera superiore
modificaUna funzione strettamente correlata è la parte intera superiore, nota anche come funzione ceil (dalla parola inglese ceiling che significa "soffitto", contrapposta a floor, "pavimento"), definita nel modo seguente: per ogni numero reale , ceil( ) è il più piccolo intero non minore di . Per esempio, ceil(2,3) = 3, ceil(2) = 2 e ceil(−2,3) = -2. La funzione ceiling è anche indicata con . È facile provare che
e che
Se poi x non è un intero si ha
Per ogni intero k, abbiamo anche che:
Se m e n sono interi positivi primi fra di loro, allora
In programmazione
modifica(int)
In C
modificaPraticamente tutti i linguaggi di programmazione forniscono al programmatore la possibilità di convertire un valore di un certo tipo di dato in un valore di un altro tipo. Nello specifico, questo rende possibile convertire valori decimali (che vengono tipicamente rappresentati in virgola mobile) in numeri interi (di solito rappresentato come complemento a due).
Nel linguaggio di programmazione C, questo è reso possibile dall'operatore di casting (int)
.Questa operazione è un misto delle funzioni floor e ceiling: per x positivi o nulli, restituisce floor(x), e per x negativi restituisce ceil(x).
La stessa sintassi funziona con numerosi altri linguaggi, soprattutto quelli derivati dal C, come Java e Perl, così come la funzione POSIX floor().
Problemi di arrotondamento
modificaL'uso dell'arrotondamento può generare effetti imprevisti e che vanno contro quello che l'intuito suggerirebbe. Per esempio, (int)(0,6/0,2)
restituisce il valore 2 nella maggior parte delle implementazioni del C, anche se matematicamente è 0,6/0,2 = 3.
Questo problema è dovuto al fatto che i computer lavorano internamente con il sistema numerico binario e non è possibile rappresentare i numeri 0,6 e 0,2 con stringhe binarie di lunghezza finita. Più in generale: i computer non lavorano mai direttamente con un certo numero decimale, ma solo con una sua approssimazione. Nell'esempio, quindi, il risultato viene calcolato come 2,999999999999999555910790149937, che l'operatore (int)
converte tranquillamente al valore 2.
A causa di questi problemi, la maggior parte delle calcolatrici moderne usa internamente il sistema numerico decimale codificato in binario.
Distribuzione uniforme modulo 1
modificaSe è un numero irrazionale, allora le parti frazionarie , dove varia fra gli interi positivi, sono distribuite uniformemente nell'intervallo aperto . Questa affermazione può essere resa più precisamente in molti modi, uno dei quali afferma:
per ogni funzione continua a valori reali (si vedano limite, integrale e teorema dell'equidistribuzione).
Seguendo il principio generale dell'approssimazione diofantea scoperto da Hermann Weyl, questa proprietà è equivalente a qualcosa che è molto più facile da controllare: ossia che le somme
per sono O(N). Poiché sono progressioni geometriche, questo può essere provato in maniera abbastanza diretta. La condizione che sia irrazionale implica che
Troncamento
modificaMentre la funzione parte intera genera solamente numeri interi, il troncamento, cioè il "tagliare fuori le cifre", può essere effettuato a qualsiasi posizione specificata, non solo dopo la cifra delle unità.
Notazione
modificaLe funzioni parte intera superiore e inferiore sono normalmente indicate con parentesi quadre, chiuse e aperte, in cui le linee orizzontali superiori (per la funzione parte intera inferiore, floor) o inferiori (per la funzione parte intera superiore, ceiling) sono mancanti. Per esempio nel sistema di composizione editoriale LaTeX questi simboli possono essere realizzati con i comandi \lfloor, \rfloor, \lceil e \rceil.
Applicazioni
modificaMod operator
modificaFor an integer x and a positive integer y, the modulo operation, denoted by x mod y, gives the value of the remainder when x is divided by y. This definition can be extended to real x and y, y ≠ 0, by the formula
Then it follows from the definition of floor function that this extended operation satisfies many natural properties. Notably, x mod y is always between 0 and y, i.e.,
if y is positive,
and if y is negative,
Quadratic reciprocity
modificaGauss's third proof of quadratic reciprocity, as modified by Eisenstein, has two basic steps.[1][2]
Let p and q be distinct positive odd prime numbers, and let
First, Gauss's lemma is used to show that the Legendre symbols are given by
The second step is to use a geometric argument to show that
Combining these formulas gives quadratic reciprocity in the form
There are formulas that use floor to express the quadratic character of small numbers mod odd primes p:[3]
Arrotondamento di un numero reale
modificaL'arrotondamento intero di un numero reale è il numero intero più vicino a ; se sono due, scegliamo per convenzione il più grande in valore assoluto in modo che la funzione è dispari
che si può riassumere in un'unica formula valida per qualunque numero reale :
- .
dove la notazione dell'arrotondamento di un reale indica sia la sua parte intera inferiore o superiore[4] In sintesi le parti superiore, inferiore e arrotondamento intero sono caratterizzati dalle seguenti disuguaglianze (la terza solo per ):
all'intero più vicino con arrotondamento verso l'infinito positivo è dato dalla funzione
- ;
l'arrotondamento verso l'infinito negativo è dato come
- .
Se lo spareggio è diverso da 0, la funzione diventa
- (vedi sign function),
e l'arrotondamento verso pari si può esprimere con
che è l'espressione della funzione meno un indicatore d'integralità per .
- Arrotondare a una determinata precisione
Dato un reale strettamente positivo, l'arrotondamento alla precisione di un reale è un numero multiplo di più vicino a :
Dato un numero intero , l'arrotondamento decimale di all'ordine , è l'arrotondamento di alla precisione :
- .
Ad esempio, gli arrotondamenti degli ordini 0,1,2,3,4 del numero sono successivamente:
Con la notazione usuale, ad esempio , ciò significa che l'arrotondamento all'ordine 3 di è uguale a , in altre parole che .
For an arbitrary real number , rounding to the nearest integer with tie breaking towards positive infinity is given by ; rounding towards negative infinity is given as .
If tie-breaking is away from 0, then the rounding function is (see sign function), and rounding towards even can be expressed with the more cumbersome , which is the above expression for rounding towards positive infinity minus an integrality indicator for .
Rounding a real number to the nearest integer value forms a very basic type of quantizer – a uniform one. A typical (mid-tread) uniform quantizer with a quantization step size equal to some value can be expressed as
- ,
Number of digits
modificaThe number of digits in base b of a positive integer k is
Number of strings without repeated characters
modificaThe number of possible strings of arbitrary length that doesn't use any character twice is given by[5]Template:Better source needed
where:
- Template:Math > 0 is the number of letters in the alphabet (e.g., 26 in English)
- the falling factorial denotes the number of strings of length Template:Math that don't use any character twice.
- Template:Math! denotes the factorial of Template:Math
- Template:Math = 2.718... is Euler's number
For Template:Math = 26, this comes out to 1096259850353149530222034277.
Factors of factorials
modificaLet n be a positive integer and p a positive prime number. The exponent of the highest power of p that divides n! is given by a version of Legendre's formula[6]
where is the way of writing n in base p. This is a finite sum, since the floors are zero when pk > n.
Beatty sequence
modificaThe Beatty sequence shows how every positive irrational number gives rise to a partition of the natural numbers into two sequences via the floor function.[7]
Euler's constant (γ)
modificaThere are formulas for Euler's constant γ = 0.57721 56649 ... that involve the floor and ceiling, e.g.[8]
and
Riemann zeta function (ζ)
modificaThe fractional part function also shows up in integral representations of the Riemann zeta function. It is straightforward to prove (using integration by parts)[9] that if is any function with a continuous derivative in the closed interval [a, b],
Letting for real part of s greater than 1 and letting a and b be integers, and letting b approach infinity gives
This formula is valid for all s with real part greater than −1, (except s = 1, where there is a pole) and combined with the Fourier expansion for {x} can be used to extend the zeta function to the entire complex plane and to prove its functional equation.[10]
For s = σ + it in the critical strip 0 < σ < 1,
In 1947 van der Pol used this representation to construct an analogue computer for finding roots of the zeta function.[11]
Formulas for prime numbers
modificaThe floor function appears in several formulas characterizing prime numbers. For example, since is equal to 1 if m divides n, and to 0 otherwise, it follows that a positive integer n is a prime if and only if[12]
One may also give formulas for producing the prime numbers. For example, let pn be the n-th prime, and for any integer r > 1, define the real number α by the sum
Then[13]
A similar result is that there is a number θ = 1.3064... (Mills' constant) with the property that
are all prime.[14]
There is also a number ω = 1.9287800... with the property that
are all prime.[14]
Let Template:Pi(x) be the number of primes less than or equal to x. It is a straightforward deduction from Wilson's theorem that[15]
Also, if n ≥ 2,[16]
None of the formulas in this section are of any practical use.[17][18]
Solved problems
modificaRamanujan submitted these problems to the Journal of the Indian Mathematical Society.[19]
If n is a positive integer, prove that
Some generalizations to the above floor function identities have been proven.[20]
Unsolved problem
modificaThe study of Waring's problem has led to an unsolved problem:
Are there any positive integers k ≥ 6 such that[21]
Mahler has proved there can only be a finite number of such k; none are known.[22]
Note
modificaRiferimenti
- ^ Lemmermeyer, § 1.4, Ex. 1.32–1.33
- ^ Hardy & Wright, §§ 6.11–6.13
- ^ Lemmermeyer, p. 25
- ^ (EN) Eric W. Weisstein, Nearest Integer Function, in MathWorld, Wolfram Research. URL consultato il 10-10-24.
- ^ Template:OEIS el (See Formulas.)
- ^ Hardy & Wright, Th. 416
- ^ Graham, Knuth, & Patashnik, pp. 77–78
- ^ These formulas are from the Wikipedia article Euler's constant, which has many more.
- ^ Titchmarsh, p. 13
- ^ Titchmarsh, pp.14–15
- ^ Crandall & Pomerance, p. 391
- ^ Crandall & Pomerance, Ex. 1.3, p. 46. The infinite upper limit of the sum can be replaced with n. An equivalent condition is n > 1 is prime if and only if .
- ^ Hardy & Wright, § 22.3
- ^ a b Ribenboim, p. 186
- ^ Ribenboim, p. 181
- ^ Crandall & Pomerance, Ex. 1.4, p. 46
- ^ Ribenboim, p. 180 says that "Despite the nil practical value of the formulas ... [they] may have some relevance to logicians who wish to understand clearly how various parts of arithmetic may be deduced from different axiomatzations ... "
- ^ Hardy & Wright, pp. 344—345 "Any one of these formulas (or any similar one) would attain a different status if the exact value of the number α ... could be expressed independently of the primes. There seems no likelihood of this, but it cannot be ruled out as entirely impossible."
- ^ Ramanujan, Question 723, Papers p. 332
- ^ On some generalizations to floor function identities of Ramanujan (PDF), in Integers, vol. 22, 2022.
- ^ Hardy & Wright, p. 337
- ^ On the fractional parts of the powers of a rational number II, in Mathematika, vol. 4, n. 2, 1957, pp. 122–124, DOI:10.1112/S0025579300001170.
Altri progetti
modifica