# The formula in 'get\_chunks\_fixed\_size\_with\_overlap' of C1M3\_Ungraded\_Lab\_2.ipynb might not be correct

**URL:** <https://community.deeplearning.ai/t/the-formula-in-get-chunks-fixed-size-with-overlap-of-c1m3-ungraded-lab-2-ipynb-might-not-be-correct/889307>\
**Category:** Retrieval Augmented Generation\
**Tags:** week-module-3, dl-ai-learning-platform, coursera-platform\
**Created:** [February 23, 2026, 3:32am UTC](https://community.deeplearning.ai/t/the-formula-in-get-chunks-fixed-size-with-overlap-of-c1m3-ungraded-lab-2-ipynb-might-not-be-correct/889307 "2026-02-23T03:32:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BlackHippo086](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/blackhippo086/32/15226_2.png) [@BlackHippo086](https://community.deeplearning.ai/u/BlackHippo086)\
**Post date:** [February 23, 2026, 3:32am UTC](https://community.deeplearning.ai/t/the-formula-in-get-chunks-fixed-size-with-overlap-of-c1m3-ungraded-lab-2-ipynb-might-not-be-correct/889307/1 "2026-02-23T03:32:42Z")

</div>

Here is what I understand how chunks of fixed size with overlap is supposed to work. Take chunk\_size = 100, chunk\_overlap = 0.05 as an example.  
The ending index is exclusive  
chunk 0: 0 - 100  
chunk 1: 95 - 195  
chunk 2: 190 - 290  
chunk 3: 285 - 385

It will keep advance. The range step size should (chunk\_size - overlap\_int). It’s 95 in this case. IMO, here is what the formula supposed to be:

> for i in range(0, len(text\_words), (chunk\_size - overlap\_int)):  
> chunk\_words = text\_words[i: i + chunk\_size]

Let me know if that makes sense. Thanks.

---

<div class="post-metadata">

**Author:** ![BlackHippo086](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/blackhippo086/32/15226_2.png) [@BlackHippo086](https://community.deeplearning.ai/u/BlackHippo086)\
**Post date:** [February 23, 2026, 4:42am UTC](https://community.deeplearning.ai/t/the-formula-in-get-chunks-fixed-size-with-overlap-of-c1m3-ungraded-lab-2-ipynb-might-not-be-correct/889307/2 "2026-02-23T04:42:45Z")

</div>

Forgot one more comment.  
I am seeing a lot of businesses are using `langchain_text_splitters.RecursiveCharacterTextSplitter` to chunk documents like

> ```auto
> 
> ```

text\_splitter = RecursiveCharacterTextSplitter(  
chunk\_size=500,  
chunk\_overlap=50,  
separators=[“\n\n”, “\n”, " ", “”]  
)

```auto

I am using `RecursiveCharacterTextSplitter` too. Is that good idea to just use `RecursiveCharacterTextSplitter` in place of our hand-made mix_chunker? Thanks
```
