@

**KittyKat**.... Since you "get the actual math", perhaps you can regale us with your knowledge, and tell us how you would calculate the probability mathematically. (BTW, it is

*not* the same as the probability of getting 4 heads in

*any* of the 10 flips.)

Then perhaps we could help you with the Excel formulation.

-----

In any case, I do not think that is what your instructor expects you do in Excel, unless it is also a part of the assignment that you did not state.

Instead, I think your instructor is asking for a

*simulation* (10,000 samples of 10 flips each) that

__estimates__ the probability by counting the number of samples that have exactly(?) 4 heads in a row.

(Regarding "exactly": That is my interpretation. It is up to you to decide if "4 heads in a row" means "4 or more heads in a row".)

To that end, you might build a row of 10 formulas of the form =--(RAND()<0.5), which returns 0 or 1.

If one row of formulas is in A1:J1, note that COUNTIF(A1:J1,1)=4 tells you that there are exactly 4 "heads" (1s). However, you would need to do more to determine if the 4 heads are "in a row" (contiguous).

One idea.... Enter the following formula into K1: =CONCATENATE(A1,B1,...,I1,J1). Fill in the ellipses ("..."). In Excel 2016 and later, I believe you can write =CONCAT(A1:J1). Then in L1, use =AND(COUNTIF(A1:J1,1)=4, ISNUMBER(FIND("1111",K1))) to recognize 4 "in a row".

Repeat that row of formulas 10,000 times.

In M1, =COUNTIF(L1:L10000,TRUE) is the number of times we encounter 4 heads in a row. With a VBA macro (or manually), repeat the experiment many times (I did 100). Then the average of values in M1 divided by 10000 should approximate the probability of 4 heads in a row of 10 flips.

Of course, if you know how to calculate the probability mathematically, it would helpful to verify the experimental result.

-----

Forgive me for doing your homework assignment for you, if indeed I did it correctly. It was fun! And it was too difficult to offer "guidance" without being explicit.